@voidzero-dev/vitepress-theme 0.0.17 → 0.1.32

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.
Files changed (159) hide show
  1. package/README.md +60 -0
  2. package/dist/assets/clients/bolt.svg +5 -0
  3. package/dist/assets/clients/cloudflare.svg +26 -0
  4. package/dist/assets/clients/framer.svg +16 -0
  5. package/dist/assets/clients/hugging-face.svg +9 -0
  6. package/dist/assets/clients/linear.svg +7 -0
  7. package/dist/assets/clients/mercedes.svg +2865 -0
  8. package/dist/assets/clients/openai.svg +1 -0
  9. package/dist/assets/clients/plaid.svg +7 -0
  10. package/dist/assets/clients/ramp.svg +1 -0
  11. package/dist/assets/clients/shopify.svg +30 -0
  12. package/dist/assets/cta-background.jpg +1 -0
  13. package/dist/assets/icons/oxc-dark.svg +124 -0
  14. package/dist/assets/icons/oxc-light.svg +124 -0
  15. package/dist/assets/icons/oxc-mono.svg +5 -0
  16. package/dist/assets/icons/rolldown-dark.svg +92 -0
  17. package/dist/assets/icons/rolldown-light.svg +92 -0
  18. package/dist/assets/icons/rolldown-mono.svg +5 -0
  19. package/dist/assets/icons/vite-dark.svg +132 -0
  20. package/dist/assets/icons/vite-light.svg +132 -0
  21. package/dist/assets/icons/vite-mono.svg +5 -0
  22. package/dist/assets/icons/viteplus-dark.svg +133 -0
  23. package/dist/assets/icons/viteplus-light.svg +133 -0
  24. package/dist/assets/icons/viteplus-mono.svg +6 -0
  25. package/dist/assets/icons/vitest-dark.svg +52 -0
  26. package/dist/assets/icons/vitest-light.svg +52 -0
  27. package/dist/assets/icons/vitest-mono.svg +5 -0
  28. package/dist/assets/logos/oxc-dark.svg +125 -0
  29. package/dist/assets/logos/oxc-light.svg +125 -0
  30. package/dist/assets/logos/rolldown-dark.svg +93 -0
  31. package/dist/assets/logos/rolldown-light.svg +93 -0
  32. package/dist/assets/logos/vite-dark.svg +133 -0
  33. package/dist/assets/logos/vite-light.svg +133 -0
  34. package/dist/assets/logos/viteplus-dark.svg +133 -0
  35. package/dist/assets/logos/viteplus-light.svg +133 -0
  36. package/dist/assets/logos/vitest-dark.svg +53 -0
  37. package/dist/assets/logos/vitest-light.svg +53 -0
  38. package/dist/assets/logos/voidzero-dark.svg +3 -0
  39. package/dist/assets/logos/voidzero-light.svg +3 -0
  40. package/dist/assets/social/github.svg +3 -0
  41. package/dist/assets/viteplus/logo.svg +1 -0
  42. package/dist/assets/voidzero/animations/1280_x_552_homepage.riv +0 -0
  43. package/dist/assets/voidzero/animations/480_x_480_build_tool_for_web.riv +0 -0
  44. package/dist/assets/voidzero/animations/480_x_480_fastest_javascript_bundler.riv +0 -0
  45. package/dist/assets/voidzero/animations/480_x_480_language_toolchain.riv +0 -0
  46. package/dist/assets/voidzero/animations/480_x_480_next_generation_runner.riv +0 -0
  47. package/dist/assets/voidzero/backgrounds/casestudies.jpg +0 -0
  48. package/dist/assets/voidzero/backgrounds/oxc.jpg +0 -0
  49. package/dist/assets/voidzero/backgrounds/rolldown.jpg +0 -0
  50. package/dist/assets/voidzero/backgrounds/vite.jpg +0 -0
  51. package/dist/assets/voidzero/backgrounds/vitest.jpg +0 -0
  52. package/dist/assets/voidzero/logo.svg +3 -0
  53. package/dist/assets/voidzero/terminals/rolldown.svg +7 -0
  54. package/dist/assets/voidzero/terminals/vite.svg +9 -0
  55. package/dist/assets/voidzero/terminals/vitest.svg +49 -0
  56. package/dist/index.css +1 -0
  57. package/dist/index.js +3 -6542
  58. package/dist/index10.js +7 -0
  59. package/dist/index11.js +13 -0
  60. package/dist/index12.js +13 -0
  61. package/dist/index13.js +13 -0
  62. package/dist/index14.js +7 -0
  63. package/dist/index15.js +12 -0
  64. package/dist/index16.js +7 -0
  65. package/dist/index17.js +12 -0
  66. package/dist/index19.js +4 -0
  67. package/dist/index2.js +27 -0
  68. package/dist/index20.js +4 -0
  69. package/dist/index21.js +4 -0
  70. package/dist/index22.js +4 -0
  71. package/dist/index23.js +4 -0
  72. package/dist/index24.js +4 -0
  73. package/dist/index25.js +23 -0
  74. package/dist/index27.js +9 -0
  75. package/dist/index28.js +107 -0
  76. package/dist/index3.js +75 -0
  77. package/dist/index30.js +4 -0
  78. package/dist/index31.js +4 -0
  79. package/dist/index32.js +297 -0
  80. package/dist/index34.js +149 -0
  81. package/dist/index36.js +20 -0
  82. package/dist/index37.js +20 -0
  83. package/dist/index38.js +20 -0
  84. package/dist/index39.js +4 -0
  85. package/dist/index4.js +157 -0
  86. package/dist/index40.js +28 -0
  87. package/dist/index41.js +32 -0
  88. package/dist/index42.js +28 -0
  89. package/dist/index43.js +28 -0
  90. package/dist/index44.js +28 -0
  91. package/dist/index45.js +28 -0
  92. package/dist/index46.js +4 -0
  93. package/dist/index47.js +4 -0
  94. package/dist/index48.js +4 -0
  95. package/dist/index49.js +4 -0
  96. package/dist/index5.js +15 -0
  97. package/dist/index50.js +4 -0
  98. package/dist/index51.js +4 -0
  99. package/dist/index52.js +4 -0
  100. package/dist/index53.js +4 -0
  101. package/dist/index54.js +4 -0
  102. package/dist/index55.js +4 -0
  103. package/dist/index56.js +4 -0
  104. package/dist/index57.js +4 -0
  105. package/dist/index58.js +4 -0
  106. package/dist/index59.js +4 -0
  107. package/dist/index6.js +75 -0
  108. package/dist/index60.js +4 -0
  109. package/dist/index61.js +4 -0
  110. package/dist/index62.js +4 -0
  111. package/dist/index63.js +36 -0
  112. package/dist/index64.js +4 -0
  113. package/dist/index65.js +4 -0
  114. package/dist/index66.js +4 -0
  115. package/dist/index67.js +4 -0
  116. package/dist/index68.js +4 -0
  117. package/dist/index69.js +4 -0
  118. package/dist/index7.js +36 -0
  119. package/dist/index70.js +4 -0
  120. package/dist/index71.js +4 -0
  121. package/dist/index72.js +4 -0
  122. package/dist/index73.js +4 -0
  123. package/dist/index74.js +4 -0
  124. package/dist/index75.js +4 -0
  125. package/dist/index76.js +24 -0
  126. package/dist/index77.js +126 -0
  127. package/dist/index78.js +4 -0
  128. package/dist/index79.js +35 -0
  129. package/dist/index8.js +35 -0
  130. package/dist/index80.js +1204 -0
  131. package/dist/index81.js +7 -0
  132. package/dist/index82.js +6 -0
  133. package/dist/index83.js +317 -0
  134. package/dist/index84.js +4 -0
  135. package/dist/index9.js +7 -0
  136. package/package.json +19 -20
  137. package/assets/checkmark.svg +0 -1
  138. package/assets/primary-button-background.jpg +0 -0
  139. package/assets/terminal-background.jpg +0 -0
  140. package/components/Eyebrow.vue +0 -11
  141. package/components/Footer.vue +0 -44
  142. package/components/Header.vue +0 -38
  143. package/components/RiveAnimation.vue +0 -144
  144. package/components/Terminal.vue +0 -165
  145. package/components/terminal-animations/TerminalAnimation1.vue +0 -54
  146. package/components/terminal-animations/TerminalAnimation2.vue +0 -59
  147. package/components/terminal-animations/TerminalAnimation3.vue +0 -46
  148. package/components/terminal-animations/TerminalAnimation4.vue +0 -50
  149. package/components/terminal-animations/TerminalAnimation5.vue +0 -51
  150. package/components/terminal-animations/TerminalAnimation6.vue +0 -55
  151. package/composables/useTypewriter.ts +0 -43
  152. package/dist/index.js.map +0 -1
  153. package/dist/style.css +0 -343
  154. package/fonts/APK-Protocol-Medium.woff2 +0 -0
  155. package/fonts/KHTeka-Medium.woff2 +0 -0
  156. package/fonts/KHTeka-Regular.woff2 +0 -0
  157. package/fonts/KHTekaMono-Medium.woff2 +0 -0
  158. package/fonts/KHTekaMono-Regular.woff2 +0 -0
  159. package/style.css +0 -343
@@ -1,165 +0,0 @@
1
- <script setup lang="ts">
2
- import {ref, onMounted, onUnmounted} from 'vue'
3
- import {TabsContent, TabsList, TabsRoot, TabsTrigger} from 'reka-ui'
4
- import TerminalAnimation1 from "./terminal-animations/TerminalAnimation1.vue";
5
- import TerminalAnimation2 from "./terminal-animations/TerminalAnimation2.vue";
6
- import TerminalAnimation3 from "./terminal-animations/TerminalAnimation3.vue";
7
- import TerminalAnimation4 from "./terminal-animations/TerminalAnimation4.vue";
8
- import TerminalAnimation5 from "./terminal-animations/TerminalAnimation5.vue";
9
- import TerminalAnimation6 from "./terminal-animations/TerminalAnimation6.vue";
10
- import terminalBg from '../assets/terminal-background.jpg';
11
-
12
- // Auto-progression configuration
13
- const AUTO_ADVANCE_DELAY = 1500
14
-
15
- // State management
16
- const activeTab = ref('tab1')
17
- const autoPlayEnabled = ref(true)
18
- let autoAdvanceTimeout: ReturnType<typeof setTimeout> | null = null
19
-
20
- // Intersection Observer state
21
- const sectionRef = ref<HTMLElement | null>(null)
22
- const isVisible = ref(false)
23
- let observer: IntersectionObserver | null = null
24
-
25
- // Tab progression logic
26
- const tabSequence = ['tab1', 'tab2', 'tab3', 'tab4', 'tab5', 'tab6']
27
-
28
- const goToNextTab = () => {
29
- const currentIndex = tabSequence.indexOf(activeTab.value)
30
- const nextIndex = (currentIndex + 1) % tabSequence.length
31
- activeTab.value = tabSequence[nextIndex]
32
- }
33
-
34
- // Handle animation completion
35
- const onAnimationComplete = () => {
36
- if (!autoPlayEnabled.value) return
37
-
38
- // Clear any existing timeout
39
- if (autoAdvanceTimeout) {
40
- clearTimeout(autoAdvanceTimeout)
41
- }
42
-
43
- // Schedule next tab
44
- autoAdvanceTimeout = setTimeout(() => {
45
- goToNextTab()
46
- }, AUTO_ADVANCE_DELAY)
47
- }
48
-
49
- // Handle user interaction with tabs
50
- const onTabChange = () => {
51
- // User clicked a tab, disable auto-play
52
- autoPlayEnabled.value = false
53
-
54
- // Clear any pending auto-advance
55
- if (autoAdvanceTimeout) {
56
- clearTimeout(autoAdvanceTimeout)
57
- autoAdvanceTimeout = null
58
- }
59
- }
60
-
61
- // Setup Intersection Observer
62
- onMounted(() => {
63
- if (!sectionRef.value) return
64
-
65
- observer = new IntersectionObserver(
66
- (entries) => {
67
- entries.forEach((entry) => {
68
- if (entry.isIntersecting && !isVisible.value) {
69
- isVisible.value = true
70
- // Disconnect observer after first intersection
71
- observer?.disconnect()
72
- }
73
- })
74
- },
75
- {
76
- threshold: 0.2, // Trigger when 20% of the element is visible
77
- rootMargin: '0px'
78
- }
79
- )
80
-
81
- observer.observe(sectionRef.value)
82
- })
83
-
84
- // Cleanup
85
- onUnmounted(() => {
86
- if (autoAdvanceTimeout) {
87
- clearTimeout(autoAdvanceTimeout)
88
- }
89
- if (observer) {
90
- observer.disconnect()
91
- }
92
- })
93
- </script>
94
-
95
- <template>
96
- <section
97
- ref="sectionRef"
98
- :style="{ backgroundImage: `url(${terminalBg})` }"
99
- class="wrapper border-t h-[40rem] bg-wine bg-cover bg-top flex justify-center pt-28 overflow-clip">
100
- <div
101
- :class="[
102
- 'self-stretch px-4 sm:px-8 py-5 sm:py-7 relative bg-primary rounded-tl-lg rounded-tr-lg inline-flex flex-col justify-start items-start gap-2 overflow-hidden w-[62rem] outline-1 outline-offset-[3px] outline-white/30',
103
- 'transition-transform duration-1000',
104
- isVisible ? 'translate-y-0' : 'translate-y-24'
105
- ]"
106
- style="transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);">
107
- <TabsRoot
108
- v-if="isVisible"
109
- v-model="activeTab"
110
- @update:modelValue="onTabChange"
111
- >
112
- <TabsList
113
- aria-label="features"
114
- :class="[
115
- 'absolute bottom-6 left-1/2 -translate-x-1/2 flex items-center p-1 rounded-md border border-white/10',
116
- 'transition-transform duration-700 delay-300',
117
- isVisible ? 'translate-y-0' : 'translate-y-12'
118
- ]"
119
- style="transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);">
120
- <TabsTrigger value="tab1">
121
- new
122
- </TabsTrigger>
123
- <TabsTrigger value="tab2">
124
- dev
125
- </TabsTrigger>
126
- <TabsTrigger value="tab3">
127
- lint
128
- </TabsTrigger>
129
- <TabsTrigger value="tab4">
130
- fmt
131
- </TabsTrigger>
132
- <TabsTrigger value="tab5">
133
- test
134
- </TabsTrigger>
135
- <TabsTrigger value="tab6">
136
- build
137
- </TabsTrigger>
138
- </TabsList>
139
- <TabsContent value="tab1">
140
- <TerminalAnimation1 :on-animation-complete="onAnimationComplete"/>
141
- </TabsContent>
142
- <TabsContent value="tab2">
143
- <TerminalAnimation2 :on-animation-complete="onAnimationComplete"/>
144
- </TabsContent>
145
- <TabsContent value="tab3">
146
- <TerminalAnimation3 :on-animation-complete="onAnimationComplete"/>
147
- </TabsContent>
148
- <TabsContent value="tab4">
149
- <TerminalAnimation4 :on-animation-complete="onAnimationComplete"/>
150
- </TabsContent>
151
- <TabsContent value="tab5">
152
- <TerminalAnimation5 :on-animation-complete="onAnimationComplete"/>
153
- </TabsContent>
154
- <TabsContent value="tab6">
155
- <TerminalAnimation6 :on-animation-complete="onAnimationComplete"/>
156
- </TabsContent>
157
- </TabsRoot>
158
-
159
- </div>
160
- </section>
161
- </template>
162
-
163
- <style scoped>
164
-
165
- </style>
@@ -1,54 +0,0 @@
1
- <script setup lang="ts">
2
- import {useTypewriter} from '../../composables/useTypewriter'
3
- import {onMounted, onUnmounted} from "vue";
4
-
5
- const props = defineProps<{
6
- onAnimationComplete?: () => void
7
- }>()
8
-
9
- let typewriter;
10
-
11
- onMounted(async () => {
12
- const Typewriter = await useTypewriter()
13
- const target = document.getElementById('terminal-code');
14
- typewriter = new Typewriter(target, {
15
- loop: false,
16
- delay: 1,
17
- })
18
- typewriter
19
- .typeString(`<span>$ vite new vite-plus-demo --template react-ts</span>`)
20
- .pauseFor(500)
21
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
22
- .pasteString(`<span class="text-aqua">◇ Scaffolding project in ~/vite-plus-demo</span>`)
23
- .pauseFor(500)
24
- .pasteString(`<span class="text-grey block">|</span>`)
25
- .pasteString(`<span class="text-zest block">└ Done.</span>`)
26
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
27
- .pauseFor(500)
28
- .pasteString(`<span class="block"><span class="text-zest">✓</span> Installing dependencies using default package manager: <span class="text-vite">pnpm@v10.16.1</span></span>`)
29
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
30
- .pasteString(`<div class="block"><span class="text-grey">Progress:</span> resolved 1, reused 0, downloaded 0, added 0</div>`)
31
- .pasteString(`<div class="block"><span class="text-grey">Packages:</span> <span class="text-vite">+31</span></div>`)
32
- .typeString(`<span class="text-grey block">++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</span>`)
33
- .pasteString(`<div class="block"><span class="text-grey">Progress:</span> resolved 31, reused 31, downloaded 0, added 31, <span class="text-zest">done</span></div>`)
34
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
35
- .callFunction(() => {
36
- if (props.onAnimationComplete) {
37
- props.onAnimationComplete()
38
- }
39
- })
40
- .start();
41
- })
42
-
43
- onUnmounted(() => {
44
- if(typewriter){
45
- typewriter.stop()
46
- }
47
- })
48
- </script>
49
-
50
- <template>
51
- <p class="font-mono text-sm text-white leading-[1.5rem]">
52
- <span id="terminal-code"></span>
53
- </p>
54
- </template>
@@ -1,59 +0,0 @@
1
- <script setup lang="ts">
2
- import {useTypewriter} from '../../composables/useTypewriter'
3
- import {onMounted, onUnmounted} from "vue";
4
-
5
- const props = defineProps<{
6
- onAnimationComplete?: () => void
7
- }>()
8
-
9
- let typewriter;
10
-
11
- onMounted(async () => {
12
- const Typewriter = await useTypewriter()
13
- // Get current time for easter egg
14
- const now = new Date()
15
- let hours = now.getHours()
16
- const minutes = now.getMinutes().toString().padStart(2, '0')
17
- const seconds = now.getSeconds().toString().padStart(2, '0')
18
- const ampm = hours >= 12 ? 'pm' : 'am'
19
- hours = hours % 12 || 12
20
- const currentTime = `${hours}:${minutes}:${seconds} ${ampm}`
21
-
22
- const target = document.getElementById('terminal-code');
23
- typewriter = new Typewriter(target, {
24
- loop: false,
25
- delay: 1,
26
- })
27
- typewriter
28
- .typeString(`<span>$ vite dev</span>`)
29
- .pauseFor(200)
30
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
31
- .pasteString(`<div class="block text-grey"><span class="text-vite">VITE+ v1.0.0</span> ready in <span class="text-white font-medium">65</span> ms</div>`)
32
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
33
- .pauseFor(500)
34
- .pasteString(`<div class="block"><span class="text-vite"> → Local: </span><span class="text-aqua">http://localhost:5173/</span></div>`)
35
- .pasteString(`<div class="block text-grey">→ Network: use <span class="text-white font-medium">--host</span> to expose</div>`)
36
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
37
- .pauseFor(1500)
38
- .pasteString(`<div class="block text-grey">${currentTime} <span class="text-aqua">[vite]</span> (client) <span class="text-vite">hmr update</span> /src/App.tsx</div>`)
39
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
40
- .callFunction(() => {
41
- if (props.onAnimationComplete) {
42
- props.onAnimationComplete()
43
- }
44
- })
45
- .start();
46
- })
47
-
48
- onUnmounted(() => {
49
- if(typewriter){
50
- typewriter.stop()
51
- }
52
- })
53
- </script>
54
-
55
- <template>
56
- <p class="font-mono text-sm text-white leading-[1.5rem]">
57
- <span id="terminal-code"></span>
58
- </p>
59
- </template>
@@ -1,46 +0,0 @@
1
- <script setup lang="ts">
2
- import {useTypewriter} from '../../composables/useTypewriter'
3
- import {onMounted, onUnmounted} from "vue";
4
-
5
- const props = defineProps<{
6
- onAnimationComplete?: () => void
7
- }>()
8
-
9
- let typewriter;
10
-
11
- onMounted(async () => {
12
- const Typewriter = await useTypewriter()
13
- const target = document.getElementById('terminal-code');
14
- typewriter = new Typewriter(target, {
15
- loop: false,
16
- delay: 1,
17
- })
18
- typewriter
19
- .typeString(`<span>$ vite lint</span>`)
20
- .pauseFor(200)
21
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
22
- .pasteString(`<div class="block text-grey"><span class="text-vite">VITE+ v1.0.0</span> <span class="text-aqua">lint</span></div>`)
23
- .pauseFor(500)
24
- .pasteString(`<div class="block text-grey">Found <span class="text-white">0 warnings</span> and <span class="text-white">0 errors</span>.</div>`)
25
- .pasteString(`<div class="block text-grey"><span class="text-zest">✓</span> Finished in <span class="text-white">1ms</span> on <span class="text-white">3 files</span> with <span class="text-white">88 rules</span> using <span class="text-white">10 threads</span>.</div>`)
26
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
27
- .callFunction(() => {
28
- if (props.onAnimationComplete) {
29
- props.onAnimationComplete()
30
- }
31
- })
32
- .start();
33
- })
34
-
35
- onUnmounted(() => {
36
- if(typewriter){
37
- typewriter.stop()
38
- }
39
- })
40
- </script>
41
-
42
- <template>
43
- <p class="font-mono text-sm text-white leading-[1.5rem]">
44
- <span id="terminal-code"></span>
45
- </p>
46
- </template>
@@ -1,50 +0,0 @@
1
- <script setup lang="ts">
2
- import {useTypewriter} from '../../composables/useTypewriter'
3
- import {onMounted, onUnmounted} from "vue";
4
-
5
- const props = defineProps<{
6
- onAnimationComplete?: () => void
7
- }>()
8
-
9
- let typewriter;
10
-
11
- onMounted(async () => {
12
- const Typewriter = await useTypewriter()
13
- const target = document.getElementById('terminal-code');
14
- typewriter = new Typewriter(target, {
15
- loop: false,
16
- delay: 1,
17
- })
18
- typewriter
19
- .typeString(`<span>$ vite fmt</span>`)
20
- .pauseFor(200)
21
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
22
- .pasteString(`<div class="block text-grey"><span class="text-vite">VITE+ v1.0.0</span> <span class="text-aqua">fmt</span></div>`)
23
- .pauseFor(500)
24
- .pasteString(`<div class="block">src/App.css <span class="text-aqua">0ms</span> <span class="text-grey">(unchanged)</span></div>`)
25
- .pasteString(`<div class="block">src/App.tsx <span class="text-aqua">1ms</span></div>`)
26
- .pasteString(`<div class="block">src/index.css <span class="text-aqua">0ms</span> <span class="text-grey">(unchanged)</span></div>`)
27
- .pasteString(`<div class="block">src/main.tsx <span class="text-aqua">1ms</span></div>`)
28
- .pasteString(`<div class="block">src/vite-env.d.ts <span class="text-aqua">0ms</span> <span class="text-grey">(unchanged)</span></div>`)
29
- .pasteString(`<div class="block"><span class="text-zest">✓</span> Formatted <span class="text-aqua">2 files</span> in <span class="text-aqua">2ms</span>.</div>`)
30
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
31
- .callFunction(() => {
32
- if (props.onAnimationComplete) {
33
- props.onAnimationComplete()
34
- }
35
- })
36
- .start();
37
- })
38
-
39
- onUnmounted(() => {
40
- if(typewriter){
41
- typewriter.stop()
42
- }
43
- })
44
- </script>
45
-
46
- <template>
47
- <p class="font-mono text-sm text-white leading-[1.5rem]">
48
- <span id="terminal-code"></span>
49
- </p>
50
- </template>
@@ -1,51 +0,0 @@
1
- <script setup lang="ts">
2
- import {useTypewriter} from '../../composables/useTypewriter'
3
- import {onMounted, onUnmounted} from "vue";
4
-
5
- const props = defineProps<{
6
- onAnimationComplete?: () => void
7
- }>()
8
-
9
- let typewriter;
10
-
11
- onMounted(async () => {
12
- const Typewriter = await useTypewriter()
13
- const target = document.getElementById('terminal-code');
14
- typewriter = new Typewriter(target, {
15
- loop: false,
16
- delay: 1,
17
- })
18
- typewriter
19
- .typeString(`<span>$ vite test</span>`)
20
- .pauseFor(200)
21
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
22
- .pasteString(`<div class="block"><span class="text-vite">VITE+ v1.0.0</span> <span class="text-aqua">test</span> RUN ~/vite-plus-demo</div>`)
23
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
24
- .pauseFor(300)
25
- .pasteString(`<div class="block"><span class="text-zest">✓</span> test/hello.spec.ts <span class="text-grey">(1 test)</span> <span class="text-zest">1ms</span></div>`)
26
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
27
- .pasteString(`<div class="block text-grey">Test Files <span class="text-zest">1 passed</span> <span class="text-grey">(1)</span></div>`)
28
- .pasteString(`<div class="block text-grey">Tests <span class="text-zest">1 passed</span> <span class="text-grey">(1)</span></div>`)
29
- .pasteString(`<div class="block text-grey">Start at <span class="text-white">00:13:44</span></div>`)
30
- .pasteString(`<div class="block text-grey">Duration <span class="text-white">199ms</span> <span class="text-grey">(transform 13ms, setup 0ms, collect 8ms, tests 1ms, environment 0ms, prepare 33ms)</span></div>`)
31
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
32
- .callFunction(() => {
33
- if (props.onAnimationComplete) {
34
- props.onAnimationComplete()
35
- }
36
- })
37
- .start();
38
- })
39
-
40
- onUnmounted(() => {
41
- if(typewriter){
42
- typewriter.stop()
43
- }
44
- })
45
- </script>
46
-
47
- <template>
48
- <p class="font-mono text-sm text-white leading-[1.5rem]">
49
- <span id="terminal-code"></span>
50
- </p>
51
- </template>
@@ -1,55 +0,0 @@
1
- <script setup lang="ts">
2
- import {useTypewriter} from '../../composables/useTypewriter'
3
- import {onMounted, onUnmounted} from "vue";
4
-
5
- const props = defineProps<{
6
- onAnimationComplete?: () => void
7
- }>()
8
-
9
- let typewriter;
10
-
11
- onMounted(async () => {
12
- const Typewriter = await useTypewriter()
13
- const target = document.getElementById('terminal-code');
14
- typewriter = new Typewriter(target, {
15
- loop: false,
16
- delay: 1,
17
- })
18
- typewriter
19
- .typeString(`<span>$ vite build</span>`)
20
- .pauseFor(200)
21
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
22
- .pasteString(`<div class="block"><span class="text-vite">VITE+ v1.0.0</span> <span class="text-aqua">building for production</span></div>`)
23
- .pauseFor(100)
24
- .pasteString(`<div class="block">transforming...</div>`)
25
- .pauseFor(400)
26
- .pasteString(`<div class="block"><span class="text-zest">✓</span> <span class="text-grey">32 modules transformed...</span></div>`)
27
- .pauseFor(300)
28
- .pasteString(`<div class="block">rendering chunks...</div>`)
29
- .pasteString(`<div class="block">computing gzip size...</div>`)
30
- .pasteString(`<div class="block text-grey"><span class="w-72 inline-block">dist/<span class="text-white">index.html</span></span>&nbsp;&nbsp;0.46 kB | gzip: 0.30 kB</div>`)
31
- .pasteString(`<div class="block text-grey"><span class="w-72 inline-block">dist/assets/<span class="text-vite">react-CHdo91hT.svg</span></span>&nbsp;&nbsp;4.13 kB | gzip: 2.05 kB</div>`)
32
- .pasteString(`<div class="block text-grey"><span class="w-72 inline-block">dist/assets/<span class="text-electric">index-D8b4DHJx.css</span></span>&nbsp;&nbsp;1.39 kB | gzip: 0.71 kB</div>`)
33
- .pasteString(`<div class="block text-grey"><span class="w-72 inline-block">dist/assets/<span class="text-aqua">index-CAl1KfkQ.js</span></span>188.06 kB | gzip: 59.21 kB</div>`)
34
- .pasteString(`<div class="block"><span class="text-zest">✓ built in 308ms</span></div>`)
35
- .pasteString(`<span class="block w-full h-[1rem]"></span>`)
36
- .callFunction(() => {
37
- if (props.onAnimationComplete) {
38
- props.onAnimationComplete()
39
- }
40
- })
41
- .start();
42
- })
43
-
44
- onUnmounted(() => {
45
- if(typewriter){
46
- typewriter.stop()
47
- }
48
- })
49
- </script>
50
-
51
- <template>
52
- <p class="font-mono text-sm text-white leading-[1.5rem]">
53
- <span id="terminal-code"></span>
54
- </p>
55
- </template>
@@ -1,43 +0,0 @@
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
- }