Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

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 görüntüleme • 11 ay önce •via X (Twitter)

39 Yorum

Lúcás profil fotoğrafı
Lúcás11 ay önce

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

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ11 ay önce

i was baited in with the tags haha 😅

Fede profil fotoğrafı
Fede11 ay önce

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

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ11 ay önce

too kind Fede 🤙 fun one to build!

Yadu profil fotoğrafı
Yadu11 ay önce

That's crazy

pedro costa — oss/acc profil fotoğrafı
pedro costa — oss/acc11 ay önce

i’m convinced you are literally a wizard

Dominik Scholz profil fotoğrafı
Dominik Scholz11 ay önce

love it!

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ11 ay önce

thank you sir! 🙏

Muheer profil fotoğrafı
Muheer11 ay önce

Css god 🙏🏻

₿ruta | Yordan Hristov profil fotoğrafı
₿ruta | Yordan Hristov11 ay önce

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

Seb Cornelius profil fotoğrafı
Seb Cornelius11 ay önce

Hell yeah

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ11 ay önce

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

Seb Cornelius profil fotoğrafı
Seb Cornelius11 ay önce

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

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ11 ay önce

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 profil fotoğrafı
Seb Cornelius11 ay önce

Thats rad

Chuks Gabriel profil fotoğrafı
Chuks Gabriel11 ay önce

👒 up...

Mauro profil fotoğrafı
Mauro11 ay önce

🐐

bfuzzy profil fotoğrafı
bfuzzy11 ay önce

dope.

Senegal Coupe Du Monde 2030 (svp) 🇸🇳🇫🇷 profil fotoğrafı
Senegal Coupe Du Monde 2030 (svp) 🇸🇳🇫🇷11 ay önce

You are literally a wizard

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ11 ay önce

@ved_aida tryin' 🫡

Ajay Patel profil fotoğrafı
Ajay Patel11 ay önce

So creative, looks really good

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ11 ay önce

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

Anko Painting profil fotoğrafı
Anko Painting11 ay önce

How do you populate px? Js?

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ11 ay önce

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 profil fotoğrafı
Elliot Otoijagha11 ay önce

Are you the God of CSS? 😭😭

jhey ʕ•ᴥ•ʔ profil fotoğrafı
jhey ʕ•ᴥ•ʔ11 ay önce

@Ellydev0 haha – never!

⤴️🅰️💲🟡N profil fotoğrafı
⤴️🅰️💲🟡N11 ay önce

like this?

Jargon is Easy profil fotoğrafı
Jargon is Easy11 ay önce

Hats Off! Buddy @SebCornelius and @jh3yy

Django profil fotoğrafı
Django11 ay önce

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

cubiq profil fotoğrafı
cubiq11 ay önce

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 profil fotoğrafı
Akshat Goel11 ay önce

jhey blazzing fast 😭

Dennis H. A. van Leeuwen 🕹 profil fotoğrafı
Dennis H. A. van Leeuwen 🕹11 ay önce

Cool

Ditectrev profil fotoğrafı
Ditectrev11 ay önce

Crazy🤯

NegiDesign profil fotoğrafı
NegiDesign11 ay önce

🔥🔥🔥

Tee Godwin profil fotoğrafı
Tee Godwin11 ay önce

Crazy stunting!

Anand Patel profil fotoğrafı
Anand Patel11 ay önce

It looks stunning bro!!!

cubiq profil fotoğrafı
cubiq11 ay önce

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 profil fotoğrafı
ikhwanb11 ay önce

Brilliant

Sosaingram profil fotoğrafı
Sosaingram11 ay önce

That's a very interesting one

Benzer Videolar

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 görüntüleme • 2 yıl önce