mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
✨ Feat: add loop paramter for typeit and update typeit from 8.7.0 to 8.7.1
This commit is contained in:
@@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
- :sparkles: Feat: add instant page (@Mejituu [#279](https://github.com/hugo-fixit/FixIt/pull/279))
|
||||
- :sparkles: Feat: add `force` option value to `params.page.lightgallery`
|
||||
- :sparkles: Feat: add loop paramter for typeit ([#303](https://github.com/hugo-fixit/FixIt/pull/303))
|
||||
- :bug: Fix: donate images without lazy loading (@Mejituu [#279](https://github.com/hugo-fixit/FixIt/pull/279))
|
||||
- :bug: Fix: discordinvite typo (@mathieu-gilloots [#282](https://github.com/hugo-fixit/FixIt/pull/282))
|
||||
- :bug: Fix: missing parameter `requiredFields` for Valine
|
||||
@@ -28,6 +29,7 @@ All notable changes to this project will be documented in this file.
|
||||
- :wrench: Chore: change the theme minimum supported Hugo versions above **0.89.0**
|
||||
- :arrow_up: Chore(libs):
|
||||
- Update Update @waline/client from 2.10.0 to 2.14.7 (@Mejituu [#279](https://github.com/hugo-fixit/FixIt/pull/279))
|
||||
- Update typeit from 8.7.0 to 8.7.1
|
||||
- **Full Changelog:** @Lruihao [`v0.2.16...v0.2.17`](https://github.com/hugo-fixit/FixIt/compare/v0.2.16...v0.2.17)
|
||||
|
||||
## v0.2.17 [2023.1.29]
|
||||
|
||||
@@ -74,8 +74,8 @@ libFiles:
|
||||
twemojiJS: twemoji@14.0.2/dist/twemoji.min.js
|
||||
# twikoo@1.6.8 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.8/dist/twikoo.all.min.js
|
||||
# typeit@8.7.0 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.0/dist/index.umd.js
|
||||
# typeit@8.7.1 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.1/dist/index.umd.js
|
||||
# valine@1.5.1 https://github.com/xCss/Valine
|
||||
valineJS: valine@1.5.1/dist/Valine.min.js
|
||||
# vconsole@3.14.6 https://github.com/Tencent/vConsole
|
||||
|
||||
@@ -74,8 +74,8 @@ libFiles:
|
||||
twemojiJS: twemoji@14.0.2/dist/twemoji.min.js
|
||||
# twikoo@1.6.8 https://github.com/imaegoo/twikoo
|
||||
twikooJS: twikoo@1.6.8/dist/twikoo.all.min.js
|
||||
# typeit@8.7.0 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.0/dist/index.umd.js
|
||||
# typeit@8.7.1 https://github.com/alexmacarthur/typeit
|
||||
typeitJS: typeit@8.7.1/dist/index.umd.js
|
||||
# valine@1.5.1 https://github.com/xCss/Valine
|
||||
valineJS: valine@1.5.1/dist/Valine.min.js
|
||||
# vconsole@3.14.6 https://github.com/Tencent/vConsole
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -26,7 +26,7 @@ sharer.js@0.5.1 https://github.com/ellisonleao/sharer.js
|
||||
simple-icons@7.12.0 https://github.com/simple-icons/simple-icons
|
||||
twemoji@14.0.2 https://github.com/twitter/twemoji
|
||||
twikoo@1.6.8 https://github.com/imaegoo/twikoo
|
||||
typeit@8.7.0 https://github.com/alexmacarthur/typeit
|
||||
typeit@8.7.1 https://github.com/alexmacarthur/typeit
|
||||
valine@1.5.1 https://github.com/xCss/Valine
|
||||
vconsole@3.14.6 https://github.com/Tencent/vConsole
|
||||
waline@2.14.7 https://github.com/walinejs/waline
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -650,6 +650,8 @@
|
||||
cursorChar = "|"
|
||||
# cursor duration after typing finishing (measured in milliseconds, "-1" means unlimited)
|
||||
duration = -1
|
||||
# FixIt 0.2.18 | NEW whether your strings will continuously loop after completing
|
||||
loop = false
|
||||
|
||||
# FixIt 0.2.15 | NEW Mermaid config
|
||||
[params.mermaid]
|
||||
|
||||
+1
-1
Submodule docs updated: de06dd7acc...e0614a8f6d
@@ -88,7 +88,7 @@
|
||||
{{- $typeit := $.Site.Params.typeit -}}
|
||||
{{- $source := $cdn.typeitJS | default "lib/typeit/index.umd.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $config = dict "speed" $typeit.speed "cursorSpeed" $typeit.cursorSpeed "cursorChar" $typeit.cursorChar "duration" $typeit.duration "data" . | dict "typeit" | merge $config -}}
|
||||
{{- $config = dict "speed" $typeit.speed "cursorSpeed" $typeit.cursorSpeed "cursorChar" $typeit.cursorChar "duration" $typeit.duration "loop" $typeit.loop "data" . | dict "typeit" | merge $config -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* KaTeX */ -}}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
{{- $classList = $classList | append . -}}
|
||||
{{- end -}}
|
||||
{{- $tag := .Get "tag" | default "div" -}}
|
||||
{{- $loop := cond (ne (.Get "group") "") false (.Get "loop") -}}
|
||||
|
||||
{{- if .Get "code" -}}
|
||||
{{- /* highlight code content without line number */ -}}
|
||||
@@ -34,5 +35,5 @@
|
||||
{{- $attrs = delimit $classList " " | printf `%v class="%v"` $attrs -}}
|
||||
{{- end -}}
|
||||
|
||||
<div class="typeit">{{ printf `<%v %v></%v>` $tag $attrs $tag | safeHTML }}</div>
|
||||
<div class="typeit"{{ if ne $loop "" }} data-loop="{{ $loop }}"{{ end }}>{{ printf `<%v %v></%v>` $tag $attrs $tag | safeHTML }}</div>
|
||||
{{- /* EOF */ -}}
|
||||
|
||||
@@ -804,9 +804,11 @@ class FixIt {
|
||||
const speed = typeitConfig.speed || 100;
|
||||
const cursorSpeed = typeitConfig.cursorSpeed || 1000;
|
||||
const cursorChar = typeitConfig.cursorChar || '|';
|
||||
const loop = typeitConfig.loop ?? false;
|
||||
Object.values(typeitConfig.data).forEach((group) => {
|
||||
const typeone = (i) => {
|
||||
const id = group[i];
|
||||
const shortcodeLoop = document.querySelector(`#${id}`).parentElement.dataset.loop;
|
||||
const instance = new TypeIt(`#${id}`, {
|
||||
strings: this.data[id],
|
||||
speed: speed,
|
||||
@@ -814,6 +816,7 @@ class FixIt {
|
||||
cursorSpeed: cursorSpeed,
|
||||
cursorChar: cursorChar,
|
||||
waitUntilVisible: true,
|
||||
loop: shortcodeLoop ? JSON.parse(shortcodeLoop) : loop,
|
||||
afterComplete: () => {
|
||||
if (i === group.length - 1) {
|
||||
if (typeitConfig.duration >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user