正在加载视频...

视频加载失败

spritesheets are, and always will be, a fun trick! ⚡ translate with css based on pointer position grace note™ blink included ♪

154,132 次观看 • 1 个月前 •via X (Twitter)

55 条评论

Peter Petrash 的头像
Peter Petrash1 个月前

spritesheeted myself for my site ☺️ it has a mood system underneath including easter egg behaviors (eg. try hypnotizing it with your mouse)

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

haha 😅 that's real good i think where this one wins is because it doesn't try to be the "centerpiece", it's one of those where you've lined it up to be discovered easily, but then lets the user feel like they discovered it 👏

Peter Petrash 的头像
Peter Petrash1 个月前

appreciate it Jhey 👊

Boyd 的头像
Boyd1 个月前

I did something similar to this but for my dog.

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

love it - that's so good! 🐶

Boyd 的头像
Boyd1 个月前

Least I could do for him. He was a huge personality in our house.

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

i have no doubts from the pictures 🥲 such a lovely tribute 🫶

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

and of course, sorry for your loss Boyd, never quite know what the right words are 🙏 but, the "love it – it's so good" were definitely in regards to how well you have delivered that tribute 🫶

Boyd 的头像
Boyd1 个月前

Thanks! We miss him as a family but time has healed the immediate loss. Appreciate the kind words both about Pi and the project.

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

i didn't bookmark the post i saw doing the rounds for this the other day 🤦‍♂️ but saw a bunch of 'em so if someone has it to reference 🙏

Chauve Camille 的头像
Chauve Camille1 个月前

😮

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

that's the one i was looking for to QT 🙏 different technique but the same concept 💯

oil-oil 的头像
oil-oil1 个月前

I also implemented a similar effect on my website,

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

had a few questions about this one 🤙 - quick way: generate a video based on a character map and use ffmpeg etc. to split frames and create the sprite (you don't need a 3mb sprite file! compress!) - smoothing: track pointer pos + eased pos. the eased pos plays catch up, use that

Joel Stransky ✨ 的头像
Joel Stransky ✨1 个月前

I did this in 2005 in Flash.

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

never got to play with flash 🥲

Joel Stransky ✨ 的头像
Joel Stransky ✨1 个月前

You would have been the best of us.

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

ha 😅 i highly doubt that but from what i understand, that was an incredibly fun/creative era

Hurricane Zane 的头像
Hurricane Zane1 个月前

where is beaver demo? my son is requesting access

Techies Reviews 的头像
Techies Reviews1 个月前

Wohoo sprites are back baby!

dennys dionigi 的头像
dennys dionigi1 个月前

Fun trick also here 😆

Geryy 的头像
Geryy1 个月前

Back in my times we used sprite sheets for button hover states.... 🧓

mr.tipton 的头像
mr.tipton1 个月前

I love sprite sheets. I built a native utility app with sprite sheets being the UI. Haha This one is so good! Love the look and smoothness

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

sprites are always fun! i did put a little "smoothing" slider in there to try help things out on it 😁

mr.tipton 的头像
mr.tipton1 个月前

Looks great man

Jimmy Lee 的头像
Jimmy Lee1 个月前

This is so good, the future of avatars

Brayan 的头像
Brayan1 个月前

Any tips on smooth sprite animations?

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

in this case, keep the pointer position as "the target" then lerp/ease a separate value towards it on every frame and use that eased value to drive the spritesheet frame you’re smoothing the input, not the sprite itself 🤙

Ismael 的头像
Ismael1 个月前

Wait, I need this for my website

Ahmed Dahbi 的头像
Ahmed Dahbi1 个月前

wow super cool! love the blink 😉

Occam’s Orange 的头像
Occam’s Orange1 个月前

How did you generate the sprite in the first place? When i tried using gpt image or gemini, it keep duplicating the same image.

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

the skill with ai is prepping the journey 1. base image for your character 2. character map for your character 3. gaze rig for your character if you try jumping to 3, that's the issue, you need good reference material, and a good model Krea + GPT 2.0 for this one 🤙

Occam’s Orange 的头像
Occam’s Orange1 个月前

Thank you 🙏 I'm trying to make one for

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

ahh yes - you should be able to generate one for that little character 💯 try prompting for the prompts too my gaze rig prompt would start something like: 9x9 spritesheet head-rotation gaze rig for this character (map + basic images attached) and then i'll detail the angles

Occam’s Orange 的头像
Occam’s Orange1 个月前

Got it. Thanks a ton! The character is my son. Gotta pay him royalist

808 的头像
8081 个月前

Damn thats clean! I love the double blink, adds so much depth. Will this be added sooner or later to the /index?

Mane 的头像
Mane1 个月前

Didn’t know you vibes with beavers like that

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

it's a gopher 🥲

John Cotterell 的头像
John Cotterell1 个月前

The blinking is a really nice touch. I did something similar with this character. It is quite painstaking work doing it with a spritesheet.

Deepak 的头像
Deepak1 个月前

If I could follow one fucking person on X it'll be you man, you're the fucking goat

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

whoah - appreciate that 💯🙏 doin' what i can to try and post a little more again. i've been trying to collect/curate all my work over the years into one spot on my site, it's been takin' a minute 🙇‍♂️

Deepak 的头像
Deepak1 个月前

There's so much alpha in what you post, it's just an endless sea of knowledge. Thank you for your posts

yann · minimal design 的头像
yann · minimal design1 个月前

Is that on Codepen somewhere? 😍

Allie Speers 的头像
Allie Speers1 个月前

omg who is lil fella

jhey ʕ•ᴥ•ʔ 的头像
jhey ʕ•ᴥ•ʔ1 个月前

a little mascot i'm toying with for a project 😁

Simon 的头像
Simon1 个月前

really cool

Crownz | AI & Design 的头像
Crownz | AI & Design1 个月前

It does look fun

Joshua Ress, BSc 的头像
Joshua Ress, BSc1 个月前

I LOVE playing with spritesheets. Such a simple and effective trick

IGGYsosa 的头像
IGGYsosa1 个月前

Very very clever 👏 well done

Shubhu 的头像
Shubhu1 个月前

how many images you generated for this one?

Nattu 的头像
Nattu1 个月前

Thats some neat sprite management.

Anshuman 的头像
Anshuman1 个月前

The explanation on this one is superb!!! 🤯🙌

Dzmitry Drynau 的头像
Dzmitry Drynau1 个月前

Hmm, interesting and cool! I should try to do something like that on our platform.

Joseph Miclaus 的头像
Joseph Miclaus1 个月前

This is way too good... waaay too good.

Massdx 的头像
Massdx1 个月前

how ? can you share a tutorial ?

相关视频

CSS Trick 🧲 You can create magnetic links with the power of custom properties and some JavaScript 💪 a { translate: calc(clamp(-1, var(--x), 1) * var(--pad-x)) ...; transition: translate var(--s, 1s) var(--ease, var(--elastic)); } a:hover { --s: 0s; } The trick here is to pad out the list items wrapping your links and use that as a translation limit 🛑 Start by using some JavaScript to calculate a value between -1 and 1 for both the x/y axis on pointermove for each list item, not the link! 🔗 If your pointer was at the center of the item, you'd get [0,0]. If it was in the top right, you'd get [1,-1] ☝️ It's worth checking out the JavaScript snippet to see how the mapping function works. Essentially, you create a function that when given a value between two bounds, will give you a mapped value back 🤙 const mapX = mapRange( item.offsetWidth * -0.5, item.offsetWidth * 0.5, 1, -1 ) Then, on pointermove, you plug the pointer position in to get the value back out and pass that into your CSS const x = mapX(item.centerX - event.x) document​.documentElement​.style.setProperty(--x, x) When the pointer leaves the list item, you make sure to reset these values back to 0 ✨ Once CSS has your values, it's the trick of updating the translation of each part You know that in each axis, you only want to translate the link by the padding amount li a { translate: calc(clamp(-1, var(--x), 1) * var(--pad-x)) calc(clamp(-1, var(--y), 1) * var(--pad-y)); transition: translate var(--speed, 1s) var(--ease, var(--elastic)); } This will translate the link within the list item by the desired amount. The cool part here is that you can set an offset for the text inside the link and have that move at a different rate ⭐️ By only updating the --pad-x/y custom properties for the inside the link, you can control how much it moves nav a span { --pad-x: 0.25rem; --pad-y: 0.25rem; } And the last piece, how do you update the behavior for transition speeds? And so it springs back like that? Again, use custom properties ✨ a:hover { --s: 0s; } a { transition: translate var(--s, 1s) var(--ease, var(--elastic)); } By default, a link will use --elastic easing via linear() and have a transition-duration of 1s. When a link is hovered that speed becomes 0s because you want the link to magnetise to your pointer. How about that little gap between when your pointer enters the item but hasn't hovered the link? Set a different transition so it transitions to being hovered 🫶 nav li:hover a { --ease: ease-out; --speed: 0.1s; } That's kinda it! 🙌 Use JavaScript (~40 loc) to get the information and then let CSS do all the lifting for you 💪 Any questions or suggestions, let me know 🙏 If you want a walkthrough video, also let me know please 🙏 CodePen.IO link below 👇

jhey ʕ•ᴥ•ʔ

164,863 次观看 • 2 年前