X 归档 2024-06-08
Fade elements in and out on scroll in a window with CSS? ✅
ul { scroll-padding-inline: 200px; }
article {
animation: highlight;
animation-timeline: view(inline);
}
@keyframes highlight {
entry 0%, exit 100% { opacity: 0; }
entry 100%, exit 0% { opacity: 1; }
}
cc @adamwathan
ul { scroll-padding-inline: 200px; }
article {
animation: highlight;
animation-timeline: view(inline);
}
@keyframes highlight {
entry 0%, exit 100% { opacity: 0; }
entry 100%, exit 0% { opacity: 1; }
}
cc @adamwathan
用 CSS 让元素在窗口中随滚动淡入淡出?✅
ul { scroll-padding-inline: 200px; }
article {
animation: highlight;
animation-timeline: view(inline);
}
@keyframes highlight {
entry 0%, exit 100% { opacity: 0; }
entry 100%, exit 0% { opacity: 1; }
}
cc @adamwathan
ul { scroll-padding-inline: 200px; }
article {
animation: highlight;
animation-timeline: view(inline);
}
@keyframes highlight {
entry 0%, exit 100% { opacity: 0; }
entry 100%, exit 0% { opacity: 1; }
}
cc @adamwathan
the little details™
The composition of how things come together:
- Button and Popover header are lined up
- Form fades and translates from the bottom
- Header translates and scales to reveal the closer
Slowed down and scrubbed in DevTools 👇 https://t.co/liEw1tsFZH
The composition of how things come together:
- Button and Popover header are lined up
- Form fades and translates from the bottom
- Header translates and scales to reveal the closer
Slowed down and scrubbed in DevTools 👇 https://t.co/liEw1tsFZH
细节控™
各种元素如何组合在一起:
- 按钮和 Popover 标题排列整齐
- 表单从底部淡入并位移出现
- 标题位移并缩放以露出关闭按钮
在 DevTools 中放慢并逐帧查看 👇 https://t.co/liEw1tsFZH
各种元素如何组合在一起:
- 按钮和 Popover 标题排列整齐
- 表单从底部淡入并位移出现
- 标题位移并缩放以露出关闭按钮
在 DevTools 中放慢并逐帧查看 👇 https://t.co/liEw1tsFZH
