RSS FeedTwitterMastodonBlueskyShare IconHeart IconGithub IconArrow IconClock IconGUI Challenges IconHome IconNote IconBlog IconCSS IconJS IconHTML IconShows IconOpen Source Software IconSpeaking IconTools IconShuffle IconNext IconPrevious IconCalendar IconCalendar Edit IconNotebook IconObservable Notebooks IconSlash IconGoogle G IconYouTube IconEye IconComment Icon
194 views · 5 active
A cartoon skull with a hotpink hat on.
atom@argyleink
notecss
img:hover {
  scale: 1.2;
  clip-path: inset(10% round 20px);
}

nice, n' simple (codepen)

5 comments #

Join the conversation on

Three things: you don't need to repeat the inset 4 times, you can just write it once ease is the default timing function; if that's the one you want, just omit it I don't like longhands, but here it makes sense to avoid duration duplication transition: .2s; transition-property: scale, clip-path
Ana TudorAna Tudor
enhanced!
Adam ArgyleAdam Argyle
I used a similar technique for zoom on hover codepen.io/thebabydino/... Used here in combination with a `clip-path` reveal effect on scroll codepen.io/thebabydino/...
Ana TudorAna Tudor
Oooh and once pointer timeline is here we could also do the effect where you move your pointer to explore different areas of the image, like e-shops often have.
Lea Verou, PhDLea Verou, PhD
Watched both Super Troopers a couple of months ago. What a blast.
Bart VenemanBart Veneman
I did the same with a few calculation here: css-tip.com/zoom-hover-e... Finding the values that makes the image "not move"
CSS by T. AfifCSS by T. Afif
Truly wonderful gems. Beerfest is an absolute required sequel/prequel when watching Super Troopers.
Curious Citizen 🦋Curious Citizen 🦋
That was my introduction to this lot. Life changing material.
Bart VenemanBart Veneman
Ditto, these guys were best in the biz and genius writing/acting! P.s. your CSS tool will be coming in handy here soon. Glad I caught your Broken Lizard ref 🤘🏽😂🍻
Curious Citizen 🦋Curious Citizen 🦋
ProjectWallace is insane!!! Man my day tomorrow just got booked up with refactoring lol thanks man!
Curious Citizen 🦋Curious Citizen 🦋
Eh... you're welcome? 😅
Bart VenemanBart Veneman
The latest Canary does lots of clip-path on the compositor too. I haven't tested rounded corners though.
Jake ArchibaldJake Archibald
Although the default timing function in element.animate() is linear, just to keep developers on their toes.
Jake ArchibaldJake Archibald
Not move is great, fix that hover potential where it infinite loops, a worthy quest
Adam ArgyleAdam Argyle
Yay! Someone picked up the dropped torch and is going to carry it across!? Love to hear it
Adam ArgyleAdam Argyle
Nice. What were you thinking going from sharp to rounded?
David M ⦿ ⟁ ▣ ⁾⁾⁾David M ⦿ ⟁ ▣ ⁾⁾⁾
inset round has come in so handy for me for so many instances
Adam KuhnAdam Kuhn