fancy-ui-vue 0.3.0 → 0.4.1

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 (102) hide show
  1. package/README.md +9 -6
  2. package/dist/components/animated-testimonials/AnimatedTestimonials.vue.js +23 -12
  3. package/dist/components/bg-falling-stars/FallingStarsBg.vue.js +10 -1
  4. package/dist/components/bg-falling-stars/bg-falling-stars-core.d.ts +6 -0
  5. package/dist/components/bg-falling-stars/bg-falling-stars-core.js +24 -2
  6. package/dist/components/bg-stars/StarsBackground.vue.js +1 -1
  7. package/dist/components/bg-stars/StarsBackground.vue2.js +13 -1
  8. package/dist/components/bg-stars/bg-stars-core.d.ts +6 -0
  9. package/dist/components/bg-stars/bg-stars-core.js +21 -1
  10. package/dist/components/book/Book.vue.js +5 -83
  11. package/dist/components/book/Book.vue2.js +82 -1
  12. package/dist/components/box-reveal/BoxReveal.vue.js +5 -47
  13. package/dist/components/box-reveal/BoxReveal.vue2.js +48 -1
  14. package/dist/components/compare/StarField.vue.js +1 -1
  15. package/dist/components/container-text-flip/ContainerTextFlip.vue.js +1 -1
  16. package/dist/components/container-text-flip/ContainerTextFlip.vue2.js +14 -5
  17. package/dist/components/flickering-grid/FlickeringGrid.vue.js +19 -1
  18. package/dist/components/flickering-grid/flickering-grid-core.d.ts +6 -0
  19. package/dist/components/flickering-grid/flickering-grid-core.js +30 -1
  20. package/dist/components/flip-words/FlipWords.vue.js +1 -1
  21. package/dist/components/flip-words/FlipWords.vue2.js +14 -7
  22. package/dist/components/hyper-text/HyperText.vue.js +6 -97
  23. package/dist/components/hyper-text/HyperText.vue2.js +101 -0
  24. package/dist/components/letter-pullup/LetterPullup.vue.js +6 -38
  25. package/dist/components/letter-pullup/LetterPullup.vue2.js +40 -0
  26. package/dist/components/logo-cloud/AnimatedLogoCloud.vue.js +1 -1
  27. package/dist/components/magnetic-field/MagnetPuck.vue.d.ts +51 -0
  28. package/dist/components/magnetic-field/MagnetPuck.vue.js +7 -0
  29. package/dist/components/magnetic-field/MagnetPuck.vue2.js +191 -0
  30. package/dist/components/magnetic-field/MagneticField.vue.d.ts +39 -0
  31. package/dist/components/magnetic-field/MagneticField.vue.js +7 -0
  32. package/dist/components/magnetic-field/MagneticField.vue2.js +157 -0
  33. package/dist/components/magnetic-field/MagneticItem.vue.d.ts +28 -0
  34. package/dist/components/magnetic-field/MagneticItem.vue.js +7 -0
  35. package/dist/components/magnetic-field/MagneticItem.vue2.js +72 -0
  36. package/dist/components/magnetic-field/index.d.ts +10 -0
  37. package/dist/components/magnetic-field/magnetic-field-core.d.ts +163 -0
  38. package/dist/components/magnetic-field/magnetic-field-core.js +534 -0
  39. package/dist/components/magnetic-field/magnetic-field-source.d.ts +58 -0
  40. package/dist/components/magnetic-field/magnetic-field-source.js +58 -0
  41. package/dist/components/magnetic-field/types.d.ts +14 -0
  42. package/dist/components/magnetic-field/types.js +5 -0
  43. package/dist/components/matrix-rain/MatrixRain.vue.js +20 -1
  44. package/dist/components/matrix-rain/matrix-rain-core.d.ts +6 -0
  45. package/dist/components/matrix-rain/matrix-rain-core.js +28 -6
  46. package/dist/components/noise-reveal/NoiseReveal.vue.js +7 -0
  47. package/dist/components/noise-reveal/noise-reveal-core.js +23 -7
  48. package/dist/components/pixel-scene/PixelScene.vue.d.ts +60 -0
  49. package/dist/components/pixel-scene/PixelScene.vue.js +184 -0
  50. package/dist/components/pixel-scene/PixelScene.vue2.js +4 -0
  51. package/dist/components/pixel-scene/index.d.ts +4 -0
  52. package/dist/components/pixel-scene/pixel-scene-core.d.ts +256 -0
  53. package/dist/components/pixel-scene/pixel-scene-core.js +878 -0
  54. package/dist/components/pixel-scene/pixel-scene-hdr.d.ts +68 -0
  55. package/dist/components/pixel-scene/pixel-scene-hdr.js +312 -0
  56. package/dist/components/pixel-scene/pixel-scene-scenes.d.ts +31 -0
  57. package/dist/components/pixel-scene/pixel-scene-scenes.js +1074 -0
  58. package/dist/components/ripple/Ripple.vue.js +1 -1
  59. package/dist/components/ripple/Ripple.vue2.js +6 -1
  60. package/dist/components/sparkles/Sparkles.vue.js +10 -1
  61. package/dist/components/sparkles/sparkles-core.d.ts +6 -0
  62. package/dist/components/sparkles/sparkles-core.js +26 -2
  63. package/dist/components/sparkles-text/SparklesText.vue.js +6 -88
  64. package/dist/components/sparkles-text/SparklesText.vue2.js +100 -0
  65. package/dist/components/story-thread/StoryNode.vue.d.ts +11 -0
  66. package/dist/components/story-thread/StoryNode.vue.js +7 -0
  67. package/dist/components/story-thread/StoryNode.vue2.js +23 -0
  68. package/dist/components/story-thread/StoryThread.vue.d.ts +56 -0
  69. package/dist/components/story-thread/StoryThread.vue.js +7 -0
  70. package/dist/components/story-thread/StoryThread.vue2.js +103 -0
  71. package/dist/components/story-thread/index.d.ts +5 -0
  72. package/dist/components/story-thread/story-thread-core.d.ts +119 -0
  73. package/dist/components/story-thread/story-thread-core.js +491 -0
  74. package/dist/components/story-thread/types.d.ts +1 -0
  75. package/dist/components/sun-switch/SunSwitch.vue.d.ts +61 -0
  76. package/dist/components/sun-switch/SunSwitch.vue.js +7 -0
  77. package/dist/components/sun-switch/SunSwitch.vue2.js +559 -0
  78. package/dist/components/sun-switch/index.d.ts +4 -0
  79. package/dist/components/sun-switch/pixel-wave-core.d.ts +82 -0
  80. package/dist/components/sun-switch/pixel-wave-core.js +508 -0
  81. package/dist/components/sun-switch/sun-switch-core.d.ts +251 -0
  82. package/dist/components/sun-switch/sun-switch-core.js +546 -0
  83. package/dist/components/sun-switch/sun-switch-hdr.d.ts +70 -0
  84. package/dist/components/sun-switch/sun-switch-hdr.js +311 -0
  85. package/dist/components/terminal-text/TerminalText.vue.js +1 -1
  86. package/dist/components/terminal-text/TerminalText.vue2.js +36 -4
  87. package/dist/components/text-generate-effect/TextGenerateEffect.vue.js +5 -72
  88. package/dist/components/text-generate-effect/TextGenerateEffect.vue2.js +74 -1
  89. package/dist/components/text-reveal-card/TextRevealCard.vue.js +5 -101
  90. package/dist/components/text-reveal-card/TextRevealCard.vue2.js +98 -1
  91. package/dist/components/text-reveal-card/TextRevealStars.vue.js +1 -1
  92. package/dist/components/text-reveal-card/TextRevealStars.vue2.js +29 -12
  93. package/dist/components/tracing-beam/TracingBeam.vue.d.ts +20 -1
  94. package/dist/components/tracing-beam/TracingBeam.vue.js +5 -164
  95. package/dist/components/tracing-beam/TracingBeam.vue2.js +168 -1
  96. package/dist/index.d.ts +4 -0
  97. package/dist/index.js +361 -338
  98. package/dist/styles.css +731 -89
  99. package/package.json +1 -1
  100. package/dist/components/hyper-text/HyperText.vue3.js +0 -5
  101. package/dist/components/letter-pullup/LetterPullup.vue3.js +0 -5
  102. package/dist/components/sparkles-text/SparklesText.vue3.js +0 -5
@@ -1,49 +1,7 @@
1
- import { defineComponent, useAttrs, useTemplateRef, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, normalizeStyle, renderSlot } from "vue";
2
- import { cn } from "../../utils.js";
3
- import { useInView } from "../../internals/motion/use-in-view.js";
4
- const _sfc_main = /* @__PURE__ */ defineComponent({
5
- ...{ name: "BoxReveal", inheritAttrs: false },
6
- __name: "BoxReveal",
7
- props: {
8
- color: { default: "#5046e6" },
9
- duration: { default: 0.5 },
10
- delay: { default: 0.25 },
11
- class: { type: [Boolean, null, String, Object, Array] }
12
- },
13
- setup(__props) {
14
- const attrs = useAttrs();
15
- const containerRef = useTemplateRef("containerRef");
16
- const isInView = useInView(containerRef, () => ({ threshold: 0.1, once: true }));
17
- const contentStyle = computed(() => ({
18
- opacity: isInView.value ? "1" : "0",
19
- transform: `translateY(${isInView.value ? 0 : 25}px)`,
20
- transition: `opacity ${__props.duration}s ease ${__props.delay * 2}s,transform ${__props.duration}s ease ${__props.delay * 2}s`
21
- }));
22
- const overlayStyle = computed(() => ({
23
- background: `${__props.color}`,
24
- left: isInView.value ? "100%" : "0%",
25
- transition: `left ${__props.duration}s ease-in ${__props.delay}s`
26
- }));
27
- return (_ctx, _cache) => {
28
- return openBlock(), createElementBlock("div", mergeProps(unref(attrs), {
29
- ref_key: "containerRef",
30
- ref: containerRef,
31
- class: unref(cn)("box-reveal relative overflow-hidden", __props.class)
32
- }), [
33
- createElementVNode("div", {
34
- class: "box-reveal-content",
35
- style: normalizeStyle(contentStyle.value)
36
- }, [
37
- renderSlot(_ctx.$slots, "default")
38
- ], 4),
39
- createElementVNode("div", {
40
- class: "box-reveal-overlay absolute inset-0 z-20",
41
- style: normalizeStyle(overlayStyle.value)
42
- }, null, 4)
43
- ], 16);
44
- };
45
- }
46
- });
1
+ import _sfc_main from "./BoxReveal.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const BoxReveal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e343dd7c"]]);
47
5
  export {
48
- _sfc_main as default
6
+ BoxReveal as default
49
7
  };
@@ -1,4 +1,51 @@
1
- import _sfc_main from "./BoxReveal.vue.js";
1
+ import { defineComponent, useAttrs, useTemplateRef, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, normalizeStyle, renderSlot } from "vue";
2
+ import { cn } from "../../utils.js";
3
+ import { useInView } from "../../internals/motion/use-in-view.js";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ ...{ name: "BoxReveal", inheritAttrs: false },
6
+ __name: "BoxReveal",
7
+ props: {
8
+ color: { default: "#5046e6" },
9
+ duration: { default: 0.5 },
10
+ delay: { default: 0.25 },
11
+ class: { type: [Boolean, null, String, Object, Array] }
12
+ },
13
+ setup(__props) {
14
+ const attrs = useAttrs();
15
+ const containerRef = useTemplateRef("containerRef");
16
+ const isInView = useInView(containerRef, () => ({ threshold: 0.1, once: true }));
17
+ const contentStyle = computed(() => ({
18
+ opacity: isInView.value ? "1" : "0",
19
+ transform: `translateY(${isInView.value ? 0 : 25}px)`,
20
+ "--box-reveal-duration": `${__props.duration}s`,
21
+ "--box-reveal-delay": `${__props.delay * 2}s`
22
+ }));
23
+ const overlayStyle = computed(() => ({
24
+ background: `${__props.color}`,
25
+ left: isInView.value ? "100%" : "0%",
26
+ "--box-reveal-duration": `${__props.duration}s`,
27
+ "--box-reveal-delay": `${__props.delay}s`
28
+ }));
29
+ return (_ctx, _cache) => {
30
+ return openBlock(), createElementBlock("div", mergeProps(unref(attrs), {
31
+ ref_key: "containerRef",
32
+ ref: containerRef,
33
+ class: unref(cn)("box-reveal relative overflow-hidden", __props.class)
34
+ }), [
35
+ createElementVNode("div", {
36
+ class: "box-reveal-content",
37
+ style: normalizeStyle(contentStyle.value)
38
+ }, [
39
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
40
+ ], 4),
41
+ createElementVNode("div", {
42
+ class: "box-reveal-overlay absolute inset-0 z-20",
43
+ style: normalizeStyle(overlayStyle.value)
44
+ }, null, 4)
45
+ ], 16);
46
+ };
47
+ }
48
+ });
2
49
  export {
3
50
  _sfc_main as default
4
51
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./StarField.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const StarField = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9fadc287"]]);
4
+ const StarField = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-06a2b4e6"]]);
5
5
  export {
6
6
  StarField as default
7
7
  };
@@ -2,7 +2,7 @@ import _sfc_main from "./ContainerTextFlip.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
5
- const ContainerTextFlip = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-58f10267"]]);
5
+ const ContainerTextFlip = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ad8bc4bd"]]);
6
6
  export {
7
7
  ContainerTextFlip as default
8
8
  };
@@ -1,5 +1,6 @@
1
- import { defineComponent, useAttrs, ref, computed, onMounted, onBeforeUnmount, createElementBlock, openBlock, mergeProps, unref, createElementVNode, normalizeClass, Fragment, renderList, normalizeStyle, toDisplayString } from "vue";
1
+ import { defineComponent, useAttrs, ref, computed, onMounted, watch, createElementBlock, openBlock, mergeProps, unref, createElementVNode, normalizeClass, Fragment, renderList, normalizeStyle, toDisplayString } from "vue";
2
2
  import { cn } from "../../utils.js";
3
+ import { useReducedMotion } from "../../internals/motion/use-media-query.js";
3
4
  const _hoisted_1 = { class: "inline-block" };
4
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
6
  ...{ name: "ContainerTextFlip", inheritAttrs: false },
@@ -16,11 +17,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
17
  const currentWordIndex = ref(0);
17
18
  const currentWord = computed(() => __props.words[currentWordIndex.value] ?? "");
18
19
  const letters = computed(() => currentWord.value.split(""));
20
+ const reducedMotion = useReducedMotion();
19
21
  onMounted(() => {
20
- const id = setInterval(() => {
21
- currentWordIndex.value = (currentWordIndex.value + 1) % __props.words.length;
22
- }, __props.interval);
23
- onBeforeUnmount(() => clearInterval(id));
22
+ watch(
23
+ reducedMotion,
24
+ (reduced, _old, onCleanup) => {
25
+ if (reduced) return;
26
+ const id = setInterval(() => {
27
+ currentWordIndex.value = (currentWordIndex.value + 1) % __props.words.length;
28
+ }, __props.interval);
29
+ onCleanup(() => clearInterval(id));
30
+ },
31
+ { flush: "post", immediate: true }
32
+ );
24
33
  });
25
34
  return (_ctx, _cache) => {
26
35
  return openBlock(), createElementBlock("p", mergeProps(unref(attrs), {
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, useTemplateRef, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, unref, createElementVNode } from "vue";
2
2
  import { cn } from "../../utils.js";
3
+ import { useReducedMotion } from "../../internals/motion/use-media-query.js";
3
4
  import { createFlickeringGrid } from "./flickering-grid-core.js";
4
5
  const _hoisted_1 = {
5
6
  ref: "canvas",
@@ -24,6 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
25
  let engine = null;
25
26
  let resizeObserver = null;
26
27
  let intersectionObserver = null;
28
+ const reducedMotion = useReducedMotion();
27
29
  watch(
28
30
  () => ({ squareSize: __props.squareSize, gridGap: __props.gridGap, flickerChance: __props.flickerChance, color: __props.color, maxOpacity: __props.maxOpacity, width: __props.width, height: __props.height }),
29
31
  (next) => {
@@ -37,7 +39,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
37
39
  if (!container || !canvas) return;
38
40
  engine = createFlickeringGrid(
39
41
  { container, canvas },
40
- { squareSize: __props.squareSize, gridGap: __props.gridGap, flickerChance: __props.flickerChance, color: __props.color, maxOpacity: __props.maxOpacity, width: __props.width, height: __props.height }
42
+ {
43
+ squareSize: __props.squareSize,
44
+ gridGap: __props.gridGap,
45
+ flickerChance: __props.flickerChance,
46
+ color: __props.color,
47
+ maxOpacity: __props.maxOpacity,
48
+ width: __props.width,
49
+ height: __props.height,
50
+ reducedMotion: reducedMotion.value
51
+ }
41
52
  );
42
53
  if (!engine) return;
43
54
  resizeObserver = new ResizeObserver(() => {
@@ -60,6 +71,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
60
71
  engine?.destroy();
61
72
  engine = null;
62
73
  });
74
+ watch(
75
+ reducedMotion,
76
+ (next) => {
77
+ engine?.setOptions({ reducedMotion: next });
78
+ },
79
+ { flush: "post" }
80
+ );
63
81
  return (_ctx, _cache) => {
64
82
  return openBlock(), createElementBlock("div", {
65
83
  ref: "container",
@@ -27,6 +27,12 @@ export interface FlickeringGridLiveOptions {
27
27
  width?: number;
28
28
  /** Fixed height in pixels (defaults to container height) */
29
29
  height?: number;
30
+ /**
31
+ * Reduced-motion preference, owned by the wrapper (the core never reads
32
+ * `matchMedia`). When true the grid paints one still frame while in view and
33
+ * idles; a flip back to false resumes the flicker.
34
+ */
35
+ reducedMotion?: boolean;
30
36
  }
31
37
  export interface FlickeringGridEngine {
32
38
  setOptions(next: Partial<FlickeringGridLiveOptions>): void;
@@ -56,7 +56,10 @@ function createColorResolver(el) {
56
56
  function createFlickeringGrid(el, options, random = Math.random) {
57
57
  const ctx = el.canvas.getContext("2d");
58
58
  if (!ctx) return null;
59
- const opts = { ...DEFAULTS, ...options };
59
+ const opts = {
60
+ ...DEFAULTS,
61
+ ...options
62
+ };
60
63
  let isInView = false;
61
64
  let animationFrameId;
62
65
  let lastTime = 0;
@@ -112,14 +115,38 @@ function createFlickeringGrid(el, options, random = Math.random) {
112
115
  if (!isInView || destroyed) return;
113
116
  const deltaTime = (time - lastTime) / 1e3;
114
117
  lastTime = time;
118
+ if (opts.reducedMotion) {
119
+ drawGrid();
120
+ animationFrameId = void 0;
121
+ return;
122
+ }
115
123
  updateSquares(deltaTime);
116
124
  drawGrid();
117
125
  animationFrameId = requestAnimationFrame(animate);
118
126
  }
127
+ function repaintIdle() {
128
+ if (opts.reducedMotion && isInView && animationFrameId === void 0) drawGrid();
129
+ }
119
130
  updateCanvasSize();
131
+ const themeObserver = typeof MutationObserver !== "undefined" ? new MutationObserver(() => {
132
+ if (CURRENT_COLOR.test(opts.color)) repaintIdle();
133
+ }) : null;
134
+ themeObserver?.observe(document.documentElement, {
135
+ attributes: true,
136
+ attributeFilter: ["class"]
137
+ });
120
138
  return {
121
139
  setOptions(next) {
140
+ if (destroyed) return;
141
+ const wasReduced = opts.reducedMotion;
122
142
  Object.assign(opts, next);
143
+ if (wasReduced && !opts.reducedMotion) {
144
+ if (isInView && animationFrameId === void 0) {
145
+ animationFrameId = requestAnimationFrame(animate);
146
+ }
147
+ } else {
148
+ repaintIdle();
149
+ }
123
150
  },
124
151
  setInView(nextIsInView) {
125
152
  if (destroyed) return;
@@ -131,10 +158,12 @@ function createFlickeringGrid(el, options, random = Math.random) {
131
158
  resize() {
132
159
  if (destroyed) return;
133
160
  updateCanvasSize();
161
+ repaintIdle();
134
162
  },
135
163
  destroy() {
136
164
  if (destroyed) return;
137
165
  destroyed = true;
166
+ themeObserver?.disconnect();
138
167
  if (animationFrameId !== void 0) {
139
168
  cancelAnimationFrame(animationFrameId);
140
169
  animationFrameId = void 0;
@@ -2,7 +2,7 @@ import _sfc_main from "./FlipWords.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
5
- const FlipWords = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2d9070d7"]]);
5
+ const FlipWords = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8436152b"]]);
6
6
  export {
7
7
  FlipWords as default
8
8
  };
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, ref, computed, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, normalizeStyle, createTextVNode, createElementVNode, toDisplayString } from "vue";
2
2
  import { cn } from "../../utils.js";
3
+ import { useReducedMotion } from "../../internals/motion/use-media-query.js";
3
4
  const _hoisted_1 = { class: "flip-words relative inline-block px-2" };
4
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
6
  ...{ name: "FlipWords", inheritAttrs: false },
@@ -13,6 +14,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
14
  const EXIT_MS = 600;
14
15
  const currentIndex = ref(0);
15
16
  const isExiting = ref(false);
17
+ const reducedMotion = useReducedMotion();
16
18
  let timeoutId = null;
17
19
  let exitTimeoutId = null;
18
20
  const currentWord = computed(() => __props.words[currentIndex.value] ?? "");
@@ -37,8 +39,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
37
39
  timeoutId = setTimeout(startAnimation, d);
38
40
  }
39
41
  watch(
40
- () => [currentIndex.value, isExiting.value, __props.words.length, __props.duration],
41
- ([index, exiting, , d]) => {
42
+ () => [currentIndex.value, isExiting.value, __props.words.length, __props.duration, reducedMotion.value],
43
+ ([index, exiting, , d, reduced]) => {
44
+ if (reduced) {
45
+ if (timeoutId) clearTimeout(timeoutId);
46
+ timeoutId = null;
47
+ return;
48
+ }
42
49
  if (!exiting) {
43
50
  scheduleNext(index, d);
44
51
  }
@@ -46,7 +53,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
46
53
  { flush: "post" }
47
54
  );
48
55
  onMounted(() => {
49
- if (!isExiting.value) {
56
+ if (!isExiting.value && !reducedMotion.value) {
50
57
  scheduleNext(currentIndex.value, __props.duration);
51
58
  }
52
59
  });
@@ -69,14 +76,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
69
76
  (openBlock(true), createElementBlock(Fragment, null, renderList(splitWords.value, (wordObj, wordIndex) => {
70
77
  return openBlock(), createElementBlock("span", {
71
78
  key: wordObj.word + wordIndex,
72
- class: "flip-words-word inline-block whitespace-nowrap opacity-0",
73
- style: normalizeStyle(`animation:flipFadeInWord 0.3s ease forwards;animation-delay:${wordIndex * 0.3}s`)
79
+ class: "flip-words-word inline-block whitespace-nowrap",
80
+ style: normalizeStyle({ "--flip-words-word-delay": `${wordIndex * 0.3}s` })
74
81
  }, [
75
82
  (openBlock(true), createElementBlock(Fragment, null, renderList(wordObj.letters, (letter, letterIndex) => {
76
83
  return openBlock(), createElementBlock("span", {
77
84
  key: wordObj.word + letterIndex,
78
- class: "inline-block opacity-0",
79
- style: normalizeStyle(`animation:flipFadeInLetter 0.2s ease forwards;animation-delay:${wordIndex * 0.3 + letterIndex * 0.05}s`)
85
+ class: "flip-words-letter inline-block",
86
+ style: normalizeStyle({ "--flip-words-letter-delay": `${wordIndex * 0.3 + letterIndex * 0.05}s` })
80
87
  }, toDisplayString(letter), 5);
81
88
  }), 128)),
82
89
  _cache[0] || (_cache[0] = createTextVNode(toDisplayString(" "), -1)),
@@ -1,99 +1,8 @@
1
- import { defineComponent, computed, ref, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString } from "vue";
2
- import { cn } from "../../utils.js";
3
- const _hoisted_1 = { class: "flex" };
4
- const _sfc_main = /* @__PURE__ */ defineComponent({
5
- ...{ name: "HyperText", inheritAttrs: false },
6
- __name: "HyperText",
7
- props: {
8
- text: {},
9
- duration: { default: 800 },
10
- animateOnLoad: { type: Boolean, default: false },
11
- seed: { default: 1 },
12
- class: { type: [Boolean, null, String, Object, Array] }
13
- },
14
- setup(__props) {
15
- const ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
16
- function mulberry32(seedValue) {
17
- let state = seedValue >>> 0;
18
- return () => {
19
- state = state + 1831565813 >>> 0;
20
- let t = state;
21
- t = Math.imul(t ^ t >>> 15, t | 1);
22
- t ^= t + Math.imul(t ^ t >>> 7, t | 61);
23
- return ((t ^ t >>> 14) >>> 0) / 4294967296;
24
- };
25
- }
26
- const displayChars = computed(() => __props.text.split(""));
27
- const displayText = ref(displayChars.value);
28
- let intervalId = null;
29
- let iterations = 0;
30
- watch(
31
- displayChars,
32
- (next) => {
33
- displayText.value = next;
34
- },
35
- { flush: "post" }
36
- );
37
- function getRandomLetter(random) {
38
- return ALPHABETS[Math.floor(random() * ALPHABETS.length)] ?? "A";
39
- }
40
- function stopAnimation() {
41
- if (intervalId) {
42
- clearInterval(intervalId);
43
- intervalId = null;
44
- }
45
- }
46
- function startAnimation() {
47
- stopAnimation();
48
- iterations = 0;
49
- const intervalMs = __props.duration / (__props.text.length * 10);
50
- const random = mulberry32(__props.seed);
51
- intervalId = setInterval(() => {
52
- const target = __props.text;
53
- if (iterations < target.length) {
54
- displayText.value = displayText.value.map(
55
- (l, i) => l === " " ? l : i <= iterations ? target[i] ?? l : getRandomLetter(random)
56
- );
57
- iterations += 0.1;
58
- } else {
59
- stopAnimation();
60
- displayText.value = target.split("");
61
- }
62
- }, intervalMs);
63
- }
64
- function triggerAnimation() {
65
- iterations = 0;
66
- startAnimation();
67
- }
68
- onMounted(() => {
69
- if (__props.animateOnLoad) {
70
- triggerAnimation();
71
- }
72
- });
73
- onBeforeUnmount(stopAnimation);
74
- return (_ctx, _cache) => {
75
- return openBlock(), createElementBlock("div", {
76
- class: normalizeClass(unref(cn)("hyper-text flex scale-100 cursor-default overflow-hidden py-2", __props.class)),
77
- onMouseenter: triggerAnimation,
78
- role: "presentation"
79
- }, [
80
- createElementVNode("div", _hoisted_1, [
81
- (openBlock(true), createElementBlock(Fragment, null, renderList(displayText.value, (letter, i) => {
82
- return openBlock(), createElementBlock("span", {
83
- key: i,
84
- class: normalizeClass(unref(cn)("hyper-text-char inline-block font-mono", letter === " " ? "w-3" : "")),
85
- style: normalizeStyle({
86
- animation: "hyperFadeIn 0.3s ease forwards",
87
- animationDelay: `${i * (__props.duration / (__props.text.length * 10))}ms`,
88
- opacity: 0
89
- })
90
- }, toDisplayString(letter.toUpperCase()), 7);
91
- }), 128))
92
- ])
93
- ], 34);
94
- };
95
- }
96
- });
1
+ import _sfc_main from "./HyperText.vue2.js";
2
+ /* empty css */
3
+ /* empty css */
4
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
5
+ const HyperText = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f520f7e3"]]);
97
6
  export {
98
- _sfc_main as default
7
+ HyperText as default
99
8
  };
@@ -0,0 +1,101 @@
1
+ import { defineComponent, computed, ref, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString } from "vue";
2
+ import { cn } from "../../utils.js";
3
+ import { prefersReducedMotion } from "../../internals/motion/anchored.js";
4
+ const _hoisted_1 = { class: "flex" };
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ ...{ name: "HyperText", inheritAttrs: false },
7
+ __name: "HyperText",
8
+ props: {
9
+ text: {},
10
+ duration: { default: 800 },
11
+ animateOnLoad: { type: Boolean, default: false },
12
+ seed: { default: 1 },
13
+ class: { type: [Boolean, null, String, Object, Array] }
14
+ },
15
+ setup(__props) {
16
+ const ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
17
+ function mulberry32(seedValue) {
18
+ let state = seedValue >>> 0;
19
+ return () => {
20
+ state = state + 1831565813 >>> 0;
21
+ let t = state;
22
+ t = Math.imul(t ^ t >>> 15, t | 1);
23
+ t ^= t + Math.imul(t ^ t >>> 7, t | 61);
24
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
25
+ };
26
+ }
27
+ const displayChars = computed(() => __props.text.split(""));
28
+ const displayText = ref(displayChars.value);
29
+ let intervalId = null;
30
+ let iterations = 0;
31
+ watch(
32
+ displayChars,
33
+ (next) => {
34
+ displayText.value = next;
35
+ },
36
+ { flush: "post" }
37
+ );
38
+ function getRandomLetter(random) {
39
+ return ALPHABETS[Math.floor(random() * ALPHABETS.length)] ?? "A";
40
+ }
41
+ function stopAnimation() {
42
+ if (intervalId) {
43
+ clearInterval(intervalId);
44
+ intervalId = null;
45
+ }
46
+ }
47
+ function startAnimation() {
48
+ stopAnimation();
49
+ iterations = 0;
50
+ const intervalMs = __props.duration / (__props.text.length * 10);
51
+ const random = mulberry32(__props.seed);
52
+ intervalId = setInterval(() => {
53
+ const target = __props.text;
54
+ if (iterations < target.length) {
55
+ displayText.value = displayText.value.map(
56
+ (l, i) => l === " " ? l : i <= iterations ? target[i] ?? l : getRandomLetter(random)
57
+ );
58
+ iterations += 0.1;
59
+ } else {
60
+ stopAnimation();
61
+ displayText.value = target.split("");
62
+ }
63
+ }, intervalMs);
64
+ }
65
+ function triggerAnimation() {
66
+ iterations = 0;
67
+ if (prefersReducedMotion()) {
68
+ stopAnimation();
69
+ displayText.value = __props.text.split("");
70
+ return;
71
+ }
72
+ startAnimation();
73
+ }
74
+ onMounted(() => {
75
+ if (__props.animateOnLoad) {
76
+ triggerAnimation();
77
+ }
78
+ });
79
+ onBeforeUnmount(stopAnimation);
80
+ return (_ctx, _cache) => {
81
+ return openBlock(), createElementBlock("div", {
82
+ class: normalizeClass(unref(cn)("hyper-text flex scale-100 cursor-default overflow-hidden py-2", __props.class)),
83
+ onMouseenter: triggerAnimation,
84
+ role: "presentation"
85
+ }, [
86
+ createElementVNode("div", _hoisted_1, [
87
+ (openBlock(true), createElementBlock(Fragment, null, renderList(displayText.value, (letter, i) => {
88
+ return openBlock(), createElementBlock("span", {
89
+ key: i,
90
+ class: normalizeClass(unref(cn)("hyper-text-char inline-block font-mono", letter === " " ? "w-3" : "")),
91
+ style: normalizeStyle({ "--hyper-text-delay": `${i * (__props.duration / (__props.text.length * 10))}ms` })
92
+ }, toDisplayString(letter.toUpperCase()), 7);
93
+ }), 128))
94
+ ])
95
+ ], 34);
96
+ };
97
+ }
98
+ });
99
+ export {
100
+ _sfc_main as default
101
+ };
@@ -1,40 +1,8 @@
1
- import { defineComponent, useAttrs, computed, createElementBlock, openBlock, mergeProps, unref, Fragment, renderList, normalizeStyle, normalizeClass, createTextVNode, toDisplayString } from "vue";
2
- import { cn } from "../../utils.js";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
- ...{ name: "LetterPullup", inheritAttrs: false },
5
- __name: "LetterPullup",
6
- props: {
7
- words: {},
8
- delay: { default: 0.05 },
9
- class: { type: [Boolean, null, String, Object, Array] }
10
- },
11
- setup(__props) {
12
- const attrs = useAttrs();
13
- const letters = computed(() => __props.words.split(""));
14
- return (_ctx, _cache) => {
15
- return openBlock(), createElementBlock("div", mergeProps(unref(attrs), { class: "letter-pullup flex justify-center" }), [
16
- (openBlock(true), createElementBlock(Fragment, null, renderList(letters.value, (letter, index) => {
17
- return openBlock(), createElementBlock("span", {
18
- key: index,
19
- class: normalizeClass(
20
- unref(cn)(
21
- "letter-pullup-char inline-block text-center text-4xl font-bold tracking-[-0.02em] text-black drop-shadow-sm md:leading-[5rem] dark:text-white",
22
- __props.class
23
- )
24
- ),
25
- style: normalizeStyle(`animation:letterPullUp 0.5s ease forwards;animation-delay:${index * __props.delay}s;opacity:0;transform:translateY(100px)`)
26
- }, [
27
- letter === " " ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
28
- createTextVNode(" ")
29
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
30
- createTextVNode(toDisplayString(letter), 1)
31
- ], 64))
32
- ], 6);
33
- }), 128))
34
- ], 16);
35
- };
36
- }
37
- });
1
+ import _sfc_main from "./LetterPullup.vue2.js";
2
+ /* empty css */
3
+ /* empty css */
4
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
5
+ const LetterPullup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-83f4fa7b"]]);
38
6
  export {
39
- _sfc_main as default
7
+ LetterPullup as default
40
8
  };
@@ -0,0 +1,40 @@
1
+ import { defineComponent, useAttrs, computed, createElementBlock, openBlock, mergeProps, unref, Fragment, renderList, normalizeStyle, normalizeClass, createTextVNode, toDisplayString } from "vue";
2
+ import { cn } from "../../utils.js";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ ...{ name: "LetterPullup", inheritAttrs: false },
5
+ __name: "LetterPullup",
6
+ props: {
7
+ words: {},
8
+ delay: { default: 0.05 },
9
+ class: { type: [Boolean, null, String, Object, Array] }
10
+ },
11
+ setup(__props) {
12
+ const attrs = useAttrs();
13
+ const letters = computed(() => __props.words.split(""));
14
+ return (_ctx, _cache) => {
15
+ return openBlock(), createElementBlock("div", mergeProps(unref(attrs), { class: "letter-pullup flex justify-center" }), [
16
+ (openBlock(true), createElementBlock(Fragment, null, renderList(letters.value, (letter, index) => {
17
+ return openBlock(), createElementBlock("span", {
18
+ key: index,
19
+ class: normalizeClass(
20
+ unref(cn)(
21
+ "letter-pullup-char inline-block text-center text-4xl font-bold tracking-[-0.02em] text-black drop-shadow-sm md:leading-[5rem] dark:text-white",
22
+ __props.class
23
+ )
24
+ ),
25
+ style: normalizeStyle({ "--letter-pullup-delay": `${index * __props.delay}s` })
26
+ }, [
27
+ letter === " " ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
28
+ createTextVNode(" ")
29
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
30
+ createTextVNode(toDisplayString(letter), 1)
31
+ ], 64))
32
+ ], 6);
33
+ }), 128))
34
+ ], 16);
35
+ };
36
+ }
37
+ });
38
+ export {
39
+ _sfc_main as default
40
+ };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./AnimatedLogoCloud.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const AnimatedLogoCloud = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-49a512a4"]]);
4
+ const AnimatedLogoCloud = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3366d174"]]);
5
5
  export {
6
6
  AnimatedLogoCloud as default
7
7
  };