💄 Style: update timeline animation

This commit is contained in:
Cell
2024-07-23 11:31:43 +08:00
parent 9d32ba9d9e
commit 9894d9900c
2 changed files with 18 additions and 22 deletions
+6 -10
View File
@@ -11,21 +11,17 @@
&[data-animation] {
.#{$prefix}timeline-item::before {
border-color: var(--timeline-color);
animation-name: border-color-fade;
animation-duration: 2s;
animation-name: change-border-color;
animation-duration: 0.9s;
animation-direction: alternate;
animation-iteration-count: infinite;
animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
animation-delay: calc(var(--timeline-index) * 0.3s);
@keyframes border-color-fade {
0% {
border-color: var(--timeline-color);
}
50% {
@keyframes change-border-color {
to {
border-color: var(--timeline-circle-color);
}
100% {
border-color: var(--timeline-color);
}
}
}
}
+12 -12
View File
@@ -5,18 +5,6 @@
{{- $size := .Options.size | default "medium" -}}
{{- $node := .Options.node | default "circle" -}}
{{- /* Set Timeline style */ -}}
{{- $style := "" -}}
{{- with .Options.width -}}
{{- $style = printf "width: %v;" . -}}
{{- end -}}
{{- with .Options.height -}}
{{- $style = add $style (printf "height: %v;" .) -}}
{{- end -}}
{{- with $style -}}
{{- $style = printf `style="%v"` $style -}}
{{- end -}}
{{- /* Get Timeline events */ -}}
{{- $events := slice -}}
{{- with .Inner -}}
@@ -27,6 +15,18 @@
{{- end -}}
{{- $events = sort $events "timestamp" (cond $reverse "desc" "asc") -}}
{{- /* Set Timeline style */ -}}
{{- $style := "" -}}
{{- with .Options.width -}}
{{- $style = printf "width: %v;" . -}}
{{- end -}}
{{- with .Options.height -}}
{{- $style = add $style (printf "height: %v;" .) -}}
{{- end -}}
{{- with $style -}}
{{- $style = printf `style="%v"` . -}}
{{- end -}}
<ul
class="fi-timeline{{ with .Options.class }} {{ . }}{{ end }}"
{{ $style | safeHTMLAttr }}