hexo-theme-keep/source/css/common/animated.styl

114 lines
1.9 KiB
Stylus
Raw Normal View History

transition-g() {
transition-delay 0s, 0s, 0s, 0s
transition-timing-function ease, ease, ease, ease
transition-duration 0.2s, 0.2s, 0.2s, 0.2s
transition-property color, background, box-shadow, border-color
}
transition-t(property, delay, duration, function) {
$temp-property = "color, background, box-shadow, border-color"
$temp-delay = "0s, 0s, 0s, 0s"
$temp-duration = "0.2s, 0.2s, 0.2s, 0.2s"
$temp-function = "ease, ease, ease, ease"
2020-11-27 15:32:40 +08:00
for p in convert(property) {
$temp-property += ("," + p)
}
for d in convert(delay) {
$temp-delay += ("," + d + "s")
}
2020-11-27 15:32:40 +08:00
for d in convert(duration) {
$temp-duration += ("," + d + "s")
}
for f in convert(function) {
$temp-function += ("," + f)
}
transition-delay convert($temp-delay)
transition-timing-function convert($temp-function)
transition-duration convert($temp-duration)
transition-property convert($temp-property)
}
2020-04-28 23:20:17 +08:00
.fade-in-down-animation {
animation-name fade-in-down
animation-duration 1s
animation-fill-mode both
}
2020-11-27 15:32:40 +08:00
@keyframes fade-in-down {
0% {
transform translateY(-50px)
opacity 0
}
100% {
transform translateY(0)
opacity 1
}
}
2020-04-28 23:20:17 +08:00
2020-11-27 15:32:40 +08:00
@keyframes icon-animate {
0%
100% {
transform scale(1)
2020-11-27 15:32:40 +08:00
}
10%
30% {
transform scale(0.88)
2020-11-27 15:32:40 +08:00
}
20%
40%
60%
80% {
transform scale(1.08)
2020-11-27 15:32:40 +08:00
}
50%
70% {
transform scale(1.08)
2020-11-27 15:32:40 +08:00
}
}
2022-10-04 23:52:46 +08:00
@keyframes img-loading-animation {
to {
transform rotate(1turn)
}
}
.title-hover-animation {
position relative
display inline-block
2022-10-14 17:56:32 +08:00
color var(--text-color-2)
line-height 1.3
vertical-align top
border-bottom none
&::before {
position absolute
bottom -4px
left 0
width 100%
height 2px
2022-10-14 17:56:32 +08:00
background-color var(--text-color-2)
transform scaleX(0)
visibility hidden
content ""
transition-t("visibility transform", "0, 0", "0.2, 0.2", "ease-in-out, ease-in-out")
}
&:hover::before {
transform scaleX(1)
visibility visible
}
}
2020-11-27 15:32:40 +08:00