短评 · ·

X 归档 2024-01-09

1 条动态 · 图 0 · 视频 1
@jh3yy07:36原推文
CSS Tip! 🚥

You can create these trending expanding scroll indicators with scroll-driven animations and flex 🤙

.indicator {
animation: grow;
animation-range: contain calc(50% - var(--size)...;
animation-timeline: var(--card);
}
@​keyframes grow { 50% { flex: 3; }}
CSS 小技巧!🚥

用 scroll-driven animations 加 flex,就能做出这些正流行的展开式滚动指示器 🤙

.indicator {
animation: grow;
animation-range: contain calc(50% - var(--size)...;
animation-timeline: var(--card);
}
@keyframes grow { 50% { flex: 3; }}