@windrun-huaiin/third-ui 29.2.1 → 30.1.0

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 (121) hide show
  1. package/dist/fuma/fuma-page-genarator.d.ts +2 -6
  2. package/dist/fuma/fuma-page-genarator.js +3 -2
  3. package/dist/fuma/fuma-page-genarator.mjs +3 -2
  4. package/dist/fuma/mdx/cheet-table.d.ts +13 -0
  5. package/dist/fuma/mdx/cheet-table.js +295 -0
  6. package/dist/fuma/mdx/cheet-table.mjs +293 -0
  7. package/dist/fuma/mdx/index.d.ts +1 -0
  8. package/dist/fuma/mdx/index.js +2 -0
  9. package/dist/fuma/mdx/index.mjs +1 -0
  10. package/dist/fuma/server/features/widgets.js +2 -0
  11. package/dist/fuma/server/features/widgets.mjs +2 -0
  12. package/dist/lib/fuma-schema-check-util.d.ts +1 -1
  13. package/dist/main/404-page.d.ts +12 -0
  14. package/dist/main/404-page.js +66 -0
  15. package/dist/main/404-page.mjs +64 -0
  16. package/dist/main/alert-dialog/confirm-dialog.js +1 -1
  17. package/dist/main/alert-dialog/confirm-dialog.mjs +2 -2
  18. package/dist/main/alert-dialog/dialog-loading-action.js +5 -2
  19. package/dist/main/alert-dialog/dialog-loading-action.mjs +5 -2
  20. package/dist/main/alert-dialog/dialog-styles.d.ts +4 -2
  21. package/dist/main/alert-dialog/dialog-styles.js +8 -4
  22. package/dist/main/alert-dialog/dialog-styles.mjs +7 -5
  23. package/dist/main/alert-dialog/high-priority-confirm-dialog.js +5 -5
  24. package/dist/main/alert-dialog/high-priority-confirm-dialog.mjs +6 -6
  25. package/dist/main/alert-dialog/info-dialog.js +1 -1
  26. package/dist/main/alert-dialog/info-dialog.mjs +2 -2
  27. package/dist/main/alert-dialog/undoable-confirm-dialog.js +2 -2
  28. package/dist/main/alert-dialog/undoable-confirm-dialog.mjs +3 -3
  29. package/dist/main/anime/anime-404-page.d.ts +14 -0
  30. package/dist/main/anime/anime-404-page.js +197 -0
  31. package/dist/main/anime/anime-404-page.mjs +195 -0
  32. package/dist/main/anime/anime-beam-frame.d.ts +3 -0
  33. package/dist/main/anime/anime-beam-frame.js +63 -0
  34. package/dist/main/anime/anime-beam-frame.mjs +61 -0
  35. package/dist/main/anime/anime-not-found-page.d.ts +7 -0
  36. package/dist/main/anime/anime-not-found-page.js +142 -0
  37. package/dist/main/anime/anime-not-found-page.mjs +140 -0
  38. package/dist/main/anime/anime-spiral-loading.d.ts +10 -0
  39. package/dist/main/anime/anime-spiral-loading.js +77 -0
  40. package/dist/main/anime/anime-spiral-loading.mjs +75 -0
  41. package/dist/main/anime/index.d.ts +3 -0
  42. package/dist/main/anime/index.js +12 -0
  43. package/dist/main/anime/index.mjs +4 -0
  44. package/dist/main/beam-frame/animate.d.ts +3 -0
  45. package/dist/main/beam-frame/animate.js +63 -0
  46. package/dist/main/beam-frame/animate.mjs +61 -0
  47. package/dist/main/beam-frame/beam-frame.d.ts +4 -0
  48. package/dist/main/beam-frame/beam-frame.js +262 -0
  49. package/dist/main/beam-frame/beam-frame.mjs +258 -0
  50. package/dist/main/beam-frame/index.d.ts +4 -0
  51. package/dist/main/beam-frame/index.js +11 -0
  52. package/dist/main/beam-frame/index.mjs +3 -0
  53. package/dist/main/beam-frame/motion.d.ts +3 -0
  54. package/dist/main/beam-frame/motion.js +61 -0
  55. package/dist/main/beam-frame/motion.mjs +59 -0
  56. package/dist/main/beam-frame/share-config.d.ts +54 -0
  57. package/dist/main/beam-frame/share-config.js +161 -0
  58. package/dist/main/beam-frame/share-config.mjs +152 -0
  59. package/dist/main/beam-frame-config.d.ts +54 -0
  60. package/dist/main/beam-frame-config.js +161 -0
  61. package/dist/main/beam-frame-config.mjs +152 -0
  62. package/dist/main/calendar/random-date-range-dialog.js +177 -51
  63. package/dist/main/calendar/random-date-range-dialog.mjs +178 -52
  64. package/dist/main/cta.js +17 -1
  65. package/dist/main/cta.mjs +18 -2
  66. package/dist/main/delayed-img.d.ts +1 -1
  67. package/dist/main/delayed-img.js +8 -5
  68. package/dist/main/delayed-img.mjs +8 -5
  69. package/dist/main/index.d.ts +1 -0
  70. package/dist/main/index.js +2 -0
  71. package/dist/main/index.mjs +1 -0
  72. package/dist/main/info-tooltip.js +70 -9
  73. package/dist/main/info-tooltip.mjs +70 -9
  74. package/dist/main/loading-frame/index.d.ts +1 -0
  75. package/dist/main/loading.d.ts +2 -1
  76. package/dist/main/loading.js +64 -26
  77. package/dist/main/loading.mjs +64 -26
  78. package/dist/main/motion/creative-left-panel.d.ts +7 -0
  79. package/dist/main/motion/creative-left-panel.js +11 -0
  80. package/dist/main/motion/creative-left-panel.mjs +9 -0
  81. package/dist/main/motion/creative-right-panel.d.ts +7 -0
  82. package/dist/main/motion/creative-right-panel.js +11 -0
  83. package/dist/main/motion/creative-right-panel.mjs +9 -0
  84. package/dist/main/motion/index.d.ts +1 -0
  85. package/dist/main/motion/index.js +9 -0
  86. package/dist/main/motion/index.mjs +2 -0
  87. package/dist/main/motion/motion-beam-frame.d.ts +3 -0
  88. package/dist/main/motion/motion-beam-frame.js +61 -0
  89. package/dist/main/motion/motion-beam-frame.mjs +59 -0
  90. package/dist/main/snake-loading-frame.d.ts +7 -3
  91. package/dist/main/snake-loading-frame.js +45 -252
  92. package/dist/main/snake-loading-frame.mjs +47 -254
  93. package/package.json +16 -5
  94. package/src/fuma/fuma-page-genarator.tsx +2 -22
  95. package/src/fuma/mdx/cheet-table.tsx +650 -0
  96. package/src/fuma/mdx/index.ts +1 -0
  97. package/src/fuma/server/features/widgets.tsx +2 -0
  98. package/src/main/404-page.tsx +162 -0
  99. package/src/main/alert-dialog/confirm-dialog.tsx +2 -1
  100. package/src/main/alert-dialog/dialog-loading-action.tsx +7 -5
  101. package/src/main/alert-dialog/dialog-styles.ts +13 -3
  102. package/src/main/alert-dialog/high-priority-confirm-dialog.tsx +26 -23
  103. package/src/main/alert-dialog/info-dialog.tsx +2 -1
  104. package/src/main/alert-dialog/undoable-confirm-dialog.tsx +18 -17
  105. package/src/main/anime/anime-404-page.tsx +344 -0
  106. package/src/main/anime/anime-beam-frame.tsx +128 -0
  107. package/src/main/anime/anime-spiral-loading.tsx +123 -0
  108. package/src/main/anime/index.ts +10 -0
  109. package/src/main/beam-frame-config.tsx +341 -0
  110. package/src/main/calendar/random-date-range-dialog.tsx +225 -69
  111. package/src/main/cta.tsx +50 -21
  112. package/src/main/delayed-img.tsx +9 -4
  113. package/src/main/index.ts +1 -0
  114. package/src/main/info-tooltip.tsx +116 -20
  115. package/src/main/loading-frame/index.ts +4 -0
  116. package/src/main/loading.tsx +75 -24
  117. package/src/main/motion/index.ts +8 -0
  118. package/src/main/motion/motion-beam-frame.tsx +137 -0
  119. package/src/main/snake-loading-frame.tsx +95 -496
  120. package/src/styles/cta.css +21 -4
  121. package/src/styles/third-ui.css +0 -20
@@ -0,0 +1,195 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { THEME_BUTTON_GRADIENT_CLASS_MAP, themeButtonGradientClass, themeSvgIconColor, themeIconColor, themeBgColor } from '@windrun-huaiin/base-ui/lib';
4
+ import { cn } from '@windrun-huaiin/lib/utils';
5
+ import { createTimeline, stagger, animate } from 'animejs';
6
+ import { useReducedMotion } from 'motion/react';
7
+ import { useRef, useMemo, useEffect, useCallback } from 'react';
8
+
9
+ const THEME_BG_CLASS_MAP = {
10
+ 'text-purple-500': 'bg-purple-500/20',
11
+ 'text-orange-500': 'bg-orange-500/20',
12
+ 'text-indigo-500': 'bg-indigo-500/20',
13
+ 'text-emerald-500': 'bg-emerald-500/20',
14
+ 'text-rose-500': 'bg-rose-500/20',
15
+ };
16
+ const dust = Array.from({ length: 10 }, (_, index) => ({
17
+ id: index,
18
+ left: `${12 + index * 8}%`,
19
+ top: `${18 + (index % 5) * 13}%`,
20
+ size: 3 + (index % 3),
21
+ }));
22
+ function AnimeNotFoundPage({ siteIcon, homeUrl = process.env.NEXT_PUBLIC_BASE_URL || '/', className, compact = false, themeClass, themeColor, ambientAnimated = true, doorOpen, onDoorOpenChange, }) {
23
+ const rootRef = useRef(null);
24
+ const timelineRef = useRef(null);
25
+ const shimmerRef = useRef(null);
26
+ const doorAnimationRef = useRef(null);
27
+ const lightAnimationRef = useRef(null);
28
+ const handleAnimationRef = useRef(null);
29
+ const messageAnimationRef = useRef(null);
30
+ const isDoorOpenRef = useRef(doorOpen !== null && doorOpen !== void 0 ? doorOpen : false);
31
+ const prefersReducedMotion = useReducedMotion();
32
+ const activeThemeClass = themeClass !== null && themeClass !== void 0 ? themeClass : themeIconColor;
33
+ const activeGradientClass = themeClass ? THEME_BUTTON_GRADIENT_CLASS_MAP[themeClass] : themeButtonGradientClass;
34
+ const activeBgClass = themeClass ? THEME_BG_CLASS_MAP[themeClass] : themeBgColor;
35
+ const doorStyle = useMemo(() => ({
36
+ '--not-found-theme': themeColor !== null && themeColor !== void 0 ? themeColor : themeSvgIconColor,
37
+ }), [themeColor]);
38
+ useEffect(() => {
39
+ var _a, _b;
40
+ const root = rootRef.current;
41
+ if (!root || prefersReducedMotion) {
42
+ return undefined;
43
+ }
44
+ const door = root.querySelector('[data-not-found-door]');
45
+ const light = root.querySelector('[data-not-found-light]');
46
+ const message = root.querySelector('[data-not-found-message]');
47
+ const plate = root.querySelector('[data-not-found-plate]');
48
+ const handle = root.querySelector('[data-not-found-handle]');
49
+ const dustNodes = Array.from(root.querySelectorAll('[data-not-found-dust]'));
50
+ if (!door || !light || !plate || !handle) {
51
+ return undefined;
52
+ }
53
+ door.style.transform = 'rotateY(-2deg) translateX(0)';
54
+ light.style.opacity = '0.2';
55
+ light.style.transform = 'scaleX(0.78)';
56
+ if (message) {
57
+ message.style.opacity = '0';
58
+ message.style.transform = 'translateY(8px)';
59
+ }
60
+ (_a = timelineRef.current) === null || _a === void 0 ? void 0 : _a.revert();
61
+ (_b = shimmerRef.current) === null || _b === void 0 ? void 0 : _b.revert();
62
+ timelineRef.current = null;
63
+ shimmerRef.current = null;
64
+ if (ambientAnimated) {
65
+ timelineRef.current = createTimeline({ loop: true })
66
+ .add(plate, {
67
+ translateY: [0, -3, 0],
68
+ scale: [1, 1.025, 1],
69
+ duration: 1400,
70
+ ease: 'inOutSine',
71
+ })
72
+ .add(plate, {
73
+ translateY: [0, -3, 0],
74
+ scale: [1, 1.025, 1],
75
+ duration: 1400,
76
+ ease: 'inOutSine',
77
+ }, '+=900')
78
+ .add(dustNodes, {
79
+ opacity: [0, 0.72, 0],
80
+ translateY: [14, -18],
81
+ translateX: (_target, index) => (index % 2 === 0 ? 10 : -10),
82
+ scale: [0.4, 1, 0.6],
83
+ duration: 1800,
84
+ delay: stagger(80),
85
+ ease: 'outSine',
86
+ }, '<+=200');
87
+ shimmerRef.current = animate(root.querySelectorAll('[data-not-found-shimmer]'), {
88
+ translateX: ['-120%', '120%'],
89
+ opacity: [0, 0.8, 0],
90
+ duration: 2400,
91
+ delay: stagger(160),
92
+ ease: 'inOutSine',
93
+ loop: true,
94
+ });
95
+ }
96
+ return () => {
97
+ var _a, _b, _c, _d, _e, _f;
98
+ (_a = timelineRef.current) === null || _a === void 0 ? void 0 : _a.revert();
99
+ timelineRef.current = null;
100
+ (_b = shimmerRef.current) === null || _b === void 0 ? void 0 : _b.revert();
101
+ shimmerRef.current = null;
102
+ (_c = doorAnimationRef.current) === null || _c === void 0 ? void 0 : _c.revert();
103
+ doorAnimationRef.current = null;
104
+ (_d = lightAnimationRef.current) === null || _d === void 0 ? void 0 : _d.revert();
105
+ lightAnimationRef.current = null;
106
+ (_e = handleAnimationRef.current) === null || _e === void 0 ? void 0 : _e.revert();
107
+ handleAnimationRef.current = null;
108
+ (_f = messageAnimationRef.current) === null || _f === void 0 ? void 0 : _f.revert();
109
+ messageAnimationRef.current = null;
110
+ };
111
+ }, [ambientAnimated, prefersReducedMotion]);
112
+ const setDoorOpen = useCallback((nextOpen) => {
113
+ var _a, _b, _c, _d;
114
+ const root = rootRef.current;
115
+ if (!root) {
116
+ return;
117
+ }
118
+ const door = root.querySelector('[data-not-found-door]');
119
+ const light = root.querySelector('[data-not-found-light]');
120
+ const handle = root.querySelector('[data-not-found-handle]');
121
+ const message = root.querySelector('[data-not-found-message]');
122
+ if (!door || !light || !handle) {
123
+ return;
124
+ }
125
+ isDoorOpenRef.current = nextOpen;
126
+ (_a = doorAnimationRef.current) === null || _a === void 0 ? void 0 : _a.pause();
127
+ (_b = lightAnimationRef.current) === null || _b === void 0 ? void 0 : _b.pause();
128
+ (_c = handleAnimationRef.current) === null || _c === void 0 ? void 0 : _c.pause();
129
+ (_d = messageAnimationRef.current) === null || _d === void 0 ? void 0 : _d.pause();
130
+ doorAnimationRef.current = null;
131
+ lightAnimationRef.current = null;
132
+ handleAnimationRef.current = null;
133
+ messageAnimationRef.current = null;
134
+ if (prefersReducedMotion) {
135
+ door.style.transform = nextOpen ? 'rotateY(-72deg) translateX(-12px)' : 'rotateY(-2deg) translateX(0)';
136
+ light.style.opacity = nextOpen ? '0.8' : '0.2';
137
+ light.style.transform = nextOpen ? 'scaleX(1.28)' : 'scaleX(0.78)';
138
+ if (message) {
139
+ message.style.opacity = nextOpen ? '1' : '0';
140
+ message.style.transform = nextOpen ? 'translateY(0)' : 'translateY(8px)';
141
+ }
142
+ return;
143
+ }
144
+ doorAnimationRef.current = animate(door, {
145
+ rotateY: nextOpen ? -72 : -2,
146
+ translateX: nextOpen ? -12 : 0,
147
+ duration: 1050,
148
+ ease: 'inOutCubic',
149
+ });
150
+ lightAnimationRef.current = animate(light, {
151
+ opacity: nextOpen ? 0.8 : 0.2,
152
+ scaleX: nextOpen ? 1.28 : 0.78,
153
+ duration: 1050,
154
+ ease: 'inOutSine',
155
+ });
156
+ handleAnimationRef.current = animate(handle, {
157
+ scale: [1, 1.05, 1],
158
+ duration: 520,
159
+ ease: 'inOutSine',
160
+ });
161
+ if (message) {
162
+ messageAnimationRef.current = animate(message, {
163
+ opacity: nextOpen ? [0, 1] : [1, 0],
164
+ translateY: nextOpen ? [10, 0] : [0, 4, 10],
165
+ scale: nextOpen ? [0.96, 1] : [1, 0.98],
166
+ duration: nextOpen ? 620 : 520,
167
+ delay: nextOpen ? 320 : 280,
168
+ ease: nextOpen ? 'outCubic' : 'inOutSine',
169
+ });
170
+ }
171
+ }, [prefersReducedMotion]);
172
+ useEffect(() => {
173
+ if (doorOpen === undefined || doorOpen === isDoorOpenRef.current) {
174
+ return;
175
+ }
176
+ setDoorOpen(doorOpen);
177
+ }, [doorOpen, setDoorOpen]);
178
+ const toggleDoor = () => {
179
+ const nextOpen = !isDoorOpenRef.current;
180
+ if (doorOpen !== undefined) {
181
+ onDoorOpenChange === null || onDoorOpenChange === void 0 ? void 0 : onDoorOpenChange(nextOpen);
182
+ return;
183
+ }
184
+ setDoorOpen(nextOpen);
185
+ onDoorOpenChange === null || onDoorOpenChange === void 0 ? void 0 : onDoorOpenChange(nextOpen);
186
+ };
187
+ return (jsxs("div", { ref: rootRef, className: cn('relative flex w-full items-center justify-center overflow-hidden px-4 py-8', compact ? 'h-full min-h-full' : 'min-h-dvh', className), style: doorStyle, children: [jsx("div", { className: "pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(circle_at_50%_20%,rgba(255,255,255,0.75),transparent_34%),linear-gradient(180deg,rgba(250,250,250,0.96),rgba(244,244,245,0.72))] dark:bg-[radial-gradient(circle_at_50%_20%,rgba(255,255,255,0.08),transparent_34%),linear-gradient(180deg,rgba(24,24,27,0.96),rgba(9,9,11,0.92))]" }), jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 -z-10 h-1/2 bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.05))] dark:bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.34))]" }), jsxs("div", { className: "flex w-full max-w-3xl flex-col items-center gap-5", children: [jsx("section", { className: "text-center", children: jsx("h3", { className: cn('whitespace-nowrap text-[clamp(2.15rem,8vw,3.4rem)] font-black leading-none tracking-normal bg-linear-to-r bg-clip-text text-transparent', activeGradientClass), children: "Page Not Found" }) }), jsx("section", { className: "flex w-full justify-center", children: jsxs("div", { className: "relative aspect-[0.78] w-full max-w-[270px] sm:max-w-[315px] md:max-w-[330px] perspective-distant", children: [jsx("div", { "data-not-found-light": "", className: "absolute left-[14%] top-[7%] h-[86%] w-[72%] rounded-[28px] bg-[radial-gradient(circle_at_50%_45%,rgba(255,255,255,0.96),color-mix(in_srgb,var(--not-found-theme)_42%,transparent)_42%,transparent_72%)] opacity-25 blur-xl" }), jsx("div", { className: "absolute inset-[4%] rounded-[32px] border border-black/10 bg-neutral-950/5 shadow-2xl shadow-black/10 dark:border-white/10 dark:bg-white/5" }), jsx("div", { className: "absolute inset-[8%] rounded-[26px] bg-[linear-gradient(180deg,rgba(255,255,255,0.88),rgba(228,228,231,0.86))] shadow-[inset_0_1px_0_rgba(255,255,255,0.85)] dark:bg-[linear-gradient(180deg,rgba(39,39,42,0.92),rgba(24,24,27,0.96))]" }), jsxs("p", { "data-not-found-message": "", className: "pointer-events-none absolute right-[16%] top-[29%] z-2 max-w-[46%] text-right text-sm font-medium leading-6 text-muted-foreground opacity-100", children: [jsx("span", { className: "block", children: "The page" }), jsx("span", { className: "block", children: "you're looking for" }), jsx("span", { className: "block", children: "doesn't exist" })] }), jsx("button", { type: "button", className: "absolute inset-[8%] z-1 rounded-[26px] outline-none focus-visible:ring-2 focus-visible:ring-(--not-found-theme)", "aria-label": "Toggle the 404 door", onClick: toggleDoor }), jsxs("div", { "data-not-found-door": "", className: "absolute inset-[8%] z-10 origin-left rounded-[26px] border border-black/10 bg-[linear-gradient(145deg,rgba(255,255,255,0.92),rgba(212,212,216,0.9))] shadow-2xl shadow-black/20 will-change-transform dark:border-white/10 dark:bg-[linear-gradient(145deg,rgba(63,63,70,0.96),rgba(24,24,27,0.98))]", children: [jsxs("div", { className: "absolute inset-4 overflow-hidden rounded-[20px]", children: [jsx("div", { "data-not-found-shimmer": "", className: "absolute inset-y-0 w-1/3 -skew-x-12 bg-white/35 blur-md dark:bg-white/12" }), jsxs("a", { href: homeUrl, className: "absolute inset-x-5 bottom-5 flex h-[39%] flex-col items-center justify-center gap-2 rounded-2xl border border-black/10 bg-white/25 text-sm text-muted-foreground transition-opacity hover:opacity-80 dark:border-white/10 dark:bg-white/5", children: [jsxs("span", { className: "inline-flex items-center gap-2", children: [siteIcon, jsx("span", { children: "Woops!" })] }), jsx("span", { className: cn('text-xs font-semibold underline underline-offset-4', activeThemeClass, 'decoration-current'), children: "Back to Homepage" })] })] }), jsxs("div", { "data-not-found-plate": "", className: "absolute left-1/2 top-[18%] flex h-[88px] w-[156px] -translate-x-1/2 items-center justify-center overflow-hidden rounded-2xl border border-black/10 bg-white/86 shadow-lg shadow-black/10 dark:border-white/10 dark:bg-black/30", children: [jsx("div", { "data-not-found-shimmer": "", className: "absolute inset-y-0 w-1/2 -skew-x-12 bg-white/60 blur-md dark:bg-white/15" }), jsx("span", { className: cn('relative text-5xl font-black tabular-nums bg-linear-to-r bg-clip-text text-transparent', activeGradientClass), children: "404" })] }), jsx("button", { type: "button", "data-not-found-handle": "", className: "group absolute right-[1%] top-[39%] z-10 flex size-12 items-center justify-center rounded-full outline-none ring-offset-2 transition-transform hover:scale-105 focus-visible:ring-2 focus-visible:ring-(--not-found-theme)", "aria-label": "Toggle the 404 door", onClick: toggleDoor, children: jsxs("span", { className: "relative grid h-8 w-6 place-items-center rounded-full border border-black/10 bg-white/50 shadow-inner shadow-black/10 backdrop-blur-sm transform-[rotateY(18deg)] dark:border-white/15 dark:bg-black/25", children: [jsx("span", { className: "absolute size-10 rounded-full bg-(--not-found-theme) opacity-0 blur-md transition-opacity duration-300 group-hover:opacity-25" }), jsx("span", { className: "relative grid size-4 place-items-center rounded-full border border-black/10 bg-(--not-found-theme) shadow-lg shadow-black/25 dark:border-white/15", children: jsx("span", { className: "absolute right-1 top-1 size-1 rounded-full bg-white/75" }) })] }) })] }), dust.map(dot => (jsx("span", { "data-not-found-dust": "", className: cn('absolute rounded-full opacity-0', activeBgClass), style: {
188
+ left: dot.left,
189
+ top: dot.top,
190
+ width: dot.size,
191
+ height: dot.size,
192
+ } }, dot.id)))] }) })] })] }));
193
+ }
194
+
195
+ export { AnimeNotFoundPage };
@@ -0,0 +1,3 @@
1
+ import { type BeamFrameProps } from '../beam-frame-config';
2
+ export type { BeamFrameProps, BeamFrameTone } from '../beam-frame-config';
3
+ export declare function AnimeBeamFrame(props: BeamFrameProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,63 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
6
+ var animejs = require('animejs');
7
+ var react = require('motion/react');
8
+ var beamFrameConfig = require('../beam-frame-config.js');
9
+
10
+ function AnimeBeamLayer({ isRunning, duration, radius, size, }) {
11
+ const aroundBeamRef = React.useRef(null);
12
+ const animationRef = React.useRef(null);
13
+ const hasStartedRef = React.useRef(false);
14
+ const auraGradientId = React.useId().replace(/:/g, '');
15
+ const softGlowFilterId = React.useId().replace(/:/g, '');
16
+ React.useEffect(() => {
17
+ var _a;
18
+ const node = aroundBeamRef.current;
19
+ if (!node) {
20
+ return undefined;
21
+ }
22
+ if (isRunning) {
23
+ hasStartedRef.current = true;
24
+ }
25
+ node.style.opacity = isRunning || hasStartedRef.current ? 'var(--beam-frame-beam-opacity)' : '0';
26
+ if (!isRunning) {
27
+ (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.pause();
28
+ return undefined;
29
+ }
30
+ if (animationRef.current) {
31
+ animationRef.current.speed = beamFrameConfig.BASE_DURATION_SECONDS / duration;
32
+ animationRef.current.play();
33
+ return undefined;
34
+ }
35
+ animationRef.current = animejs.waapi.animate(node, {
36
+ strokeDashoffset: [0, -1],
37
+ loop: true,
38
+ duration: beamFrameConfig.BASE_DURATION_SECONDS * 1000,
39
+ ease: 'linear',
40
+ });
41
+ animationRef.current.speed = beamFrameConfig.BASE_DURATION_SECONDS / duration;
42
+ return undefined;
43
+ }, [duration, isRunning]);
44
+ React.useEffect(() => {
45
+ return () => {
46
+ var _a;
47
+ (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.revert();
48
+ animationRef.current = null;
49
+ };
50
+ }, []);
51
+ return (jsxRuntime.jsx(beamFrameConfig.BeamSvgLayer, { beamRef: aroundBeamRef, auraGradientId: auraGradientId, softGlowFilterId: softGlowFilterId, radius: radius, size: size }));
52
+ }
53
+ function AnimeBeamFrame(props) {
54
+ const { children, active = false, interactive = true, tone = 'theme', duration = beamFrameConfig.BASE_DURATION_SECONDS, radius, className, } = props;
55
+ const prefersReducedMotion = react.useReducedMotion();
56
+ const { isRunning, interactionProps } = beamFrameConfig.useInteractiveRunning(active, interactive);
57
+ const shouldRun = isRunning && !prefersReducedMotion;
58
+ const normalizedDuration = beamFrameConfig.normalizeDuration(duration);
59
+ const { ref, size } = beamFrameConfig.useMeasuredFrameSize();
60
+ return (jsxRuntime.jsx(beamFrameConfig.BeamFrameShell, { active: active, interactive: interactive, tone: tone, duration: normalizedDuration, radius: radius, className: className, isRunning: shouldRun, interactionProps: interactionProps, rootRef: ref, renderBeam: () => (jsxRuntime.jsx(AnimeBeamLayer, { isRunning: shouldRun, duration: normalizedDuration, radius: radius, size: size })), children: children }));
61
+ }
62
+
63
+ exports.AnimeBeamFrame = AnimeBeamFrame;
@@ -0,0 +1,61 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { useRef, useId, useEffect } from 'react';
4
+ import { waapi } from 'animejs';
5
+ import { useReducedMotion } from 'motion/react';
6
+ import { BASE_DURATION_SECONDS, useInteractiveRunning, useMeasuredFrameSize, BeamFrameShell, normalizeDuration, BeamSvgLayer } from '../beam-frame-config.mjs';
7
+
8
+ function AnimeBeamLayer({ isRunning, duration, radius, size, }) {
9
+ const aroundBeamRef = useRef(null);
10
+ const animationRef = useRef(null);
11
+ const hasStartedRef = useRef(false);
12
+ const auraGradientId = useId().replace(/:/g, '');
13
+ const softGlowFilterId = useId().replace(/:/g, '');
14
+ useEffect(() => {
15
+ var _a;
16
+ const node = aroundBeamRef.current;
17
+ if (!node) {
18
+ return undefined;
19
+ }
20
+ if (isRunning) {
21
+ hasStartedRef.current = true;
22
+ }
23
+ node.style.opacity = isRunning || hasStartedRef.current ? 'var(--beam-frame-beam-opacity)' : '0';
24
+ if (!isRunning) {
25
+ (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.pause();
26
+ return undefined;
27
+ }
28
+ if (animationRef.current) {
29
+ animationRef.current.speed = BASE_DURATION_SECONDS / duration;
30
+ animationRef.current.play();
31
+ return undefined;
32
+ }
33
+ animationRef.current = waapi.animate(node, {
34
+ strokeDashoffset: [0, -1],
35
+ loop: true,
36
+ duration: BASE_DURATION_SECONDS * 1000,
37
+ ease: 'linear',
38
+ });
39
+ animationRef.current.speed = BASE_DURATION_SECONDS / duration;
40
+ return undefined;
41
+ }, [duration, isRunning]);
42
+ useEffect(() => {
43
+ return () => {
44
+ var _a;
45
+ (_a = animationRef.current) === null || _a === void 0 ? void 0 : _a.revert();
46
+ animationRef.current = null;
47
+ };
48
+ }, []);
49
+ return (jsx(BeamSvgLayer, { beamRef: aroundBeamRef, auraGradientId: auraGradientId, softGlowFilterId: softGlowFilterId, radius: radius, size: size }));
50
+ }
51
+ function AnimeBeamFrame(props) {
52
+ const { children, active = false, interactive = true, tone = 'theme', duration = BASE_DURATION_SECONDS, radius, className, } = props;
53
+ const prefersReducedMotion = useReducedMotion();
54
+ const { isRunning, interactionProps } = useInteractiveRunning(active, interactive);
55
+ const shouldRun = isRunning && !prefersReducedMotion;
56
+ const normalizedDuration = normalizeDuration(duration);
57
+ const { ref, size } = useMeasuredFrameSize();
58
+ return (jsx(BeamFrameShell, { active: active, interactive: interactive, tone: tone, duration: normalizedDuration, radius: radius, className: className, isRunning: shouldRun, interactionProps: interactionProps, rootRef: ref, renderBeam: () => (jsx(AnimeBeamLayer, { isRunning: shouldRun, duration: normalizedDuration, radius: radius, size: size })), children: children }));
59
+ }
60
+
61
+ export { AnimeBeamFrame };
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface AnimeNotFoundPageProps {
3
+ siteIcon: ReactNode;
4
+ homeUrl?: string;
5
+ className?: string;
6
+ }
7
+ export declare function AnimeNotFoundPage({ siteIcon, homeUrl, className, }: AnimeNotFoundPageProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,142 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var lib = require('@windrun-huaiin/base-ui/lib');
6
+ var utils = require('@windrun-huaiin/lib/utils');
7
+ var animejs = require('animejs');
8
+ var react = require('motion/react');
9
+ var React = require('react');
10
+
11
+ const dust = Array.from({ length: 10 }, (_, index) => ({
12
+ id: index,
13
+ left: `${12 + index * 8}%`,
14
+ top: `${18 + (index % 5) * 13}%`,
15
+ size: 3 + (index % 3),
16
+ }));
17
+ function AnimeNotFoundPage({ siteIcon, homeUrl = process.env.NEXT_PUBLIC_BASE_URL || '/', className, }) {
18
+ const rootRef = React.useRef(null);
19
+ const timelineRef = React.useRef(null);
20
+ const shimmerRef = React.useRef(null);
21
+ const doorAnimationRef = React.useRef(null);
22
+ const lightAnimationRef = React.useRef(null);
23
+ const handleAnimationRef = React.useRef(null);
24
+ const isDoorOpenRef = React.useRef(true);
25
+ const prefersReducedMotion = react.useReducedMotion();
26
+ const doorStyle = React.useMemo(() => ({
27
+ '--not-found-theme': lib.themeSvgIconColor,
28
+ }), []);
29
+ React.useEffect(() => {
30
+ var _a, _b;
31
+ const root = rootRef.current;
32
+ if (!root || prefersReducedMotion) {
33
+ return undefined;
34
+ }
35
+ const door = root.querySelector('[data-not-found-door]');
36
+ const light = root.querySelector('[data-not-found-light]');
37
+ const plate = root.querySelector('[data-not-found-plate]');
38
+ const handle = root.querySelector('[data-not-found-handle]');
39
+ const dustNodes = Array.from(root.querySelectorAll('[data-not-found-dust]'));
40
+ if (!door || !light || !plate || !handle) {
41
+ return undefined;
42
+ }
43
+ door.style.transform = 'rotateY(-46deg) translateX(-7px)';
44
+ light.style.opacity = '0.7';
45
+ light.style.transform = 'scaleX(1.12)';
46
+ (_a = timelineRef.current) === null || _a === void 0 ? void 0 : _a.revert();
47
+ timelineRef.current = animejs.createTimeline({ loop: true })
48
+ .add(plate, {
49
+ translateY: [0, -3, 0],
50
+ scale: [1, 1.025, 1],
51
+ duration: 1400,
52
+ ease: 'inOutSine',
53
+ })
54
+ .add(plate, {
55
+ translateY: [0, -3, 0],
56
+ scale: [1, 1.025, 1],
57
+ duration: 1400,
58
+ ease: 'inOutSine',
59
+ }, '+=900')
60
+ .add(dustNodes, {
61
+ opacity: [0, 0.72, 0],
62
+ translateY: [14, -18],
63
+ translateX: (_target, index) => (index % 2 === 0 ? 10 : -10),
64
+ scale: [0.4, 1, 0.6],
65
+ duration: 1800,
66
+ delay: animejs.stagger(80),
67
+ ease: 'outSine',
68
+ }, '<+=200');
69
+ (_b = shimmerRef.current) === null || _b === void 0 ? void 0 : _b.revert();
70
+ shimmerRef.current = animejs.animate(root.querySelectorAll('[data-not-found-shimmer]'), {
71
+ translateX: ['-120%', '120%'],
72
+ opacity: [0, 0.8, 0],
73
+ duration: 2400,
74
+ delay: animejs.stagger(160),
75
+ ease: 'inOutSine',
76
+ loop: true,
77
+ });
78
+ return () => {
79
+ var _a, _b, _c, _d, _e;
80
+ (_a = timelineRef.current) === null || _a === void 0 ? void 0 : _a.revert();
81
+ timelineRef.current = null;
82
+ (_b = shimmerRef.current) === null || _b === void 0 ? void 0 : _b.revert();
83
+ shimmerRef.current = null;
84
+ (_c = doorAnimationRef.current) === null || _c === void 0 ? void 0 : _c.revert();
85
+ doorAnimationRef.current = null;
86
+ (_d = lightAnimationRef.current) === null || _d === void 0 ? void 0 : _d.revert();
87
+ lightAnimationRef.current = null;
88
+ (_e = handleAnimationRef.current) === null || _e === void 0 ? void 0 : _e.revert();
89
+ handleAnimationRef.current = null;
90
+ };
91
+ }, [prefersReducedMotion]);
92
+ const toggleDoor = () => {
93
+ var _a, _b, _c;
94
+ const root = rootRef.current;
95
+ if (!root) {
96
+ return;
97
+ }
98
+ const door = root.querySelector('[data-not-found-door]');
99
+ const light = root.querySelector('[data-not-found-light]');
100
+ const handle = root.querySelector('[data-not-found-handle]');
101
+ if (!door || !light || !handle) {
102
+ return;
103
+ }
104
+ const nextOpen = !isDoorOpenRef.current;
105
+ isDoorOpenRef.current = nextOpen;
106
+ (_a = doorAnimationRef.current) === null || _a === void 0 ? void 0 : _a.revert();
107
+ (_b = lightAnimationRef.current) === null || _b === void 0 ? void 0 : _b.revert();
108
+ (_c = handleAnimationRef.current) === null || _c === void 0 ? void 0 : _c.revert();
109
+ if (prefersReducedMotion) {
110
+ door.style.transform = nextOpen ? 'rotateY(-56deg) translateX(-9px)' : 'rotateY(-2deg) translateX(0)';
111
+ light.style.opacity = nextOpen ? '0.76' : '0.2';
112
+ light.style.transform = nextOpen ? 'scaleX(1.18)' : 'scaleX(0.78)';
113
+ return;
114
+ }
115
+ doorAnimationRef.current = animejs.animate(door, {
116
+ rotateY: nextOpen ? -56 : -2,
117
+ translateX: nextOpen ? -9 : 0,
118
+ duration: 760,
119
+ ease: 'outCubic',
120
+ });
121
+ lightAnimationRef.current = animejs.animate(light, {
122
+ opacity: nextOpen ? 0.76 : 0.2,
123
+ scaleX: nextOpen ? 1.18 : 0.78,
124
+ duration: 760,
125
+ ease: 'outCubic',
126
+ });
127
+ handleAnimationRef.current = animejs.animate(handle, {
128
+ scale: [1, 1.22, 1],
129
+ rotate: nextOpen ? [0, 18, 0] : [0, -18, 0],
130
+ duration: 520,
131
+ ease: 'inOutSine',
132
+ });
133
+ };
134
+ return (jsxRuntime.jsxs("div", { ref: rootRef, className: utils.cn('relative flex min-h-dvh w-full items-center justify-center overflow-hidden px-4 py-8', className), style: doorStyle, children: [jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(circle_at_50%_20%,rgba(255,255,255,0.75),transparent_34%),linear-gradient(180deg,rgba(250,250,250,0.96),rgba(244,244,245,0.72))] dark:bg-[radial-gradient(circle_at_50%_20%,rgba(255,255,255,0.08),transparent_34%),linear-gradient(180deg,rgba(24,24,27,0.96),rgba(9,9,11,0.92))]" }), jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 -z-10 h-1/2 bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.05))] dark:bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.34))]" }), jsxRuntime.jsxs("div", { className: "grid w-full max-w-4xl items-center gap-4 md:grid-cols-[minmax(0,0.9fr)_minmax(280px,0.78fr)] md:gap-6", children: [jsxRuntime.jsxs("section", { className: "order-2 text-center md:order-1 md:text-left", children: [jsxRuntime.jsx("h3", { className: utils.cn('whitespace-nowrap text-[clamp(2.15rem,8vw,3.4rem)] font-black leading-none tracking-normal md:text-[clamp(2.6rem,4.5vw,4rem)] bg-linear-to-r bg-clip-text text-transparent', lib.themeButtonGradientClass), children: "Page Not Found" }), jsxRuntime.jsx("p", { className: "mx-auto mt-5 max-w-xl text-base leading-7 text-muted-foreground md:mx-0 md:text-lg", children: "The page you're looking for doesn't exist" }), jsxRuntime.jsx("a", { href: homeUrl, className: utils.cn('mt-4 inline-flex text-sm font-semibold underline underline-offset-4 transition-opacity hover:opacity-80', lib.themeIconColor, 'decoration-current'), children: "Back to Homepage" }), jsxRuntime.jsx("span", { className: utils.cn('mt-9 inline-flex size-2 rounded-full', lib.themeBgColor) })] }), jsxRuntime.jsx("section", { className: "order-1 flex justify-center md:order-2", children: jsxRuntime.jsxs("div", { className: "relative aspect-[0.78] w-full max-w-[270px] sm:max-w-[315px] md:max-w-[330px] [perspective:1200px]", children: [jsxRuntime.jsx("div", { "data-not-found-light": "", className: "absolute left-[14%] top-[7%] h-[86%] w-[72%] rounded-[28px] bg-[radial-gradient(circle_at_50%_45%,rgba(255,255,255,0.96),color-mix(in_srgb,var(--not-found-theme)_42%,transparent)_42%,transparent_72%)] opacity-25 blur-xl" }), jsxRuntime.jsx("div", { className: "absolute inset-[4%] rounded-[32px] border border-black/10 bg-neutral-950/5 shadow-2xl shadow-black/10 dark:border-white/10 dark:bg-white/5" }), jsxRuntime.jsx("div", { className: "absolute inset-[8%] rounded-[26px] bg-[linear-gradient(180deg,rgba(255,255,255,0.88),rgba(228,228,231,0.86))] shadow-[inset_0_1px_0_rgba(255,255,255,0.85)] dark:bg-[linear-gradient(180deg,rgba(39,39,42,0.92),rgba(24,24,27,0.96))]" }), jsxRuntime.jsxs("div", { "data-not-found-door": "", className: "absolute inset-[8%] origin-left rounded-[26px] border border-black/10 bg-[linear-gradient(145deg,rgba(255,255,255,0.92),rgba(212,212,216,0.9))] shadow-2xl shadow-black/20 will-change-transform dark:border-white/10 dark:bg-[linear-gradient(145deg,rgba(63,63,70,0.96),rgba(24,24,27,0.98))]", children: [jsxRuntime.jsxs("div", { className: "absolute inset-4 overflow-hidden rounded-[20px] border border-black/10 dark:border-white/10", children: [jsxRuntime.jsx("div", { "data-not-found-shimmer": "", className: "absolute inset-y-0 w-1/3 -skew-x-12 bg-white/35 blur-md dark:bg-white/12" }), jsxRuntime.jsx("div", { className: "absolute inset-x-5 top-5 h-[30%] rounded-2xl border border-black/10 bg-white/35 dark:border-white/10 dark:bg-white/5" }), jsxRuntime.jsxs("a", { href: homeUrl, className: "absolute inset-x-5 bottom-5 flex h-[39%] flex-col items-center justify-center gap-2 rounded-2xl border border-black/10 bg-white/25 text-sm text-muted-foreground transition-opacity hover:opacity-80 dark:border-white/10 dark:bg-white/5", children: [siteIcon, jsxRuntime.jsx("span", { children: "Woops!" })] })] }), jsxRuntime.jsxs("div", { "data-not-found-plate": "", className: "absolute left-1/2 top-[18%] flex h-[88px] w-[156px] -translate-x-1/2 items-center justify-center overflow-hidden rounded-2xl border border-black/10 bg-white/86 shadow-lg shadow-black/10 dark:border-white/10 dark:bg-black/30", children: [jsxRuntime.jsx("div", { "data-not-found-shimmer": "", className: "absolute inset-y-0 w-1/2 -skew-x-12 bg-white/60 blur-md dark:bg-white/15" }), jsxRuntime.jsx("span", { className: utils.cn('relative text-5xl font-black tabular-nums bg-linear-to-r bg-clip-text text-transparent', lib.themeButtonGradientClass), children: "404" })] }), jsxRuntime.jsx("button", { type: "button", "data-not-found-handle": "", className: "absolute right-[16%] top-1/2 z-10 size-6 rounded-full border border-black/10 bg-[var(--not-found-theme)] shadow-lg shadow-black/20 outline-none ring-offset-2 transition-transform hover:scale-110 focus-visible:ring-2 focus-visible:ring-[var(--not-found-theme)] dark:border-white/15", "aria-label": "Toggle the 404 door", onClick: toggleDoor })] }), dust.map(dot => (jsxRuntime.jsx("span", { "data-not-found-dust": "", className: "absolute rounded-full bg-[var(--not-found-theme)] opacity-0", style: {
135
+ left: dot.left,
136
+ top: dot.top,
137
+ width: dot.size,
138
+ height: dot.size,
139
+ } }, dot.id)))] }) })] })] }));
140
+ }
141
+
142
+ exports.AnimeNotFoundPage = AnimeNotFoundPage;
@@ -0,0 +1,140 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { themeSvgIconColor, themeButtonGradientClass, themeIconColor, themeBgColor } from '@windrun-huaiin/base-ui/lib';
4
+ import { cn } from '@windrun-huaiin/lib/utils';
5
+ import { createTimeline, stagger, animate } from 'animejs';
6
+ import { useReducedMotion } from 'motion/react';
7
+ import { useRef, useMemo, useEffect } from 'react';
8
+
9
+ const dust = Array.from({ length: 10 }, (_, index) => ({
10
+ id: index,
11
+ left: `${12 + index * 8}%`,
12
+ top: `${18 + (index % 5) * 13}%`,
13
+ size: 3 + (index % 3),
14
+ }));
15
+ function AnimeNotFoundPage({ siteIcon, homeUrl = process.env.NEXT_PUBLIC_BASE_URL || '/', className, }) {
16
+ const rootRef = useRef(null);
17
+ const timelineRef = useRef(null);
18
+ const shimmerRef = useRef(null);
19
+ const doorAnimationRef = useRef(null);
20
+ const lightAnimationRef = useRef(null);
21
+ const handleAnimationRef = useRef(null);
22
+ const isDoorOpenRef = useRef(true);
23
+ const prefersReducedMotion = useReducedMotion();
24
+ const doorStyle = useMemo(() => ({
25
+ '--not-found-theme': themeSvgIconColor,
26
+ }), []);
27
+ useEffect(() => {
28
+ var _a, _b;
29
+ const root = rootRef.current;
30
+ if (!root || prefersReducedMotion) {
31
+ return undefined;
32
+ }
33
+ const door = root.querySelector('[data-not-found-door]');
34
+ const light = root.querySelector('[data-not-found-light]');
35
+ const plate = root.querySelector('[data-not-found-plate]');
36
+ const handle = root.querySelector('[data-not-found-handle]');
37
+ const dustNodes = Array.from(root.querySelectorAll('[data-not-found-dust]'));
38
+ if (!door || !light || !plate || !handle) {
39
+ return undefined;
40
+ }
41
+ door.style.transform = 'rotateY(-46deg) translateX(-7px)';
42
+ light.style.opacity = '0.7';
43
+ light.style.transform = 'scaleX(1.12)';
44
+ (_a = timelineRef.current) === null || _a === void 0 ? void 0 : _a.revert();
45
+ timelineRef.current = createTimeline({ loop: true })
46
+ .add(plate, {
47
+ translateY: [0, -3, 0],
48
+ scale: [1, 1.025, 1],
49
+ duration: 1400,
50
+ ease: 'inOutSine',
51
+ })
52
+ .add(plate, {
53
+ translateY: [0, -3, 0],
54
+ scale: [1, 1.025, 1],
55
+ duration: 1400,
56
+ ease: 'inOutSine',
57
+ }, '+=900')
58
+ .add(dustNodes, {
59
+ opacity: [0, 0.72, 0],
60
+ translateY: [14, -18],
61
+ translateX: (_target, index) => (index % 2 === 0 ? 10 : -10),
62
+ scale: [0.4, 1, 0.6],
63
+ duration: 1800,
64
+ delay: stagger(80),
65
+ ease: 'outSine',
66
+ }, '<+=200');
67
+ (_b = shimmerRef.current) === null || _b === void 0 ? void 0 : _b.revert();
68
+ shimmerRef.current = animate(root.querySelectorAll('[data-not-found-shimmer]'), {
69
+ translateX: ['-120%', '120%'],
70
+ opacity: [0, 0.8, 0],
71
+ duration: 2400,
72
+ delay: stagger(160),
73
+ ease: 'inOutSine',
74
+ loop: true,
75
+ });
76
+ return () => {
77
+ var _a, _b, _c, _d, _e;
78
+ (_a = timelineRef.current) === null || _a === void 0 ? void 0 : _a.revert();
79
+ timelineRef.current = null;
80
+ (_b = shimmerRef.current) === null || _b === void 0 ? void 0 : _b.revert();
81
+ shimmerRef.current = null;
82
+ (_c = doorAnimationRef.current) === null || _c === void 0 ? void 0 : _c.revert();
83
+ doorAnimationRef.current = null;
84
+ (_d = lightAnimationRef.current) === null || _d === void 0 ? void 0 : _d.revert();
85
+ lightAnimationRef.current = null;
86
+ (_e = handleAnimationRef.current) === null || _e === void 0 ? void 0 : _e.revert();
87
+ handleAnimationRef.current = null;
88
+ };
89
+ }, [prefersReducedMotion]);
90
+ const toggleDoor = () => {
91
+ var _a, _b, _c;
92
+ const root = rootRef.current;
93
+ if (!root) {
94
+ return;
95
+ }
96
+ const door = root.querySelector('[data-not-found-door]');
97
+ const light = root.querySelector('[data-not-found-light]');
98
+ const handle = root.querySelector('[data-not-found-handle]');
99
+ if (!door || !light || !handle) {
100
+ return;
101
+ }
102
+ const nextOpen = !isDoorOpenRef.current;
103
+ isDoorOpenRef.current = nextOpen;
104
+ (_a = doorAnimationRef.current) === null || _a === void 0 ? void 0 : _a.revert();
105
+ (_b = lightAnimationRef.current) === null || _b === void 0 ? void 0 : _b.revert();
106
+ (_c = handleAnimationRef.current) === null || _c === void 0 ? void 0 : _c.revert();
107
+ if (prefersReducedMotion) {
108
+ door.style.transform = nextOpen ? 'rotateY(-56deg) translateX(-9px)' : 'rotateY(-2deg) translateX(0)';
109
+ light.style.opacity = nextOpen ? '0.76' : '0.2';
110
+ light.style.transform = nextOpen ? 'scaleX(1.18)' : 'scaleX(0.78)';
111
+ return;
112
+ }
113
+ doorAnimationRef.current = animate(door, {
114
+ rotateY: nextOpen ? -56 : -2,
115
+ translateX: nextOpen ? -9 : 0,
116
+ duration: 760,
117
+ ease: 'outCubic',
118
+ });
119
+ lightAnimationRef.current = animate(light, {
120
+ opacity: nextOpen ? 0.76 : 0.2,
121
+ scaleX: nextOpen ? 1.18 : 0.78,
122
+ duration: 760,
123
+ ease: 'outCubic',
124
+ });
125
+ handleAnimationRef.current = animate(handle, {
126
+ scale: [1, 1.22, 1],
127
+ rotate: nextOpen ? [0, 18, 0] : [0, -18, 0],
128
+ duration: 520,
129
+ ease: 'inOutSine',
130
+ });
131
+ };
132
+ return (jsxs("div", { ref: rootRef, className: cn('relative flex min-h-dvh w-full items-center justify-center overflow-hidden px-4 py-8', className), style: doorStyle, children: [jsx("div", { className: "pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(circle_at_50%_20%,rgba(255,255,255,0.75),transparent_34%),linear-gradient(180deg,rgba(250,250,250,0.96),rgba(244,244,245,0.72))] dark:bg-[radial-gradient(circle_at_50%_20%,rgba(255,255,255,0.08),transparent_34%),linear-gradient(180deg,rgba(24,24,27,0.96),rgba(9,9,11,0.92))]" }), jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 -z-10 h-1/2 bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.05))] dark:bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.34))]" }), jsxs("div", { className: "grid w-full max-w-4xl items-center gap-4 md:grid-cols-[minmax(0,0.9fr)_minmax(280px,0.78fr)] md:gap-6", children: [jsxs("section", { className: "order-2 text-center md:order-1 md:text-left", children: [jsx("h3", { className: cn('whitespace-nowrap text-[clamp(2.15rem,8vw,3.4rem)] font-black leading-none tracking-normal md:text-[clamp(2.6rem,4.5vw,4rem)] bg-linear-to-r bg-clip-text text-transparent', themeButtonGradientClass), children: "Page Not Found" }), jsx("p", { className: "mx-auto mt-5 max-w-xl text-base leading-7 text-muted-foreground md:mx-0 md:text-lg", children: "The page you're looking for doesn't exist" }), jsx("a", { href: homeUrl, className: cn('mt-4 inline-flex text-sm font-semibold underline underline-offset-4 transition-opacity hover:opacity-80', themeIconColor, 'decoration-current'), children: "Back to Homepage" }), jsx("span", { className: cn('mt-9 inline-flex size-2 rounded-full', themeBgColor) })] }), jsx("section", { className: "order-1 flex justify-center md:order-2", children: jsxs("div", { className: "relative aspect-[0.78] w-full max-w-[270px] sm:max-w-[315px] md:max-w-[330px] [perspective:1200px]", children: [jsx("div", { "data-not-found-light": "", className: "absolute left-[14%] top-[7%] h-[86%] w-[72%] rounded-[28px] bg-[radial-gradient(circle_at_50%_45%,rgba(255,255,255,0.96),color-mix(in_srgb,var(--not-found-theme)_42%,transparent)_42%,transparent_72%)] opacity-25 blur-xl" }), jsx("div", { className: "absolute inset-[4%] rounded-[32px] border border-black/10 bg-neutral-950/5 shadow-2xl shadow-black/10 dark:border-white/10 dark:bg-white/5" }), jsx("div", { className: "absolute inset-[8%] rounded-[26px] bg-[linear-gradient(180deg,rgba(255,255,255,0.88),rgba(228,228,231,0.86))] shadow-[inset_0_1px_0_rgba(255,255,255,0.85)] dark:bg-[linear-gradient(180deg,rgba(39,39,42,0.92),rgba(24,24,27,0.96))]" }), jsxs("div", { "data-not-found-door": "", className: "absolute inset-[8%] origin-left rounded-[26px] border border-black/10 bg-[linear-gradient(145deg,rgba(255,255,255,0.92),rgba(212,212,216,0.9))] shadow-2xl shadow-black/20 will-change-transform dark:border-white/10 dark:bg-[linear-gradient(145deg,rgba(63,63,70,0.96),rgba(24,24,27,0.98))]", children: [jsxs("div", { className: "absolute inset-4 overflow-hidden rounded-[20px] border border-black/10 dark:border-white/10", children: [jsx("div", { "data-not-found-shimmer": "", className: "absolute inset-y-0 w-1/3 -skew-x-12 bg-white/35 blur-md dark:bg-white/12" }), jsx("div", { className: "absolute inset-x-5 top-5 h-[30%] rounded-2xl border border-black/10 bg-white/35 dark:border-white/10 dark:bg-white/5" }), jsxs("a", { href: homeUrl, className: "absolute inset-x-5 bottom-5 flex h-[39%] flex-col items-center justify-center gap-2 rounded-2xl border border-black/10 bg-white/25 text-sm text-muted-foreground transition-opacity hover:opacity-80 dark:border-white/10 dark:bg-white/5", children: [siteIcon, jsx("span", { children: "Woops!" })] })] }), jsxs("div", { "data-not-found-plate": "", className: "absolute left-1/2 top-[18%] flex h-[88px] w-[156px] -translate-x-1/2 items-center justify-center overflow-hidden rounded-2xl border border-black/10 bg-white/86 shadow-lg shadow-black/10 dark:border-white/10 dark:bg-black/30", children: [jsx("div", { "data-not-found-shimmer": "", className: "absolute inset-y-0 w-1/2 -skew-x-12 bg-white/60 blur-md dark:bg-white/15" }), jsx("span", { className: cn('relative text-5xl font-black tabular-nums bg-linear-to-r bg-clip-text text-transparent', themeButtonGradientClass), children: "404" })] }), jsx("button", { type: "button", "data-not-found-handle": "", className: "absolute right-[16%] top-1/2 z-10 size-6 rounded-full border border-black/10 bg-[var(--not-found-theme)] shadow-lg shadow-black/20 outline-none ring-offset-2 transition-transform hover:scale-110 focus-visible:ring-2 focus-visible:ring-[var(--not-found-theme)] dark:border-white/15", "aria-label": "Toggle the 404 door", onClick: toggleDoor })] }), dust.map(dot => (jsx("span", { "data-not-found-dust": "", className: "absolute rounded-full bg-[var(--not-found-theme)] opacity-0", style: {
133
+ left: dot.left,
134
+ top: dot.top,
135
+ width: dot.size,
136
+ height: dot.size,
137
+ } }, dot.id)))] }) })] })] }));
138
+ }
139
+
140
+ export { AnimeNotFoundPage };
@@ -0,0 +1,10 @@
1
+ export interface AnimeSpiralLoadingProps {
2
+ className?: string;
3
+ dotCount?: number;
4
+ duration?: number;
5
+ distanceRem?: number;
6
+ dotSizeEm?: number;
7
+ fontSize?: number;
8
+ paused?: boolean;
9
+ }
10
+ export declare function AnimeSpiralLoading({ className, dotCount, duration, distanceRem, dotSizeEm, fontSize, paused, }: AnimeSpiralLoadingProps): import("react/jsx-runtime").JSX.Element;