实现 SiYuan 按键的彩虹渐变效果,参考了 https://siyuannote.com/docs/article/1724628228
更新:再次优化了颜色
#barWorkspace {
border: none;
background: none;
width: 80px;
height: 25px;
cursor: pointer;
border-radius: 8px;
background: linear-gradient(90deg, #FF6B6B, #FF7757, #FFAB3D, #6BF178, #6DD3FF, #D7B5FE, #FFB5E1, #FF6B6B);
background-size: 1600% 100%;
animation: rainbowButton 12s linear infinite;
user-select: none;
transition: filter 0.3s ease;
color: #FFF7EE;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-size: 12px;
font-weight: bold;
}
#barWorkspace:hover {
filter: brightness(0.8);
}
#barWorkspace:active {
filter: brightness(0.7);
}
@keyframes rainbowButton {
0% { background-position: 0% 0%; }
100% { background-position: -200% 0%; }
}
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于