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

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
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@catsalad Biblically accurate cat in a parallel dimension
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@codimp What makes you think it's coded by AI?
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@Legion495 Yes wyvPensive
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@Lingondraken ☕ neofox_melt_reach
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@catraxx It's only running on test systems. It's safe to put stuff there on any day wyvUwu
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
Deployed a new version of our product for testing. What a stressful week that was. wvrnFlat
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
HP wants you to rent, not own, your next laptop
I want HP to die
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
Oh fuck no, the stink bugs are back
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
quantum-enabled AI
Oh, is this the next hype term after "agentic AI"?
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@Akulatraxas drgn_think_woozy
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@catraxx @ziphi @Bwee No way wyvAngel
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@Bwee @ziphi Maximum floof wyvHyper
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
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
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
The lightbox on my website now has inertia when moving the zoomed in image. It really makes the experience much better wyvCookie
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@ziphi EEEEEEEE2EEEEEEEEE wyvScream
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@Jain wyvMug
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@Soblow Sometimes I get a follower like this and I feel the same way neofox_lul
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
I'm so eepy wvrnFlat
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
Well GUESS WHAT
User avatar
Volpeon minwlf @volpeon@icy.wyvern.rip
9mo
@Enalys Happy hatchday drgn_pat