about me update

This commit is contained in:
paw committed 2025-05-01 10:11:01 +08:00
1 parent e5c1edaff8
commit 7cd4c4a01d
51 files changed
+2202

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
{{- $text := .Get "text" | default "Hello World" -}}
{{- $speed := .Get "speed" | default "30" -}}
{{- $loop := .Get "loop" | default "true" -}}
{{- $breakLines := .Get "breakLines" | default "false" -}}
<script src="https://cdn.jsdelivr.net/npm/typeit@8.7.1/dist/index.umd.js"></script>
<div id="typeit-{{ .Ordinal }}"></div>
{{- if eq .Ordinal 1 -}}
<script src="https://cdn.jsdelivr.net/npm/typeit@8.7.1/dist/index.umd.js"></script>
{{- end -}}
<script>
document.addEventListener("DOMContentLoaded", function() {
new TypeIt("#typeit-{{ .Ordinal }}", {
strings: {{- if hasPrefix $text "[" -}} {{ $text | safeJS }} {{- else -}} "{{ $text }}" {{- end -}},
speed: {{ $speed }},
loop: {{ $loop }},
breakLines: {{ $breakLines }},
waitUntilVisible: true,
lifeLike: true, // 打字更自然(可选)
})
{{- if eq $loop "false" }}
.exec(() => {
// 打完以后销毁 TypeIt 实例
instance.destroy();
})
{{- end }}
.go();
});
</script>