@voidzero-dev/vitepress-theme 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/terminal-animations/TerminalAnimation1.vue +3 -2
- package/components/terminal-animations/TerminalAnimation2.vue +3 -2
- package/components/terminal-animations/TerminalAnimation3.vue +3 -2
- package/components/terminal-animations/TerminalAnimation4.vue +3 -2
- package/components/terminal-animations/TerminalAnimation5.vue +3 -2
- package/components/terminal-animations/TerminalAnimation6.vue +3 -2
- package/composables/useTypewriter.ts +43 -0
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import {useTypewriter} from '../../composables/useTypewriter'
|
|
3
3
|
import {onMounted, onUnmounted} from "vue";
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
@@ -8,7 +8,8 @@ const props = defineProps<{
|
|
|
8
8
|
|
|
9
9
|
let typewriter;
|
|
10
10
|
|
|
11
|
-
onMounted(() => {
|
|
11
|
+
onMounted(async () => {
|
|
12
|
+
const Typewriter = await useTypewriter()
|
|
12
13
|
const target = document.getElementById('terminal-code');
|
|
13
14
|
typewriter = new Typewriter(target, {
|
|
14
15
|
loop: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import {useTypewriter} from '../../composables/useTypewriter'
|
|
3
3
|
import {onMounted, onUnmounted} from "vue";
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
@@ -8,7 +8,8 @@ const props = defineProps<{
|
|
|
8
8
|
|
|
9
9
|
let typewriter;
|
|
10
10
|
|
|
11
|
-
onMounted(() => {
|
|
11
|
+
onMounted(async () => {
|
|
12
|
+
const Typewriter = await useTypewriter()
|
|
12
13
|
// Get current time for easter egg
|
|
13
14
|
const now = new Date()
|
|
14
15
|
let hours = now.getHours()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import {useTypewriter} from '../../composables/useTypewriter'
|
|
3
3
|
import {onMounted, onUnmounted} from "vue";
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
@@ -8,7 +8,8 @@ const props = defineProps<{
|
|
|
8
8
|
|
|
9
9
|
let typewriter;
|
|
10
10
|
|
|
11
|
-
onMounted(() => {
|
|
11
|
+
onMounted(async () => {
|
|
12
|
+
const Typewriter = await useTypewriter()
|
|
12
13
|
const target = document.getElementById('terminal-code');
|
|
13
14
|
typewriter = new Typewriter(target, {
|
|
14
15
|
loop: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import {useTypewriter} from '../../composables/useTypewriter'
|
|
3
3
|
import {onMounted, onUnmounted} from "vue";
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
@@ -8,7 +8,8 @@ const props = defineProps<{
|
|
|
8
8
|
|
|
9
9
|
let typewriter;
|
|
10
10
|
|
|
11
|
-
onMounted(() => {
|
|
11
|
+
onMounted(async () => {
|
|
12
|
+
const Typewriter = await useTypewriter()
|
|
12
13
|
const target = document.getElementById('terminal-code');
|
|
13
14
|
typewriter = new Typewriter(target, {
|
|
14
15
|
loop: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import {useTypewriter} from '../../composables/useTypewriter'
|
|
3
3
|
import {onMounted, onUnmounted} from "vue";
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
@@ -8,7 +8,8 @@ const props = defineProps<{
|
|
|
8
8
|
|
|
9
9
|
let typewriter;
|
|
10
10
|
|
|
11
|
-
onMounted(() => {
|
|
11
|
+
onMounted(async () => {
|
|
12
|
+
const Typewriter = await useTypewriter()
|
|
12
13
|
const target = document.getElementById('terminal-code');
|
|
13
14
|
typewriter = new Typewriter(target, {
|
|
14
15
|
loop: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import {useTypewriter} from '../../composables/useTypewriter'
|
|
3
3
|
import {onMounted, onUnmounted} from "vue";
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
@@ -8,7 +8,8 @@ const props = defineProps<{
|
|
|
8
8
|
|
|
9
9
|
let typewriter;
|
|
10
10
|
|
|
11
|
-
onMounted(() => {
|
|
11
|
+
onMounted(async () => {
|
|
12
|
+
const Typewriter = await useTypewriter()
|
|
12
13
|
const target = document.getElementById('terminal-code');
|
|
13
14
|
typewriter = new Typewriter(target, {
|
|
14
15
|
loop: false,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Dynamically load Typewriter from CDN
|
|
2
|
+
let TypewriterClass: any = null
|
|
3
|
+
let loadingPromise: Promise<any> | null = null
|
|
4
|
+
|
|
5
|
+
export async function useTypewriter() {
|
|
6
|
+
// Return cached class if already loaded
|
|
7
|
+
if (TypewriterClass) {
|
|
8
|
+
return TypewriterClass
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Return existing loading promise if already loading
|
|
12
|
+
if (loadingPromise) {
|
|
13
|
+
return loadingPromise
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Start loading from CDN
|
|
17
|
+
loadingPromise = new Promise((resolve, reject) => {
|
|
18
|
+
// Check if already loaded globally
|
|
19
|
+
if ((window as any).Typewriter) {
|
|
20
|
+
TypewriterClass = (window as any).Typewriter
|
|
21
|
+
resolve(TypewriterClass)
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Create script tag to load from CDN
|
|
26
|
+
const script = document.createElement('script')
|
|
27
|
+
script.src = 'https://unpkg.com/typewriter-effect@2.22.0/dist/core.js'
|
|
28
|
+
script.async = true
|
|
29
|
+
|
|
30
|
+
script.onload = () => {
|
|
31
|
+
TypewriterClass = (window as any).Typewriter
|
|
32
|
+
resolve(TypewriterClass)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
script.onerror = () => {
|
|
36
|
+
reject(new Error('Failed to load Typewriter from CDN'))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
document.head.appendChild(script)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
return loadingPromise
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voidzero-dev/vitepress-theme",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Shared VitePress theme for VoidZero projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.ts",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"style.css",
|
|
16
16
|
"fonts",
|
|
17
17
|
"assets",
|
|
18
|
-
"components"
|
|
18
|
+
"components",
|
|
19
|
+
"composables"
|
|
19
20
|
],
|
|
20
21
|
"peerDependencies": {
|
|
21
22
|
"vitepress": "^2.0.0-alpha.12",
|
|
@@ -26,8 +27,7 @@
|
|
|
26
27
|
"@tailwindcss/typography": "^0.5.19",
|
|
27
28
|
"@tailwindcss/vite": "^4.1.13",
|
|
28
29
|
"tailwindcss": "^4.1.13",
|
|
29
|
-
"reka-ui": "^2.5.1"
|
|
30
|
-
"typewriter-effect": "^2.22.0"
|
|
30
|
+
"reka-ui": "^2.5.1"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"vitepress",
|