Загрузка видео...

Не удалось загрузить видео

На главную

CSS card parallax with pointermove + custom props 🧑‍🍳 <div class=ring style="--i: 2"> .ring { translate: calc(var(--px) * (var(--i) * -2rem)) calc(var(--py) * (var(--i) * 2rem)); } trick: pointer mapping to rotate card in 3D + translate rings 2D for the illusion 🤙 check it 👇

307,288 просмотров • 11 месяцев назад •via X (Twitter)

Комментарии: 39

Фото профиля Lúcás
Lúcás11 месяцев назад

Just needed to wait for the legend to catch in this . You’re cooking!

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

i was baited in with the tags haha 😅

Фото профиля Fede
Fede11 месяцев назад

man you're crazy. it looks better than the prototype

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

too kind Fede 🤙 fun one to build!

Фото профиля Yadu
Yadu11 месяцев назад

That's crazy

Фото профиля pedro costa — oss/acc
pedro costa — oss/acc11 месяцев назад

i’m convinced you are literally a wizard

Фото профиля Dominik Scholz
Dominik Scholz11 месяцев назад

love it!

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

thank you sir! 🙏

Фото профиля Muheer
Muheer11 месяцев назад

Css god 🙏🏻

Фото профиля ₿ruta | Yordan Hristov
₿ruta | Yordan Hristov11 месяцев назад

wait what how.... Are you thinking in algebra?

Фото профиля Seb Cornelius
Seb Cornelius11 месяцев назад

Hell yeah

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

lovely design Seb, couldn't resist 🤙 saw some people asking for CSS versions, got tagged, threw it together quick before bed 😅

Фото профиля Seb Cornelius
Seb Cornelius11 месяцев назад

Always love your stuff Jhey - feel free to build literally anything I make. Maybe we can collab on something dope in the future.

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

thanks Seb, appreciate that 🙏 these card designs are really neat that would be awesome 🤙 (love things like this design because you can bring them to life with not too much code, it's like this one 👇)

Фото профиля Seb Cornelius
Seb Cornelius11 месяцев назад

Thats rad

Фото профиля Chuks Gabriel
Chuks Gabriel11 месяцев назад

👒 up...

Фото профиля Mauro
Mauro11 месяцев назад

🐐

Фото профиля bfuzzy
bfuzzy11 месяцев назад

dope.

Фото профиля Senegal Coupe Du Monde 2030 (svp) 🇸🇳🇫🇷
Senegal Coupe Du Monde 2030 (svp) 🇸🇳🇫🇷11 месяцев назад

You are literally a wizard

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

@ved_aida tryin' 🫡

Фото профиля Ajay Patel
Ajay Patel11 месяцев назад

So creative, looks really good

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

jus' tappin' into some tricks i've been sharing, it was good timing 😅

Фото профиля Anko Painting
Anko Painting11 месяцев назад

How do you populate px? Js?

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

that's from pointermove/deviceorientation and maps from -1 to 1 on both axis (shown in video kinda) that then gets passed into CSS so it can do what it wants with the value 🤙

Фото профиля Elliot Otoijagha
Elliot Otoijagha11 месяцев назад

Are you the God of CSS? 😭😭

Фото профиля jhey ʕ•ᴥ•ʔ
jhey ʕ•ᴥ•ʔ11 месяцев назад

@Ellydev0 haha – never!

Фото профиля ⤴️🅰️💲🟡N
⤴️🅰️💲🟡N11 месяцев назад

like this?

Фото профиля Jargon is Easy
Jargon is Easy11 месяцев назад

Hats Off! Buddy @SebCornelius and @jh3yy

Фото профиля Django
Django11 месяцев назад

Wow bro it’s really good ,come on I want to know how to get it

Фото профиля cubiq
cubiq11 месяцев назад

so wish that wed get preserved 3d even when the overflow is clipping the contents.. but these illusion hacks are cool enough <3 great job as always, Jhey!

Фото профиля Akshat Goel
Akshat Goel11 месяцев назад

jhey blazzing fast 😭

Фото профиля Dennis H. A. van Leeuwen 🕹
Dennis H. A. van Leeuwen 🕹11 месяцев назад

Cool

Фото профиля Ditectrev
Ditectrev11 месяцев назад

Crazy🤯

Фото профиля NegiDesign
NegiDesign11 месяцев назад

🔥🔥🔥

Фото профиля Tee Godwin
Tee Godwin11 месяцев назад

Crazy stunting!

Фото профиля Anand Patel
Anand Patel11 месяцев назад

It looks stunning bro!!!

Фото профиля cubiq
cubiq11 месяцев назад

Just experimented with getting the perspective right, no hacks, actually proper, configurable perspective <3 ill make prettier looking demo and share it when it's done 🤍 (not a single line of js btw)

Фото профиля ikhwanb
ikhwanb11 месяцев назад

Brilliant

Фото профиля Sosaingram
Sosaingram11 месяцев назад

That's a very interesting one

Похожие видео

CSS Tip! 🎠 You can create a responsive infinite marquee animation with container queries and no duplicate items 🤙 li{ animation: slide; } @​keyframes slide { to { translate: 0% calc(var(--i) * -100%);}} The trick is animating the items, not the list 😎 More tricks 👇 To get this one working, you need to animate the items and not the list (Watch the video first?). Each item needs to know its row index (--i) in the list and the parent needs to know how many rows are in the list: ul { --count: 12; } li:nth-of-type(1), li:nth-of-type(2) { --i: 0; } li:nth-of-type(3), li:nth-of-type(4) { --i: 1; } Once you have that, translate each item based on its row index in the list li { translate: 0% calc((var(--count) - var(--i)) * 100%); } Now for the animation. The key here is that each row has an animation-delay calculated from its index (--i). That number is offset to make it negative so the animation start is offset ✨ ul { --duration: 10s; } li { --delay: calc((var(--duration) / var(--count)) * (var(--i) - 8)); animation: slide var(--duration) var(--delay) infinite linear; } Make sure to wrap that animation in: @​media (prefers-reduced-motion: no-preference) { ... } Lastly, the fun parts! 🤓 To create the "vignette" mask. Use a layered mask on the container 😷 .scene { --buff: 3rem; height: 100%; width: 100%; mask: linear-gradient(transparent, white var(--buff) calc(100% - var(--buff)), transparent), linear-gradient(90deg, transparent, white var(--buff) calc(100% - var(--buff)), transparent); mask-composite: intersect; } To create the 3D skewed effect, use a chained transform (Try toggling it in the demo ⚡️): .grid { transform: rotateX(20deg) rotateZ(-20deg) skewX(20deg); } As for the responsive part, use container queries! 🔥 article { container-type: inline-size; } When the article (card) is narrower than 400px update the grid and animation settings 🤙 Double the rows means double the duration! @​container (width < 400px) { .grid { --count: 12; grid-template-columns: 1fr; } li:nth-of-type(1) { --i: 0; } li:nth-of-type(2) { --i: 1; } li:nth-of-type(3) { --i: 2; } li:nth-of-type(4) { --i: 3; } li { --duration: 20s; } } CSS has the magic to be able to update those animations at runtime based on your custom property values 😎 An added bonus in this demo is that it doesn't require any JavaScript at all, for any of it 🤯 We can use CSS :has() for those toggles that update the styles, even the theme toggle! 🫶 Any questions, let me know! Make sure to check out the video. Will do a walkthrough one to follow-up 🤙 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

542,757 просмотров • 2 лет назад