
Just your friendly neighborhood Web Designer.
Phoenix, AZ
Joined February 2021
- Tweets10
- Following99
- Followers8
- Likes20
Eric retweeted
Experimental #CSS carousel
✅ subgrid
✅ scroll driven animations (SDA)
✅ oklch()
✅ @property
✅ @layer
*Lots of code comments* to help break down the effects 🤓
✅ SDA changes hue/theme
✅ SDA toggles next/prev
✅ SDA syncs dots
codepen.io/argyleink/pen/vYQ…
Eric retweeted
a theming example using that CSS 🤙
aside {
border-color: color-mix(in oklch, var(--color) 5%, #fff3);
background: color-mix(in oklch, var(--color), #0007);
color: color-mix(in oklch, var(--color), #fff);
}
Eric retweeted
magnetic bento hover effect w/ css anchor positioning
.bento {
li:hover article { anchor-name: --a; }
.indicator {
position-anchor: --a;
inset: anchor(inside);
transition: inset var(--dur) var(--ease);
}
}
Eric retweeted
how do Adaline and Apple make these crazy 3d zooming effects as you scroll?
it's easier than you think - let me show you how
prompts and code in thread:
Eric retweeted
CSS Anchor Positioning && :has() for a magnetic hover effect 🤙🧲
article { anchor-name: --develop; }
ul:has(li:hover) { --anchor: --preview; }
ul::after {
inset:
anchor(var(--anchor) top)
anchor(var(--anchor) right)
... ;
}
Eric retweeted
morphing tip prototype with View Transitions
✅ fixed position tip
✅ animates display: none
✅ just set innerText and left/top
codepen.io/argyleink/pen/GRz…
video alt:
i mouse into squares causing a tip to move to the center with some text. the tip morphs and moves to position!
Eric retweeted
CSS Tip! 🤙
You can create this magnetic :hover effect with CSS anchor positioning, :has, and zero JS 🔥
article { anchor-name: --develop; }
ul:has(li:hover) { --anchor: --develop; }
ul::after {
inset:
anchor(var(--anchor) top)
anchor(var(--anchor) right)
... ;
}
How do you keep it clean when entering/exiting the list? Use transition-delay ⭐️
ul:has(li:hover) { --active: 1; }
ul::after {
opacity: var(--active, 0);
transition: opacity 0.2s, inset 0.2s 0.2s;
}
ul:hover::after {
transition: opacity 0.2s 0.2s, inset 0.2s;
}
This is a cool trick you can use. Delay the opacity on enter and then delay the position on exit. That way you don't get a weird effect on enter/exit 🙏
This one's a "Future" CSS tip 🔮 But, the demo will work in all browsers in some way. The idea is to progressively enhance it.
1. No JavaScript and no Anchor Positioning? Highlight on hover ✏️
2. No Anchor Positioning? Use JavaScript with a single event listener to update the inset values using elementFromPoint and .closest 🫶
3. If there is Anchor Positioning support, use that and don't fire the JavaScript. You can check with CSS.supports('anchor-name: --anchor') ✨
That's it!
@CodePen link below! 👇
Eric retweeted
Future CSS Tip! 🔮
You can create this scrolling image pop-out effect with CSS scroll-driven animations and zero JS! 🔥
.pop {
view-timeline-name: --pop;
}
img {
animation: slide both;
animation-timeline: --pop;
animation-range: entry 100% cover 50%;
}
.skateboarder {
--x: 0;
--y: -45%;
}
@ keyframes slide {
to { translate: var(--x) var(--y); }
}
The "trick" is to layer up two image elements and keep one clipped by the container 🤙
Slide them both together and it will look like one pops out of the container 🎈 You can leverage scoped custom properties to translate by different distances too! 😎
You can use macOS's built-in image background removal tool to get the pop-out image ✨ And for added effect, you can animate the brightness on that to make it stand out ⭐️
@CodePen link below! 👇







