diff options
| author | Craig Jennings <craigmartinjennings@gmail.com> | 2024-03-24 14:41:32 -0500 |
|---|---|---|
| committer | Craig Jennings <craigmartinjennings@gmail.com> | 2024-03-24 14:41:32 -0500 |
| commit | 4aed6ea63ae93704b5d4cc07b528a0dd70a5d752 (patch) | |
| tree | d7610e41ff54da3f340cec1c86134c189a44db8a /layouts/partials/typewriter.html | |
initial commit; forked from https://github.com/Yukuro/hugo-theme-shell
Diffstat (limited to 'layouts/partials/typewriter.html')
| -rw-r--r-- | layouts/partials/typewriter.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/layouts/partials/typewriter.html b/layouts/partials/typewriter.html new file mode 100644 index 0000000..daab6ae --- /dev/null +++ b/layouts/partials/typewriter.html @@ -0,0 +1,14 @@ +<div id=typewriter></div> + +{{- if eq .delay 0 }} + {{ .payload }} +{{ else }} + <script src="https://cdn.jsdelivr.net/gh/tameemsafi/typewriterjs/dist/core.js"></script> + <script type="text/javascript"> + const instance = new Typewriter('#typewriter', { + strings: '{{ .payload }}', + delay: '{{ .delay }}', + autoStart: true, + }); + </script> +{{ end -}} |
