@windrun-huaiin/base-ui 30.0.0 → 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.
package/README.md
CHANGED
|
@@ -134,7 +134,6 @@ MIT
|
|
|
134
134
|
- Full TypeScript support
|
|
135
135
|
|
|
136
136
|
### Base Components (components/)
|
|
137
|
-
- 404-page: 404 error page component
|
|
138
137
|
- cta: Call-to-Action component
|
|
139
138
|
- features: Feature showcase component
|
|
140
139
|
- footer: Footer component
|
|
@@ -153,16 +152,13 @@ MIT
|
|
|
153
152
|
## Usage Example
|
|
154
153
|
|
|
155
154
|
```tsx
|
|
156
|
-
import { Button,
|
|
155
|
+
import { Button, LanguageSwitcher } from '@windrun-huaiin/base-ui';
|
|
157
156
|
|
|
158
157
|
// Use UI components
|
|
159
158
|
<Button variant="default" size="lg">
|
|
160
159
|
Click me
|
|
161
160
|
</Button>
|
|
162
161
|
|
|
163
|
-
// Use base components
|
|
164
|
-
<NotFoundPage />
|
|
165
|
-
|
|
166
162
|
// Use language switcher component (need to pass in configuration)
|
|
167
163
|
<LanguageSwitcher
|
|
168
164
|
locales={['en', 'zh']}
|
|
@@ -199,4 +195,4 @@ pnpm type-check
|
|
|
199
195
|
- [Newspaper Template](https://newspaper-template.org/en)
|
|
200
196
|
- [breathing exercise](https://breathingexercise.net/en)
|
|
201
197
|
- [ai directory list](https://aidirectorylist.com/en)
|
|
202
|
-
- [reve image directory](https://reveimage.directory/en)
|
|
198
|
+
- [reve image directory](https://reveimage.directory/en)
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var _404Page = require('./404-page.js');
|
|
5
4
|
var languageSwitcher = require('./language-switcher.js');
|
|
6
5
|
var googleAnalyticsScript = require('./script/google-analytics-script.js');
|
|
7
6
|
var microsoftClarityScript = require('./script/microsoft-clarity-script.js');
|
|
@@ -9,7 +8,6 @@ var googleAnalyticsClient = require('./script/google-analytics-client.js');
|
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
exports.NotFoundPage = _404Page.NotFoundPage;
|
|
13
11
|
exports.LanguageSwitcher = languageSwitcher.LanguageSwitcher;
|
|
14
12
|
exports.GoogleAnalyticsScript = googleAnalyticsScript.GoogleAnalyticsScript;
|
|
15
13
|
exports.MicrosoftClarityScript = microsoftClarityScript.MicrosoftClarityScript;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { NotFoundPage } from './404-page.mjs';
|
|
3
2
|
export { LanguageSwitcher } from './language-switcher.mjs';
|
|
4
3
|
export { GoogleAnalyticsScript } from './script/google-analytics-script.mjs';
|
|
5
4
|
export { MicrosoftClarityScript } from './script/microsoft-clarity-script.mjs';
|
package/package.json
CHANGED
package/src/components/index.ts
CHANGED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { NotFoundIcon } from "@base-ui/components/global-icon";
|
|
4
|
-
import { useEffect, useState, type ReactNode } from "react";
|
|
5
|
-
import { themeBgColor, themeViaColor, themeButtonGradientClass } from "@base-ui/lib";
|
|
6
|
-
import { cn } from "@windrun-huaiin/lib/utils";
|
|
7
|
-
|
|
8
|
-
interface NotFoundPageProps {
|
|
9
|
-
siteIcon: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function NotFoundPage({ siteIcon }: NotFoundPageProps) {
|
|
13
|
-
const [glitchText, setGlitchText] = useState("404");
|
|
14
|
-
|
|
15
|
-
// glitch effect
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const glitchChars = ["4", "0", "4", "?", "#", "!", "*", "&", "%", "$"];
|
|
18
|
-
|
|
19
|
-
const interval = setInterval(() => {
|
|
20
|
-
// 80% probability to display "404", 20% probability to display random characters
|
|
21
|
-
if (Math.random() < 0.5) {
|
|
22
|
-
setGlitchText("404");
|
|
23
|
-
} else {
|
|
24
|
-
const randomChars = Array.from(
|
|
25
|
-
{ length: 3 },
|
|
26
|
-
() => glitchChars[Math.floor(Math.random() * glitchChars.length)]
|
|
27
|
-
).join("");
|
|
28
|
-
setGlitchText(randomChars);
|
|
29
|
-
}
|
|
30
|
-
}, 600); // every 1.5 seconds
|
|
31
|
-
|
|
32
|
-
return () => clearInterval(interval);
|
|
33
|
-
}, []);
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<div className="flex min-h-dvh w-full flex-col items-center justify-center px-4 py-8">
|
|
37
|
-
{/* main content area */}
|
|
38
|
-
<div className="text-center space-y-8 max-w-2xl">
|
|
39
|
-
{/* 404 number - glitch effect */}
|
|
40
|
-
<div className="relative flex justify-center">
|
|
41
|
-
<h1
|
|
42
|
-
className={cn("text-8xl md:text-9xl font-bold bg-linear-to-r bg-clip-text text-transparent select-none", themeButtonGradientClass)}
|
|
43
|
-
style={{
|
|
44
|
-
fontFamily: "Montserrat, monospace",
|
|
45
|
-
textShadow: "0 0 30px rgba(172, 98, 253, 0.3)",
|
|
46
|
-
letterSpacing: "0.1em",
|
|
47
|
-
}}
|
|
48
|
-
>
|
|
49
|
-
{glitchText}
|
|
50
|
-
</h1>
|
|
51
|
-
{/* scan line effect */}
|
|
52
|
-
<div className="absolute inset-0 pointer-events-none">
|
|
53
|
-
<div className={cn("h-full w-full bg-linear-to-b from-transparent to-transparent animate-pulse", themeViaColor)} />
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
|
|
57
|
-
{/* error message */}
|
|
58
|
-
<div className="space-y-4">
|
|
59
|
-
<h2 className="text-2xl md:text-3xl font-semibold text-foreground">
|
|
60
|
-
Page Not Found
|
|
61
|
-
</h2>
|
|
62
|
-
<p className="text-lg text-muted-foreground max-w-md mx-auto leading-relaxed">
|
|
63
|
-
The page you're looking for doesn't exist
|
|
64
|
-
</p>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
{/* decorative elements */}
|
|
68
|
-
<div className="flex justify-center items-center gap-8 pt-8 opacity-60">
|
|
69
|
-
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
70
|
-
{siteIcon}
|
|
71
|
-
<span>Woops!</span>
|
|
72
|
-
</div>
|
|
73
|
-
<div className={cn("w-2 h-2 rounded-full animate-ping", themeBgColor)} />
|
|
74
|
-
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
75
|
-
<NotFoundIcon />
|
|
76
|
-
<span>Error Code: 404</span>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
{/* background decoration */}
|
|
82
|
-
<div className="fixed inset-0 pointer-events-none overflow-hidden -z-10">
|
|
83
|
-
{/* grid background */}
|
|
84
|
-
<div
|
|
85
|
-
className="absolute inset-0 opacity-[0.02] dark:opacity-[0.05]"
|
|
86
|
-
style={{
|
|
87
|
-
backgroundImage: `
|
|
88
|
-
linear-gradient(rgba(172, 98, 253, 0.1) 1px, transparent 1px),
|
|
89
|
-
linear-gradient(90deg, rgba(172, 98, 253, 0.1) 1px, transparent 1px)
|
|
90
|
-
`,
|
|
91
|
-
backgroundSize: "50px 50px",
|
|
92
|
-
}}
|
|
93
|
-
/>
|
|
94
|
-
|
|
95
|
-
{/* floating particles */}
|
|
96
|
-
{Array.from({ length: 6 }).map((_, i) => (
|
|
97
|
-
<div
|
|
98
|
-
key={i}
|
|
99
|
-
className={cn("absolute w-2 h-2 rounded-full animate-bounce", themeBgColor)}
|
|
100
|
-
style={{
|
|
101
|
-
left: `${20 + i * 15}%`,
|
|
102
|
-
top: `${30 + (i % 3) * 20}%`,
|
|
103
|
-
animationDelay: `${i * 0.5}s`,
|
|
104
|
-
animationDuration: `${2 + i * 0.3}s`,
|
|
105
|
-
}}
|
|
106
|
-
/>
|
|
107
|
-
))}
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
);
|
|
111
|
-
}
|