短评 · ·

X 归档 2024-06-20

1 条动态 · 图 0 · 视频 1
@jh3yy08:20原推文
Animated img carousel 🤙

Use CSS trig functions to get radius and layout images as a cylinder 🤓

Use scroll animation to rotate the cylinder 📜

:root {
--a: calc((360 / var(--total)) * 1deg);
--r: calc((var(--item-width) / sin(var(--a))) * -1);
}

Explained 👇
动画图片轮播 🤙

用 CSS 三角函数算出半径,把图片排成一个圆柱面 🤓

用滚动动画让圆柱旋转 📜

:root {
--a: calc((360 / var(--total)) * 1deg);
--r: calc((var(--item-width) / sin(var(--a))) * -1);
}

讲解 👇