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/shortcodes/typewriter.html | |
initial commit; forked from https://github.com/Yukuro/hugo-theme-shell
Diffstat (limited to 'layouts/shortcodes/typewriter.html')
| -rw-r--r-- | layouts/shortcodes/typewriter.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/layouts/shortcodes/typewriter.html b/layouts/shortcodes/typewriter.html new file mode 100644 index 0000000..a16cfbb --- /dev/null +++ b/layouts/shortcodes/typewriter.html @@ -0,0 +1,14 @@ +{{ $random := delimit (seq 9 | shuffle) "" }} +{{ $tpid := md5 $random }} + +<div id = a{{ $tpid }}></div> + +<script src="https://unpkg.com/typewriter-effect@latest/dist/core.js"></script> + +<script type="text/javascript"> + const instance = new Typewriter('#a{{ $tpid }}', { + strings: '{{ .Inner | replaceRE "\n" "<br>" | safeHTML }}', + delay: 20, + autoStart: true, + }); +</script>
\ No newline at end of file |
