User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
Admin
Wyvern-shaped software developer and hobby vector artist. Also sometimes a fluffy werewolf alien creature (Areon) or a bird (Corveon).

Creator of the neofoxes, neocats and other emojis.
wvrnBox
Website
https://volpeon.ink/
Speaking German, English
Age 30s
Pronouns he / him
Backup Account @volpeon@goto.wyvern.rip
Bonus Content @areon@icy.wyvern.rip
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@Legion495 Yes wyvPensive
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@Lingondrakenneofox_melt_reach
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@catraxx It's only running on test systems. It's safe to put stuff there on any day wyvUwu
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
Deployed a new version of our product for testing. What a stressful week that was. wvrnFlat
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
HP wants you to rent, not own, your next laptop
I want HP to die
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
Oh fuck no, the stink bugs are back
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
quantum-enabled AI
Oh, is this the next hype term after "agentic AI"?
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@Akulatraxas drgn_think_woozy
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@catraxx @ziphi @Bwee No way wyvAngel
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@Bwee @ziphi Maximum floof wyvHyper
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
It actually didn't add that much code.

I added a function to record the current velocity since the last frame. It loops with requestAnimationFrame and stores the coordinates in a variable so the next call can compare current and previous coordinates.

The velocity itself is computed as moving average. The window size is dynamic: 2 if the velocity is higher than the recorded one, and 15 if it's lower. The higher the window size, the less the impact of a new value on the average. This is necessary because when you're about to lift your finger, you typically slow down and this would've caused the final velocity to be lower than expected.

The inertia is also implemented with a function which calls itself in a requestAnimationFrame loop. I simply multiply the velocity variables by 0.95 and then add the velocity to the image coordinates.
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
The lightbox on my website now has inertia when moving the zoomed in image. It really makes the experience much better wyvCookie
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@ziphi EEEEEEEE2EEEEEEEEE wyvScream
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@Jain wyvMug
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@Soblow Sometimes I get a follower like this and I feel the same way neofox_lul
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
I'm so eepy wvrnFlat
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
Well GUESS WHAT
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@Enalys Happy hatchday drgn_pat
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@Baa Here's the original: knowyourmeme.com/memes/poob-has-it-for-you
User avatar
privTri Volpeon areon3NSmol @volpeon@icy.wyvern.rip
2mo
@morgunkorn neofox_googly_shocked