mirror of
https://github.com/afoim/fuwari.git
synced 2026-01-31 00:53:19 +08:00
style(styles): 优化彩虹模式动画效果并简化实现
- 将 backdrop-filter 改为 filter 以获得更好的性能 - 添加反向旋转动画以保持媒体元素原始颜色 - 移除不必要的伪元素和定位样式
This commit is contained in:
@@ -2,32 +2,27 @@
|
||||
|
||||
@layer components {
|
||||
/* Rainbow Mode Animation */
|
||||
@keyframes rainbow-backdrop {
|
||||
0% { backdrop-filter: hue-rotate(0deg); }
|
||||
100% { backdrop-filter: hue-rotate(360deg); }
|
||||
@keyframes rainbow-rotate {
|
||||
0% { filter: hue-rotate(0deg); }
|
||||
100% { filter: hue-rotate(360deg); }
|
||||
}
|
||||
@keyframes rainbow-rotate-reverse {
|
||||
0% { filter: hue-rotate(0deg); }
|
||||
100% { filter: hue-rotate(-360deg); }
|
||||
}
|
||||
|
||||
html.is-rainbow-mode .card-base {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
html.is-rainbow-mode .card-base::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 1;
|
||||
pointer-events: none;
|
||||
border-radius: inherit;
|
||||
animation: rainbow-backdrop linear infinite;
|
||||
animation: rainbow-rotate linear infinite;
|
||||
animation-duration: var(--rainbow-duration, 5s);
|
||||
}
|
||||
|
||||
/* Protect images and other sensitive media from color rotation */
|
||||
/* Reverse filter for images to keep original colors */
|
||||
html.is-rainbow-mode .card-base img,
|
||||
html.is-rainbow-mode .card-base video,
|
||||
html.is-rainbow-mode .card-base iframe {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
html.is-rainbow-mode .card-base iframe,
|
||||
html.is-rainbow-mode .card-base .no-hue-rotate {
|
||||
animation: rainbow-rotate-reverse linear infinite;
|
||||
animation-duration: var(--rainbow-duration, 5s);
|
||||
}
|
||||
|
||||
.card-base {
|
||||
|
||||
Reference in New Issue
Block a user