[TW5] - HammerWidgets to be revised

123 views
Skip to first unread message

BurningTreeC

unread,
Jun 19, 2021, 4:10:05 AM6/19/21
to TiddlyWiki
Hello dear TiddlyWikians,

I'm currently revising my HammerWidgets based on the hammer.js library and I'm planning to pack useful features into the plugin

Here there's a preview (prerelease currently) with only the <$pan> widget included. In this preview the pan widget is used to change the sidebar/story width using a slider between the sidebar and the story

There will also be <$swipe>, <$press>, <$tap> and <$pinch> widgets and I'm looking fore useful things we can build with them so that I can include them in the plugin

Maybe some of you are interested to check the preview out and to give me some feedback, all ideas are welcome :)

best wishes, BTC

Saq Imtiaz

unread,
Jun 19, 2021, 4:39:33 AM6/19/21
to TiddlyWiki
Hi BTC,

I was wondering if you have considered a more generic <$hammer> widget? 

The idea would be to create a DOM node and enable the swipe, press, tap etc events on that DOM node. This could then be wrapped in an <$eventcatcher> to react to the events.
Cheers,

Saq

BurningTreeC

unread,
Jun 19, 2021, 4:54:44 AM6/19/21
to TiddlyWiki
Hi Saq, no I hadn't considered that but I will, it's a great idea!

Thanks!

Saq Imtiaz

unread,
Jun 19, 2021, 5:04:17 AM6/19/21
to TiddlyWiki
You are welcome. I used this approach for implementing the swipe events in Streams and it worked really well. The big plus is that it means users can create their own UX on top of these events with just wikitext.

BurningTreeC

unread,
Jun 19, 2021, 5:10:32 AM6/19/21
to TiddlyWiki
Ok, I see. The problem that I'd be facing is with the pan event and its coordinates. How should those be propagated to an eventual <$eventcatcher> widget?

Saq Imtiaz

unread,
Jun 19, 2021, 5:18:36 AM6/19/21
to TiddlyWiki
Have a look at the variables made available to actions in the eventcatcher and see if that gives you what you need. I'm not familiar with hammerjs itself but event co-ordinates are made available as variables in eventcatcher. 

It could be that hammerjs events are structured differently though (which we might be able to find a generic way to support in eventcatcher). Or at least for now, you could subclass eventcatcher to create your own version of it that gives you the variables that you need.

TiddlyTweeter

unread,
Jun 19, 2021, 6:52:28 AM6/19/21
to TiddlyWiki
Ciao BurningTreeC

ALL the work you done on this has been good and solid in TW.
I use PC Desktop, PC Touch Tablet and Android Smart Phone.

Smart phones are problematic for multiple reasons. They are touch screen ONLY.

I AM interested in to what extent Hammer on smart-phone can do stuff I CAN do on touchscreen PC.
JUST FYI I found D-n-D, ironically, awful, on Android with TW :-(

Just a comment!
TT

Reply all
Reply to author
Forward
0 new messages