aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/shortcodes/animate.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/shortcodes/animate.html')
-rw-r--r--themes/default/layouts/shortcodes/animate.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/themes/default/layouts/shortcodes/animate.html b/themes/default/layouts/shortcodes/animate.html
new file mode 100644
index 0000000..15b0fbc
--- /dev/null
+++ b/themes/default/layouts/shortcodes/animate.html
@@ -0,0 +1,11 @@
+{{- $type := default "default" (.Get "type" | default (.Get 0)) -}}
+{{- $text := default "animate" (.Get "text" | default (.Get 1)) -}}
+
+{{- $letters := split ($text | markdownify) "" -}}
+
+<text-animation {{ $type }}>
+{{- range $value, $letter := $letters -}}
+ <span style="--frame:{{ $value }}">{{ $letter }}</span>
+{{- end -}}
+</text-animation>
+{{- /* This comment removes trailing newlines and white spaces. */ -}}