@ghatak/slash-ui 1.0.1 → 1.0.4
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/dist/.next/dev/types/validator.d.ts +1 -0
- package/dist/.next/dev/types/validator.js +44 -0
- package/dist/__registry__/index.d.ts +1 -0
- package/dist/__registry__/index.js +492 -0
- package/dist/app/(auth)/layout.d.ts +5 -0
- package/dist/app/(auth)/layout.js +8 -0
- package/dist/app/(auth)/login/page.d.ts +1 -0
- package/dist/app/(auth)/login/page.js +45 -0
- package/dist/app/(protected)/component/[id]/page.d.ts +5 -0
- package/dist/app/(protected)/component/[id]/page.js +13 -0
- package/dist/app/(protected)/component/page.d.ts +2 -0
- package/dist/app/(protected)/component/page.js +26 -0
- package/dist/app/(protected)/docs/page.d.ts +2 -0
- package/dist/app/(protected)/docs/page.js +43 -0
- package/dist/app/account/page.d.ts +1 -0
- package/dist/app/account/page.js +38 -0
- package/dist/app/api/me/route.d.ts +8 -0
- package/dist/app/api/me/route.js +20 -0
- package/dist/app/layout.d.ts +6 -0
- package/dist/app/layout.js +21 -0
- package/dist/app/page.d.ts +2 -0
- package/dist/app/page.js +11 -0
- package/dist/app/pricing/page.d.ts +2 -0
- package/dist/app/pricing/page.js +5 -0
- package/dist/bin/intex.d.ts +2 -0
- package/dist/bin/intex.js +14 -0
- package/dist/components/smooth-scroll.d.ts +4 -0
- package/dist/components/smooth-scroll.js +21 -0
- package/dist/components/toast.d.ts +11 -0
- package/dist/components/toast.js +39 -0
- package/dist/components/ui/IndustryProof.d.ts +1 -0
- package/dist/components/ui/IndustryProof.js +55 -0
- package/dist/components/ui/ShowcaseContainer.d.ts +8 -0
- package/dist/components/ui/ShowcaseContainer.js +139 -0
- package/dist/components/ui/dot-cursor.d.ts +2 -0
- package/dist/components/ui/dot-cursor.js +70 -0
- package/dist/components/ui/featuredComponents.d.ts +2 -0
- package/dist/components/ui/featuredComponents.js +14 -0
- package/dist/components/ui/footer.d.ts +2 -0
- package/dist/components/ui/footer.js +5 -0
- package/dist/components/ui/hero.d.ts +3 -0
- package/dist/components/ui/hero.js +21 -0
- package/dist/components/ui/navbar.d.ts +3 -0
- package/dist/components/ui/navbar.js +102 -0
- package/dist/components/ui/pricing.d.ts +2 -0
- package/dist/components/ui/pricing.js +26 -0
- package/dist/hooks/use-component-search.d.ts +5 -0
- package/dist/hooks/use-component-search.js +37 -0
- package/dist/lib/actions/auth.action.d.ts +8 -0
- package/dist/lib/actions/auth.action.js +66 -0
- package/dist/lib/auth.d.ts +1 -0
- package/dist/lib/auth.js +15 -0
- package/dist/lib/email.d.ts +1 -0
- package/dist/lib/email.js +42 -0
- package/dist/lib/prisma.d.ts +2 -0
- package/dist/lib/prisma.js +8 -0
- package/dist/lib/registry.d.ts +1 -0
- package/dist/lib/registry.js +16 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/dist/middleware/middleware.d.ts +5 -0
- package/dist/middleware/middleware.js +19 -0
- package/dist/next.config.d.ts +3 -0
- package/dist/next.config.js +4 -0
- package/dist/prisma.config.d.ts +3 -0
- package/dist/prisma.config.js +13 -0
- package/dist/registry/details/buttons/neubrutal-button-details.d.ts +2 -0
- package/dist/registry/details/buttons/neubrutal-button-details.js +25 -0
- package/dist/registry/details/cursor/dot-cursor-details.d.ts +2 -0
- package/dist/registry/details/cursor/dot-cursor-details.js +5 -0
- package/dist/registry/details/navbar/floating-navbar-details.d.ts +2 -0
- package/dist/registry/details/navbar/floating-navbar-details.js +5 -0
- package/dist/registry/details/scrollbars/minimal-scrollbar-details.d.ts +0 -0
- package/dist/registry/details/scrollbars/minimal-scrollbar-details.js +1 -0
- package/dist/registry/index.d.ts +7 -0
- package/dist/registry/index.js +31 -0
- package/dist/registry/ui/buttons/neubrutal-button.d.ts +6 -0
- package/dist/registry/ui/buttons/neubrutal-button.js +18 -0
- package/dist/registry/ui/cursors/dot-cursor.d.ts +2 -0
- package/dist/registry/ui/cursors/dot-cursor.js +70 -0
- package/dist/registry/ui/navbars/floating-navbar.d.ts +2 -0
- package/dist/registry/ui/navbars/floating-navbar.js +35 -0
- package/dist/registry/ui/scrollbars/minimal-scrollbar.d.ts +2 -0
- package/dist/registry/ui/scrollbars/minimal-scrollbar.js +171 -0
- package/dist/scripts/build-registry.d.ts +1 -0
- package/dist/scripts/build-registry.js +47 -0
- package/dist/src/commands/add.d.ts +1 -0
- package/dist/src/commands/add.js +34 -0
- package/dist/src/commands/init.d.ts +1 -0
- package/dist/src/commands/init.js +63 -0
- package/dist/src/commands/list.d.ts +1 -0
- package/dist/src/commands/list.js +37 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +28 -0
- package/dist/src/utils/get-pkg-manager.d.ts +1 -0
- package/dist/src/utils/get-pkg-manager.js +10 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +7 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// This file is generated automatically by Next.js
|
|
2
|
+
// Do not edit this file manually
|
|
3
|
+
// This file validates that all pages and layouts export the correct types
|
|
4
|
+
// Validate ../../../app/(auth)/login/page.tsx
|
|
5
|
+
{
|
|
6
|
+
const handler = {};
|
|
7
|
+
}
|
|
8
|
+
// Validate ../../../app/(protected)/component/[id]/page.tsx
|
|
9
|
+
{
|
|
10
|
+
const handler = {};
|
|
11
|
+
}
|
|
12
|
+
// Validate ../../../app/(protected)/component/page.tsx
|
|
13
|
+
{
|
|
14
|
+
const handler = {};
|
|
15
|
+
}
|
|
16
|
+
// Validate ../../../app/(protected)/docs/page.tsx
|
|
17
|
+
{
|
|
18
|
+
const handler = {};
|
|
19
|
+
}
|
|
20
|
+
// Validate ../../../app/account/page.tsx
|
|
21
|
+
{
|
|
22
|
+
const handler = {};
|
|
23
|
+
}
|
|
24
|
+
// Validate ../../../app/page.tsx
|
|
25
|
+
{
|
|
26
|
+
const handler = {};
|
|
27
|
+
}
|
|
28
|
+
// Validate ../../../app/pricing/page.tsx
|
|
29
|
+
{
|
|
30
|
+
const handler = {};
|
|
31
|
+
}
|
|
32
|
+
// Validate ../../../app/api/me/route.ts
|
|
33
|
+
{
|
|
34
|
+
const handler = {};
|
|
35
|
+
}
|
|
36
|
+
// Validate ../../../app/(auth)/layout.tsx
|
|
37
|
+
{
|
|
38
|
+
const handler = {};
|
|
39
|
+
}
|
|
40
|
+
// Validate ../../../app/layout.tsx
|
|
41
|
+
{
|
|
42
|
+
const handler = {};
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Index: Record<string, any>;
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is autogenerated by scripts/build-registry.ts
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export const Index = {
|
|
5
|
+
"default": {
|
|
6
|
+
"neubrutal-button": {
|
|
7
|
+
name: "neubrutal-button",
|
|
8
|
+
type: "ui",
|
|
9
|
+
component: React.lazy(() => import("../registry/ui/buttons/neubrutal-button")),
|
|
10
|
+
details: null,
|
|
11
|
+
files: ["ui/buttons/neubrutal-button.tsx"],
|
|
12
|
+
category: "buttons",
|
|
13
|
+
content: `import React from 'react';
|
|
14
|
+
import { cn } from '@/lib/utils';
|
|
15
|
+
|
|
16
|
+
interface NeubrutalButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 1. CHANGE THIS TO DEFAULT EXPORT
|
|
21
|
+
export default function NeubrutalButton({
|
|
22
|
+
children = 'Click Me!',
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: NeubrutalButtonProps) {
|
|
26
|
+
return (
|
|
27
|
+
<button
|
|
28
|
+
{...props}
|
|
29
|
+
className={cn(
|
|
30
|
+
'group relative w-[140px] h-[50px] bg-none outline-none border-none p-0 cursor-pointer active:translate-y-[2px] transition-transform',
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
<div className='absolute top-[14px] -left-[1px] w-[calc(100%+2px)] h-full bg-[#8c8c8c] rounded-[7mm] outline outline-2 outline-[#242622] -z-10' />
|
|
35
|
+
<div className='absolute top-[10px] left-0 w-full h-full bg-[#e5e5c7] rounded-[7mm] outline outline-2 outline-[#242622] -z-10'>
|
|
36
|
+
<div className='absolute bottom-0 left-[15%] w-[2px] h-[9px] bg-[#242622]' />
|
|
37
|
+
<div className='absolute bottom-0 left-[85%] w-[2px] h-[9px] bg-[#242622]' />
|
|
38
|
+
</div>
|
|
39
|
+
<div className='relative w-full h-full flex items-center justify-center bg-[#ffffee] rounded-[7mm] outline outline-2 outline-[#242622] text-[#242622] font-semibold text-base overflow-hidden transition-all duration-200 group-active:translate-y-[10px]'>
|
|
40
|
+
<div className='absolute top-0 -left-[20px] w-[15px] h-full bg-black/10 skew-x-[30deg] transition-all duration-300 group-active:left-[calc(100%+20px)]' />
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
43
|
+
</button>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
description: ``,
|
|
48
|
+
install: "npm install framer-motion lucide-react",
|
|
49
|
+
},
|
|
50
|
+
"dot-cursor": {
|
|
51
|
+
name: "dot-cursor",
|
|
52
|
+
type: "ui",
|
|
53
|
+
component: React.lazy(() => import("../registry/ui/cursors/dot-cursor")),
|
|
54
|
+
details: null,
|
|
55
|
+
files: ["ui/cursors/dot-cursor.tsx"],
|
|
56
|
+
category: "cursors",
|
|
57
|
+
content: `'use client';
|
|
58
|
+
|
|
59
|
+
import React, { useState, useEffect } from 'react';
|
|
60
|
+
|
|
61
|
+
const CustomCursor = () => {
|
|
62
|
+
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
63
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
64
|
+
const [isDarkBackground, setIsDarkBackground] = useState(false);
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
|
|
68
|
+
// document.body.style.cursor = 'none';
|
|
69
|
+
|
|
70
|
+
const updatePosition = (e: MouseEvent) => {
|
|
71
|
+
setPosition({ x: e.clientX, y: e.clientY });
|
|
72
|
+
|
|
73
|
+
const element = document.elementFromPoint(e.clientX, e.clientY);
|
|
74
|
+
if (element) {
|
|
75
|
+
const bgColor = window.getComputedStyle(element).backgroundColor;
|
|
76
|
+
const brightness = getBrightness(bgColor);
|
|
77
|
+
setIsDarkBackground(brightness < 128);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const handleMouseOver = (e: MouseEvent) => {
|
|
82
|
+
const target = e.target as HTMLElement;
|
|
83
|
+
if (
|
|
84
|
+
target.tagName === 'A' ||
|
|
85
|
+
target.tagName === 'BUTTON' ||
|
|
86
|
+
target.onclick !== null ||
|
|
87
|
+
window.getComputedStyle(target).cursor === 'pointer'
|
|
88
|
+
) {
|
|
89
|
+
setIsHovering(true);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const handleMouseOut = () => {
|
|
94
|
+
setIsHovering(false);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
window.addEventListener('mousemove', updatePosition);
|
|
98
|
+
document.addEventListener('mouseover', handleMouseOver);
|
|
99
|
+
document.addEventListener('mouseout', handleMouseOut);
|
|
100
|
+
|
|
101
|
+
return () => {
|
|
102
|
+
window.removeEventListener('mousemove', updatePosition);
|
|
103
|
+
document.removeEventListener('mouseover', handleMouseOver);
|
|
104
|
+
document.removeEventListener('mouseout', handleMouseOut);
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
};
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
110
|
+
const getBrightness = (color: string) => {
|
|
111
|
+
const rgb = color.match(/\d+/g);
|
|
112
|
+
if (!rgb) return 255;
|
|
113
|
+
const r = parseInt(rgb[0]);
|
|
114
|
+
const g = parseInt(rgb[1]);
|
|
115
|
+
const b = parseInt(rgb[2]);
|
|
116
|
+
return (r * 299 + g * 587 + b * 114) / 1000;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<div
|
|
121
|
+
style={{
|
|
122
|
+
cursor: 'none',
|
|
123
|
+
width: '100vw',
|
|
124
|
+
height: '100vh',
|
|
125
|
+
position: 'fixed',
|
|
126
|
+
top: 0,
|
|
127
|
+
left: 0,
|
|
128
|
+
pointerEvents: 'none'
|
|
129
|
+
}}>
|
|
130
|
+
|
|
131
|
+
<div
|
|
132
|
+
style={{
|
|
133
|
+
position: 'fixed',
|
|
134
|
+
left: \`\${position.x}px\`,
|
|
135
|
+
top: \`\${position.y}px\`,
|
|
136
|
+
pointerEvents: 'none',
|
|
137
|
+
transform: \`translate(-50%, -50%) scale(\${isHovering ? 1.5 : 1})\`,
|
|
138
|
+
transition: 'transform 0.2s ease',
|
|
139
|
+
zIndex: 9999,
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
<svg
|
|
143
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
144
|
+
width="24"
|
|
145
|
+
height="24"
|
|
146
|
+
viewBox="0 0 24 24"
|
|
147
|
+
style={{
|
|
148
|
+
display: 'block',
|
|
149
|
+
transition: 'all 0.2s ease',
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
<path
|
|
153
|
+
fill={isDarkBackground ? '#ffffff' : '#000000'}
|
|
154
|
+
stroke={isDarkBackground ? '#000000' : '#ffffff'}
|
|
155
|
+
strokeWidth="2"
|
|
156
|
+
d="M5.5 3.21V20.8c0 .45.54.67.85.35l4.86-4.86a.5.5 0 0 1 .35-.15h6.87a.5.5 0 0 0 .35-.85L6.35 2.85a.5.5 0 0 0-.85.35Z"
|
|
157
|
+
/>
|
|
158
|
+
</svg>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export default CustomCursor;`,
|
|
165
|
+
description: ``,
|
|
166
|
+
install: "npm install framer-motion",
|
|
167
|
+
},
|
|
168
|
+
"flaoting-navbar": {
|
|
169
|
+
name: "flaoting-navbar",
|
|
170
|
+
type: "ui",
|
|
171
|
+
component: React.lazy(() => import("../registry/ui/navbars/floating-navbar")),
|
|
172
|
+
details: null,
|
|
173
|
+
files: ["ui/navbars/floating-navbar.tsx"],
|
|
174
|
+
category: "navbars",
|
|
175
|
+
content: `'use client';
|
|
176
|
+
|
|
177
|
+
import React, { useState, useEffect } from 'react';
|
|
178
|
+
import Link from 'next/link';
|
|
179
|
+
import { motion, AnimatePresence } from 'framer-motion';
|
|
180
|
+
import { Sun, Moon } from 'lucide-react';
|
|
181
|
+
|
|
182
|
+
const Navbar = () => {
|
|
183
|
+
const [mounted, setMounted] = useState(false);
|
|
184
|
+
const [isDark, setIsDark] = useState(true);
|
|
185
|
+
const [scrolled, setScrolled] = useState(false);
|
|
186
|
+
|
|
187
|
+
useEffect(() => {
|
|
188
|
+
setMounted(true);
|
|
189
|
+
const handleScroll = () => setScrolled(window.scrollY > 20);
|
|
190
|
+
window.addEventListener('scroll', handleScroll);
|
|
191
|
+
return () => window.removeEventListener('scroll', handleScroll);
|
|
192
|
+
}, []);
|
|
193
|
+
|
|
194
|
+
const toggleTheme = () => {
|
|
195
|
+
setIsDark(!isDark);
|
|
196
|
+
document.documentElement.classList.toggle('dark');
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const navLinks = [
|
|
200
|
+
{ name: 'Archives', slug: 'work' },
|
|
201
|
+
{ name: 'Capabilities', slug: 'service' },
|
|
202
|
+
{ name: 'Ethos', slug: 'about' },
|
|
203
|
+
];
|
|
204
|
+
|
|
205
|
+
if (!mounted) return null;
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<nav className='fixed top-0 left-0 w-full z-[100] flex justify-center pt-6 px-6 pointer-events-none mt-10'>
|
|
209
|
+
<motion.div
|
|
210
|
+
initial={{ y: -100 }}
|
|
211
|
+
animate={{ y: 0 }}
|
|
212
|
+
className={\`
|
|
213
|
+
flex items-center justify-between px-6 transition-all duration-500 pointer-events-auto
|
|
214
|
+
\${
|
|
215
|
+
scrolled
|
|
216
|
+
? 'w-full md:w-[800px] h-14 bg-white/5 backdrop-blur-md border border-white/10 rounded-full shadow-2xl'
|
|
217
|
+
: 'w-full h-20 bg-transparent border-transparent'
|
|
218
|
+
}
|
|
219
|
+
\`}
|
|
220
|
+
>
|
|
221
|
+
<Link href='/' className='group flex items-center'>
|
|
222
|
+
<span className=' text-3xl uppercase tracking-wide font-bold'>
|
|
223
|
+
Renoh
|
|
224
|
+
</span>
|
|
225
|
+
</Link>
|
|
226
|
+
|
|
227
|
+
<div className='hidden md:flex items-center space-x-8'>
|
|
228
|
+
{navLinks.map((link) => (
|
|
229
|
+
<Link
|
|
230
|
+
key={link.slug}
|
|
231
|
+
href={\`/\${link.slug}\`}
|
|
232
|
+
className='text-[10px] font-plex uppercase tracking-[0.2em] text-zinc-400 hover:text-white transition-colors relative group'
|
|
233
|
+
>
|
|
234
|
+
{link.name}
|
|
235
|
+
<span className='absolute -bottom-1 left-0 w-0 h-px bg-white transition-all duration-500 group-hover:w-full' />
|
|
236
|
+
</Link>
|
|
237
|
+
))}
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<div className='flex items-center space-x-4'>
|
|
241
|
+
<button
|
|
242
|
+
onClick={toggleTheme}
|
|
243
|
+
className='p-2 hover:bg-white/10 rounded-full transition-colors text-white'
|
|
244
|
+
>
|
|
245
|
+
<AnimatePresence mode='wait'>
|
|
246
|
+
<motion.div
|
|
247
|
+
key={isDark ? 'dark' : 'light'}
|
|
248
|
+
initial={{ opacity: 0, rotate: -90 }}
|
|
249
|
+
animate={{ opacity: 1, rotate: 0 }}
|
|
250
|
+
exit={{ opacity: 0, rotate: 90 }}
|
|
251
|
+
transition={{ duration: 0.2 }}
|
|
252
|
+
>
|
|
253
|
+
{isDark ? <Sun size={16} /> : <Moon size={16} />}
|
|
254
|
+
</motion.div>
|
|
255
|
+
</AnimatePresence>
|
|
256
|
+
</button>
|
|
257
|
+
|
|
258
|
+
<Link href='/contact'>
|
|
259
|
+
<motion.div
|
|
260
|
+
whileHover={{ scale: 1.05 }}
|
|
261
|
+
whileTap={{ scale: 0.95 }}
|
|
262
|
+
className='px-4 py-2 bg-white text-black text-[10px] font-plex uppercase tracking-widest rounded-full'
|
|
263
|
+
>
|
|
264
|
+
Inquire
|
|
265
|
+
</motion.div>
|
|
266
|
+
</Link>
|
|
267
|
+
</div>
|
|
268
|
+
</motion.div>
|
|
269
|
+
</nav>
|
|
270
|
+
);
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export default Navbar;
|
|
274
|
+
`,
|
|
275
|
+
description: ``,
|
|
276
|
+
install: "npm install lucide-react framer-motion gsap",
|
|
277
|
+
},
|
|
278
|
+
"minimal-scrollbar": {
|
|
279
|
+
name: "minimal-scrollbar",
|
|
280
|
+
type: "ui",
|
|
281
|
+
component: React.lazy(() => import("../registry/ui/scrollbars/minimal-scrollbar")),
|
|
282
|
+
details: null,
|
|
283
|
+
files: ["ui/scrollbars/minimal-scrollbar.tsx"],
|
|
284
|
+
category: "scrollbars",
|
|
285
|
+
content: `'use client';
|
|
286
|
+
|
|
287
|
+
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
288
|
+
import { usePathname } from 'next/navigation';
|
|
289
|
+
|
|
290
|
+
const VisualScrollbar = () => {
|
|
291
|
+
const [thumbTop, setThumbTop] = useState(0);
|
|
292
|
+
const channelRef = useRef<HTMLDivElement>(null);
|
|
293
|
+
const thumbRef = useRef<HTMLDivElement>(null);
|
|
294
|
+
const tickingRef = useRef(false);
|
|
295
|
+
const measurementsRef = useRef({
|
|
296
|
+
height: 0,
|
|
297
|
+
thumbH: 0,
|
|
298
|
+
paddingTop: 0,
|
|
299
|
+
paddingBottom: 0,
|
|
300
|
+
available: 0,
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
// Hide scrollbar on contact page
|
|
304
|
+
const pathname = usePathname();
|
|
305
|
+
const shouldHide = pathname === '/contact';
|
|
306
|
+
|
|
307
|
+
const measure = useCallback(() => {
|
|
308
|
+
if (!channelRef.current || !thumbRef.current) return;
|
|
309
|
+
|
|
310
|
+
const chRect = channelRef.current.getBoundingClientRect();
|
|
311
|
+
const thumbRect = thumbRef.current.getBoundingClientRect();
|
|
312
|
+
const style = window.getComputedStyle(channelRef.current);
|
|
313
|
+
|
|
314
|
+
const height = chRect.height;
|
|
315
|
+
const thumbH = thumbRect.height;
|
|
316
|
+
const paddingTop = parseFloat(style.paddingTop) || 0;
|
|
317
|
+
const paddingBottom = parseFloat(style.paddingBottom) || 0;
|
|
318
|
+
const available = Math.max(
|
|
319
|
+
height - thumbH - (paddingTop + paddingBottom),
|
|
320
|
+
0
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
measurementsRef.current = {
|
|
324
|
+
height,
|
|
325
|
+
thumbH,
|
|
326
|
+
paddingTop,
|
|
327
|
+
paddingBottom,
|
|
328
|
+
available,
|
|
329
|
+
};
|
|
330
|
+
}, []);
|
|
331
|
+
|
|
332
|
+
const updateThumb = useCallback(() => {
|
|
333
|
+
const scrollTop = window.scrollY;
|
|
334
|
+
const scrollHeight = document.documentElement.scrollHeight;
|
|
335
|
+
const clientHeight = document.documentElement.clientHeight;
|
|
336
|
+
const maxScroll = Math.max(scrollHeight - clientHeight, 1);
|
|
337
|
+
const scrollPercent = Math.min(Math.max(scrollTop / maxScroll, 0), 1);
|
|
338
|
+
const topPx =
|
|
339
|
+
measurementsRef.current.paddingTop +
|
|
340
|
+
scrollPercent * measurementsRef.current.available;
|
|
341
|
+
|
|
342
|
+
setThumbTop(topPx);
|
|
343
|
+
}, []);
|
|
344
|
+
|
|
345
|
+
useEffect(() => {
|
|
346
|
+
const handleScroll = () => {
|
|
347
|
+
if (!tickingRef.current) {
|
|
348
|
+
tickingRef.current = true;
|
|
349
|
+
requestAnimationFrame(() => {
|
|
350
|
+
updateThumb();
|
|
351
|
+
tickingRef.current = false;
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
let resizeTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
357
|
+
const handleResize = () => {
|
|
358
|
+
if (resizeTimeout) clearTimeout(resizeTimeout);
|
|
359
|
+
resizeTimeout = setTimeout(() => {
|
|
360
|
+
measure();
|
|
361
|
+
updateThumb();
|
|
362
|
+
}, 150);
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
// Initial setup with small delay to ensure DOM is ready
|
|
366
|
+
const initTimeout = setTimeout(() => {
|
|
367
|
+
measure();
|
|
368
|
+
updateThumb();
|
|
369
|
+
}, 100);
|
|
370
|
+
|
|
371
|
+
window.addEventListener('scroll', handleScroll, { passive: true });
|
|
372
|
+
window.addEventListener('resize', handleResize, { passive: true });
|
|
373
|
+
|
|
374
|
+
return () => {
|
|
375
|
+
clearTimeout(initTimeout);
|
|
376
|
+
if (resizeTimeout) clearTimeout(resizeTimeout);
|
|
377
|
+
window.removeEventListener('scroll', handleScroll);
|
|
378
|
+
window.removeEventListener('resize', handleResize);
|
|
379
|
+
};
|
|
380
|
+
}, [measure, updateThumb]);
|
|
381
|
+
|
|
382
|
+
// Return null if on contact page
|
|
383
|
+
if (shouldHide) return null;
|
|
384
|
+
|
|
385
|
+
return (
|
|
386
|
+
<>
|
|
387
|
+
<style>{\`
|
|
388
|
+
:root {
|
|
389
|
+
--left-offset: 20px;
|
|
390
|
+
--track-h: 50vh;
|
|
391
|
+
--track-w: 3px;
|
|
392
|
+
--thumb-w: 2px;
|
|
393
|
+
--thumb-h: 50px;
|
|
394
|
+
--track-bg: #212121;
|
|
395
|
+
--channel-bg: rgba(255,255,255,0.15);
|
|
396
|
+
--thumb-gradient: linear-gradient(180deg,#ffffff,#d7d7d7);
|
|
397
|
+
--track-radius: 0px;
|
|
398
|
+
--thumb-radius: 0px;
|
|
399
|
+
--transition-speed: 1ms;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
* {
|
|
403
|
+
box-sizing: border-box;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
body {
|
|
407
|
+
background: #0a0a0a;
|
|
408
|
+
color: #e6e6e6;
|
|
409
|
+
margin: 0;
|
|
410
|
+
padding: 0;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.vs {
|
|
414
|
+
position: fixed;
|
|
415
|
+
left: var(--left-offset);
|
|
416
|
+
top: 50%;
|
|
417
|
+
transform: translateY(-50%);
|
|
418
|
+
width: var(--track-w);
|
|
419
|
+
height: var(--track-h);
|
|
420
|
+
background: var(--track-bg);
|
|
421
|
+
border-radius: var(--track-radius);
|
|
422
|
+
overflow: hidden;
|
|
423
|
+
box-shadow:
|
|
424
|
+
inset 0 1px 0 rgba(255,255,255,0.08),
|
|
425
|
+
0 10px 24px rgba(0,0,0,0.6);
|
|
426
|
+
backdrop-filter: blur(6px);
|
|
427
|
+
pointer-events: none;
|
|
428
|
+
z-index: 9999;
|
|
429
|
+
display: flex;
|
|
430
|
+
justify-content: center;
|
|
431
|
+
will-change: transform;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.vs__channel {
|
|
435
|
+
position: relative;
|
|
436
|
+
width: 100%;
|
|
437
|
+
height: 100%;
|
|
438
|
+
background: var(--channel-bg);
|
|
439
|
+
border-radius: var(--track-radius);
|
|
440
|
+
overflow: hidden;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.vs__thumb {
|
|
444
|
+
position: absolute;
|
|
445
|
+
left: 50%;
|
|
446
|
+
transform: translateX(-50%) translateZ(0);
|
|
447
|
+
width: var(--thumb-w);
|
|
448
|
+
height: var(--thumb-h);
|
|
449
|
+
border-radius: var(--thumb-radius);
|
|
450
|
+
background: var(--thumb-gradient);
|
|
451
|
+
box-shadow:
|
|
452
|
+
0 4px 14px rgba(0,0,0,0.6),
|
|
453
|
+
inset 0 1px 0 rgba(255,255,255,0.4);
|
|
454
|
+
will-change: top;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.vs:hover .vs__thumb {
|
|
458
|
+
transform: translateX(-50%) translateZ(0) scaleY(1.05);
|
|
459
|
+
transition: transform 180ms ease;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
@media (max-width:720px) {
|
|
463
|
+
:root {
|
|
464
|
+
--left-offset: 10px;
|
|
465
|
+
--thumb-h: 30px;
|
|
466
|
+
--track-w: 3px;
|
|
467
|
+
--track-h: 30vh;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
\`}</style>
|
|
471
|
+
|
|
472
|
+
{/* Visual Scrollbar */}
|
|
473
|
+
<div className='vs'>
|
|
474
|
+
<div className='vs__channel' ref={channelRef}>
|
|
475
|
+
<div
|
|
476
|
+
className='vs__thumb'
|
|
477
|
+
ref={thumbRef}
|
|
478
|
+
style={{ top: \`\${thumbTop}px\` }}
|
|
479
|
+
aria-hidden='true'
|
|
480
|
+
/>
|
|
481
|
+
</div>
|
|
482
|
+
</div>
|
|
483
|
+
</>
|
|
484
|
+
);
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
export default VisualScrollbar;`,
|
|
488
|
+
description: ``,
|
|
489
|
+
install: "",
|
|
490
|
+
},
|
|
491
|
+
}
|
|
492
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const layout = async ({ children }) => {
|
|
3
|
+
const isUserAuthenticated = false; // remove later
|
|
4
|
+
// const isUserAuthenticated = await isAuthenticated();
|
|
5
|
+
// if (!isUserAuthenticated) redirect('/sign-in');
|
|
6
|
+
return (_jsx("div", { className: 'auth-layout', children: children }));
|
|
7
|
+
};
|
|
8
|
+
export default layout;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function LoginPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowRight } from 'lucide-react';
|
|
4
|
+
import { useState, useCallback } from 'react';
|
|
5
|
+
import { sendOtp, verifyOtp } from '@/lib/actions/auth.action';
|
|
6
|
+
import { Toast } from '@/components/toast';
|
|
7
|
+
function useToast() {
|
|
8
|
+
const [toasts, setToasts] = useState([]);
|
|
9
|
+
const showToast = useCallback((message) => {
|
|
10
|
+
const id = Date.now();
|
|
11
|
+
setToasts((prev) => [...prev, { id, message }]);
|
|
12
|
+
}, []);
|
|
13
|
+
const removeToast = useCallback((id) => {
|
|
14
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
15
|
+
}, []);
|
|
16
|
+
return { toasts, showToast, removeToast };
|
|
17
|
+
}
|
|
18
|
+
export default function LoginPage() {
|
|
19
|
+
const [step, setStep] = useState('email');
|
|
20
|
+
const [email, setEmail] = useState('');
|
|
21
|
+
const [loading, setLoading] = useState(false);
|
|
22
|
+
const { toasts, showToast, removeToast } = useToast();
|
|
23
|
+
return (_jsxs("div", { className: 'min-h-screen flex flex-col items-center justify-center text-white px-4 font-sans selection:bg-zinc-800', children: [toasts.map((t) => (_jsx(Toast, { message: t.message, onClose: () => removeToast(t.id) }, t.id))), _jsx("div", { className: 'w-full max-w-2xl', children: step === 'email' ? (_jsxs("form", { onSubmit: async (e) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
setLoading(true);
|
|
26
|
+
const formData = new FormData();
|
|
27
|
+
formData.append('email', email);
|
|
28
|
+
await sendOtp(formData);
|
|
29
|
+
setLoading(false);
|
|
30
|
+
showToast('OTP sent to your email');
|
|
31
|
+
setStep('otp');
|
|
32
|
+
}, className: 'relative group', children: [_jsx("input", { type: 'email', autoFocus: true, required: true, disabled: loading, value: email, placeholder: 'you@example.com', onChange: (e) => setEmail(e.target.value), className: 'w-full bg-transparent text-xl md:text-5xl font-light py-4 outline-none border-b border-zinc-800 focus:border-zinc-400 transition-all duration-500 placeholder:text-zinc-800' }), loading ? (_jsx(Loader, { text: 'Sending' })) : (_jsx("button", { type: 'submit', className: 'absolute right-0 top-1/2 -translate-y-1/2 p-2 text-zinc-500 hover:text-white transition-colors', children: _jsx(ArrowRight, { size: 32, strokeWidth: 1.5 }) }))] })) : (
|
|
33
|
+
/* OTP STEP */
|
|
34
|
+
_jsxs("form", { onSubmit: async (e) => {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
setLoading(true);
|
|
37
|
+
const formData = new FormData(e.currentTarget);
|
|
38
|
+
formData.append('email', email);
|
|
39
|
+
await verifyOtp(formData);
|
|
40
|
+
}, className: 'space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-700', children: [_jsx("label", { htmlFor: 'otp', children: "Enter the 6-digit code sent to your email" }), _jsxs("div", { className: 'relative group', children: [_jsx("input", { type: 'text', name: 'otp', autoFocus: true, maxLength: 6, disabled: loading, placeholder: '000000', className: 'w-full bg-transparent text-xl md:text-5xl font-light py-4 outline-none border-b border-zinc-800 focus:border-zinc-400 transition-all text-center tracking-[1em] placeholder:text-zinc-900' }), loading ? (_jsx(Loader, { text: 'Verifying' })) : (_jsx("button", { type: 'submit', className: 'absolute right-0 top-1/2 -translate-y-1/2 p-2 text-zinc-500 hover:text-white transition-colors', children: _jsx(ArrowRight, { size: 32, strokeWidth: 1.5 }) }))] })] })) }), _jsx("footer", { className: 'fixed bottom-8 text-md text-zinc-600 uppercase font-hoshiko font-bold', children: "Slash/ui" })] }));
|
|
41
|
+
}
|
|
42
|
+
/* Loader Component */
|
|
43
|
+
function Loader({ text }) {
|
|
44
|
+
return (_jsxs("div", { className: 'absolute right-0 top-1/2 -translate-y-1/2 text-zinc-400 text-sm flex items-center gap-1', children: ["[", text, _jsxs("span", { className: 'flex', children: [_jsx("span", { className: 'animate-bounce', children: "." }), _jsx("span", { className: 'animate-bounce delay-150', children: "." }), _jsx("span", { className: 'animate-bounce delay-300', children: "." })] }), "]"] }));
|
|
45
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { Index } from '@/__registry__';
|
|
4
|
+
import ShowcaseContainer from '@/components/ui/ShowcaseContainer';
|
|
5
|
+
export default async function Page({ params, }) {
|
|
6
|
+
const { id } = await params;
|
|
7
|
+
const activeItem = Index['default'][id];
|
|
8
|
+
if (!activeItem) {
|
|
9
|
+
return _jsxs("div", { children: ["Component \"", id, "\" not found in __registry__/index.ts"] });
|
|
10
|
+
}
|
|
11
|
+
const SelectedComponent = activeItem === null || activeItem === void 0 ? void 0 : activeItem.component;
|
|
12
|
+
return (_jsx(ShowcaseContainer, { title: (activeItem === null || activeItem === void 0 ? void 0 : activeItem.name) || id, code: activeItem === null || activeItem === void 0 ? void 0 : activeItem.content, description: activeItem === null || activeItem === void 0 ? void 0 : activeItem.description, install: activeItem === null || activeItem === void 0 ? void 0 : activeItem.install, children: SelectedComponent ? (_jsx(Suspense, { fallback: _jsx("div", { className: 'flex items-center justify-center h-40', children: _jsx("div", { className: 'animate-spin rounded-full h-8 w-8 border-b-2 border-white' }) }), children: _jsx(SelectedComponent, {}) })) : (_jsxs("div", { className: 'flex flex-col items-center justify-center h-64 border border-dashed border-zinc-800 rounded-xl bg-zinc-950/50', children: [_jsxs("p", { className: 'text-zinc-500 font-mono text-xs uppercase tracking-widest', children: ["Component \"", id, "\" not found"] }), _jsx("span", { className: 'text-[10px] text-zinc-700 mt-2', children: "Check registry/index.ts and run build-registry.ts" })] })) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef, useState } from 'react';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
const ComponentCard = ({ title, author, videoSrc, children, span = '', }) => {
|
|
6
|
+
const videoRef = useRef(null);
|
|
7
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
8
|
+
const handleMouseEnter = () => {
|
|
9
|
+
setIsHovered(true);
|
|
10
|
+
if (videoRef.current) {
|
|
11
|
+
videoRef.current.play().catch(() => { });
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const handleMouseLeave = () => {
|
|
15
|
+
setIsHovered(false);
|
|
16
|
+
if (videoRef.current) {
|
|
17
|
+
videoRef.current.pause();
|
|
18
|
+
videoRef.current.currentTime = 0;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return (_jsxs("div", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, className: `group relative flex flex-col justify-between rounded-3xl bg-[#161616] border border-white/5 p-1 hover:border-white/20 transition-all duration-500 h-full ${span}`, children: [_jsx("div", { className: `absolute inset-0 transition-opacity duration-500 rounded-3xl bg-[radial-gradient(circle_at_50%_0%,rgba(255,255,255,0.05)_0%,transparent_70%)] ${isHovered ? 'opacity-100' : 'opacity-0'}` }), _jsx("div", { className: 'relative flex-grow overflow-hidden rounded-[22px] bg-[#0A0A0A] flex items-center justify-center min-h-[200px] cursor-pointer border border-white/[0.03]', children: videoSrc ? (_jsx("video", { ref: videoRef, src: videoSrc, loop: true, muted: true, playsInline: true, className: `absolute inset-0 w-full h-full object-cover transition-all duration-700 ${isHovered ? 'opacity-100 scale-105' : 'opacity-30 scale-100'}` })) : (_jsx("div", { className: 'relative z-10 w-full h-full flex items-center justify-center', children: children })) }), _jsxs("div", { className: 'px-4 py-3 flex justify-between items-center bg-transparent relative z-10', children: [_jsx("h3", { className: 'text-sm font-medium text-zinc-400 group-hover:text-white transition-colors', children: title }), _jsx("span", { className: 'text-[10px] text-zinc-600 font-mono italic', children: author || 'skiper' })] })] }));
|
|
22
|
+
};
|
|
23
|
+
const ComponentsPage = () => {
|
|
24
|
+
return (_jsx("div", { className: 'min-h-screen pt-32 pb-20 px-6', children: _jsx("div", { className: 'max-w-7xl mx-auto space-y-32', children: _jsxs("section", { children: [_jsxs("div", { className: 'mb-12', children: [_jsxs("h2", { className: 'text-white text-3xl font-bold flex items-center gap-3', children: ["Some Random Components", ' '] }), _jsx("p", { className: 'text-zinc-500 text-sm mt-2', children: "Collection of interactive components [Click to view]" })] }), _jsxs("div", { className: 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 auto-rows-[280px]', children: [_jsx(Link, { href: '/component/image-reveal', className: 'block', children: _jsx(ComponentCard, { title: 'Image reveal', author: 'skiper1', videoSrc: '/videos/reveal-demo.mp4' }) }), _jsx(Link, { href: '/component/hover-members', className: 'lg:col-span-2', children: _jsx(ComponentCard, { title: 'Hover members', author: 'skiper2', videoSrc: '/videos/members-demo.mp4' }) }), _jsx(Link, { href: '/component/drag-scroll', className: 'lg:row-span-2', children: _jsx(ComponentCard, { title: 'Things drag and scroll', author: 'skiper3', videoSrc: '/videos/drag-demo.mp4' }) }), _jsx(Link, { href: '/component/dynamic-island', className: 'block', children: _jsx(ComponentCard, { title: 'Dynamic island', author: 'skiper4' }) }), _jsx(Link, { href: '/component/devouring-details', className: 'lg:col-span-2', children: _jsx(ComponentCard, { title: 'Devouring details', author: 'skiper5', videoSrc: '/videos/details-demo.mp4' }) }), _jsx(Link, { href: '/component/scrollbar', className: 'block', children: _jsx(ComponentCard, { title: 'Anime js scrollbar', author: 'skiper6', videoSrc: '/videos/scrollbar.mp4' }) })] })] }) }) }));
|
|
25
|
+
};
|
|
26
|
+
export default ComponentsPage;
|