短评 · ·

X 归档 2022-08-15

1 条动态 · 图 0 · 视频 1
@jh3yy01:23原推文
JavaScript && CSS Tip! ✨

Use IntersectionObserver(IO) with a low threshold and custom properties to power list animations 🔥

http://el.style.setProperty('--shown', entry.isIntersecting ? 1 : 0)

li { scale: calc(0.25 + (var(--shown, 1) * 0.75));}

Demo link below! 👇
JavaScript && CSS 小技巧!✨

用低阈值的 IntersectionObserver(IO) 搭配自定义属性来驱动列表动画 🔥

http://el.style.setProperty('--shown', entry.isIntersecting ? 1 : 0)

li { scale: calc(0.25 + (var(--shown, 1) * 0.75));}

演示链接在下面!👇