@moltenagentic/human-elements 0.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/assets/molten-icon-lava.svg +20 -0
- package/assets/molten-icon.svg +1 -0
- package/dist/fonts/index.d.ts +41 -0
- package/dist/fonts/index.js +19 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/index.d.ts +149 -0
- package/dist/index.js +1000 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/index.css +2 -0
- package/dist/styles/tokens.css +65 -0
- package/dist/styles/utilities.css +558 -0
- package/package.json +68 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1000 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// src/components/TechGrid.tsx
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var GRID = 160;
|
|
6
|
+
var HALF = GRID / 2;
|
|
7
|
+
var ARM = 10;
|
|
8
|
+
var TONES = {
|
|
9
|
+
molten: {
|
|
10
|
+
line: "rgba(200,70,35,0.14)",
|
|
11
|
+
cross: "rgba(200,70,35,0.45)",
|
|
12
|
+
dot: "rgba(200,70,35,0.25)"
|
|
13
|
+
},
|
|
14
|
+
dark: {
|
|
15
|
+
line: "rgba(0,0,0,0.18)",
|
|
16
|
+
cross: "rgba(0,0,0,0.4)",
|
|
17
|
+
dot: "rgba(0,0,0,0.22)"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function TechGrid({
|
|
21
|
+
className = "",
|
|
22
|
+
zIndex = 3,
|
|
23
|
+
tone = "molten",
|
|
24
|
+
id = "",
|
|
25
|
+
style
|
|
26
|
+
}) {
|
|
27
|
+
const { line, cross, dot } = TONES[tone];
|
|
28
|
+
const gridId = `tech-grid${id ? `-${id}` : ""}`;
|
|
29
|
+
const crossId = `crosshairs${id ? `-${id}` : ""}`;
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
"svg",
|
|
32
|
+
{
|
|
33
|
+
className: `pointer-events-none ${className}`,
|
|
34
|
+
style: { zIndex, ...style },
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
37
|
+
/* @__PURE__ */ jsxs(
|
|
38
|
+
"pattern",
|
|
39
|
+
{
|
|
40
|
+
id: gridId,
|
|
41
|
+
width: GRID,
|
|
42
|
+
height: GRID,
|
|
43
|
+
patternUnits: "userSpaceOnUse",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx("line", { x1: "0", y1: "0", x2: GRID, y2: "0", stroke: line, strokeWidth: "0.5" }),
|
|
46
|
+
/* @__PURE__ */ jsx("line", { x1: "0", y1: "0", x2: "0", y2: GRID, stroke: line, strokeWidth: "0.5" }),
|
|
47
|
+
/* @__PURE__ */ jsx("circle", { cx: HALF, cy: 0, r: "1.5", fill: dot }),
|
|
48
|
+
/* @__PURE__ */ jsx("circle", { cx: 0, cy: HALF, r: "1.5", fill: dot }),
|
|
49
|
+
/* @__PURE__ */ jsx("circle", { cx: HALF, cy: HALF, r: "1.5", fill: dot })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsxs(
|
|
54
|
+
"pattern",
|
|
55
|
+
{
|
|
56
|
+
id: crossId,
|
|
57
|
+
width: GRID,
|
|
58
|
+
height: GRID,
|
|
59
|
+
patternUnits: "userSpaceOnUse",
|
|
60
|
+
patternTransform: `translate(${-HALF},${-HALF})`,
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
"line",
|
|
64
|
+
{
|
|
65
|
+
x1: HALF - ARM,
|
|
66
|
+
y1: HALF,
|
|
67
|
+
x2: HALF + ARM,
|
|
68
|
+
y2: HALF,
|
|
69
|
+
stroke: cross,
|
|
70
|
+
strokeWidth: "1"
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
"line",
|
|
75
|
+
{
|
|
76
|
+
x1: HALF,
|
|
77
|
+
y1: HALF - ARM,
|
|
78
|
+
x2: HALF,
|
|
79
|
+
y2: HALF + ARM,
|
|
80
|
+
stroke: cross,
|
|
81
|
+
strokeWidth: "1"
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${gridId})` }),
|
|
89
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${crossId})` })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// src/components/GridMesh.tsx
|
|
96
|
+
import { useEffect, useRef } from "react";
|
|
97
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
98
|
+
function GridMesh({
|
|
99
|
+
className = "",
|
|
100
|
+
opacity = 0.6,
|
|
101
|
+
gridSize = 50,
|
|
102
|
+
strokeColor = "rgba(255, 255, 255, 0.03)"
|
|
103
|
+
}) {
|
|
104
|
+
const canvasRef = useRef(null);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const canvas = canvasRef.current;
|
|
107
|
+
if (!canvas) return;
|
|
108
|
+
const ctx = canvas.getContext("2d");
|
|
109
|
+
if (!ctx) return;
|
|
110
|
+
let animationFrameId;
|
|
111
|
+
let time = 0;
|
|
112
|
+
const resize = () => {
|
|
113
|
+
canvas.width = window.innerWidth;
|
|
114
|
+
canvas.height = window.innerHeight;
|
|
115
|
+
};
|
|
116
|
+
resize();
|
|
117
|
+
window.addEventListener("resize", resize);
|
|
118
|
+
const draw = () => {
|
|
119
|
+
if (!ctx || !canvas) return;
|
|
120
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
121
|
+
const cols = Math.ceil(canvas.width / gridSize) + 1;
|
|
122
|
+
const rows = Math.ceil(canvas.height / gridSize) + 1;
|
|
123
|
+
time += 5e-3;
|
|
124
|
+
ctx.strokeStyle = strokeColor;
|
|
125
|
+
ctx.lineWidth = 1;
|
|
126
|
+
for (let i = 0; i < rows; i++) {
|
|
127
|
+
ctx.beginPath();
|
|
128
|
+
for (let j = 0; j < cols; j++) {
|
|
129
|
+
const x = j * gridSize;
|
|
130
|
+
const y = i * gridSize + Math.sin(time + j * 0.1) * 10 + Math.cos(time * 0.5 + i * 0.1) * 8;
|
|
131
|
+
if (j === 0) ctx.moveTo(x, y);
|
|
132
|
+
else ctx.lineTo(x, y);
|
|
133
|
+
}
|
|
134
|
+
ctx.stroke();
|
|
135
|
+
}
|
|
136
|
+
for (let j = 0; j < cols; j++) {
|
|
137
|
+
ctx.beginPath();
|
|
138
|
+
for (let i = 0; i < rows; i++) {
|
|
139
|
+
const x = j * gridSize + Math.sin(time + i * 0.1) * 10 + Math.cos(time * 0.7 + j * 0.1) * 8;
|
|
140
|
+
const y = i * gridSize;
|
|
141
|
+
if (i === 0) ctx.moveTo(x, y);
|
|
142
|
+
else ctx.lineTo(x, y);
|
|
143
|
+
}
|
|
144
|
+
ctx.stroke();
|
|
145
|
+
}
|
|
146
|
+
animationFrameId = requestAnimationFrame(draw);
|
|
147
|
+
};
|
|
148
|
+
draw();
|
|
149
|
+
return () => {
|
|
150
|
+
window.removeEventListener("resize", resize);
|
|
151
|
+
cancelAnimationFrame(animationFrameId);
|
|
152
|
+
};
|
|
153
|
+
}, [gridSize, strokeColor]);
|
|
154
|
+
return /* @__PURE__ */ jsx2(
|
|
155
|
+
"canvas",
|
|
156
|
+
{
|
|
157
|
+
ref: canvasRef,
|
|
158
|
+
className: `absolute inset-0 w-full h-full pointer-events-none ${className}`,
|
|
159
|
+
style: { opacity }
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// src/components/LavaScene.tsx
|
|
165
|
+
import { useRef as useRef2, useMemo, useEffect as useEffect2 } from "react";
|
|
166
|
+
import { Canvas, useFrame } from "@react-three/fiber";
|
|
167
|
+
import * as THREE from "three";
|
|
168
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
169
|
+
var noiseGLSL = (
|
|
170
|
+
/* glsl */
|
|
171
|
+
`
|
|
172
|
+
vec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}
|
|
173
|
+
vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}
|
|
174
|
+
vec4 permute(vec4 x){return mod289(((x*34.0)+10.0)*x);}
|
|
175
|
+
vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}
|
|
176
|
+
|
|
177
|
+
float snoise(vec3 v){
|
|
178
|
+
const vec2 C=vec2(1.0/6.0,1.0/3.0);
|
|
179
|
+
const vec4 D=vec4(0.0,0.5,1.0,2.0);
|
|
180
|
+
vec3 i=floor(v+dot(v,C.yyy));
|
|
181
|
+
vec3 x0=v-i+dot(i,C.xxx);
|
|
182
|
+
vec3 g=step(x0.yzx,x0.xyz);
|
|
183
|
+
vec3 l=1.0-g;
|
|
184
|
+
vec3 i1=min(g.xyz,l.zxy);
|
|
185
|
+
vec3 i2=max(g.xyz,l.zxy);
|
|
186
|
+
vec3 x1=x0-i1+C.xxx;
|
|
187
|
+
vec3 x2=x0-i2+C.yyy;
|
|
188
|
+
vec3 x3=x0-D.yyy;
|
|
189
|
+
i=mod289(i);
|
|
190
|
+
vec4 p=permute(permute(permute(
|
|
191
|
+
i.z+vec4(0.0,i1.z,i2.z,1.0))
|
|
192
|
+
+i.y+vec4(0.0,i1.y,i2.y,1.0))
|
|
193
|
+
+i.x+vec4(0.0,i1.x,i2.x,1.0));
|
|
194
|
+
float n_=0.142857142857;
|
|
195
|
+
vec3 ns=n_*D.wyz-D.xzx;
|
|
196
|
+
vec4 j=p-49.0*floor(p*ns.z*ns.z);
|
|
197
|
+
vec4 x_=floor(j*ns.z);
|
|
198
|
+
vec4 y_=floor(j-7.0*x_);
|
|
199
|
+
vec4 x=x_*ns.x+ns.yyyy;
|
|
200
|
+
vec4 y=y_*ns.x+ns.yyyy;
|
|
201
|
+
vec4 h=1.0-abs(x)-abs(y);
|
|
202
|
+
vec4 b0=vec4(x.xy,y.xy);
|
|
203
|
+
vec4 b1=vec4(x.zw,y.zw);
|
|
204
|
+
vec4 s0=floor(b0)*2.0+1.0;
|
|
205
|
+
vec4 s1=floor(b1)*2.0+1.0;
|
|
206
|
+
vec4 sh=-step(h,vec4(0.0));
|
|
207
|
+
vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;
|
|
208
|
+
vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;
|
|
209
|
+
vec3 p0=vec3(a0.xy,h.x);
|
|
210
|
+
vec3 p1=vec3(a0.zw,h.y);
|
|
211
|
+
vec3 p2=vec3(a1.xy,h.z);
|
|
212
|
+
vec3 p3=vec3(a1.zw,h.w);
|
|
213
|
+
vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));
|
|
214
|
+
p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;
|
|
215
|
+
vec4 m=max(0.5-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);
|
|
216
|
+
m=m*m;
|
|
217
|
+
return 105.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));
|
|
218
|
+
}
|
|
219
|
+
`
|
|
220
|
+
);
|
|
221
|
+
var vertexShader = (
|
|
222
|
+
/* glsl */
|
|
223
|
+
`
|
|
224
|
+
uniform float uTime;
|
|
225
|
+
${noiseGLSL}
|
|
226
|
+
varying float vDisplacement;
|
|
227
|
+
varying vec3 vNormal;
|
|
228
|
+
varying vec3 vWorldPosition;
|
|
229
|
+
|
|
230
|
+
void main() {
|
|
231
|
+
float n1 = snoise(position * 1.5 + uTime * 0.15) * 0.4;
|
|
232
|
+
float n2 = snoise(position * 3.0 + uTime * 0.3) * 0.2;
|
|
233
|
+
float n3 = snoise(position * 6.0 - uTime * 0.2) * 0.1;
|
|
234
|
+
float displacement = n1 + n2 + n3;
|
|
235
|
+
|
|
236
|
+
vec3 newPos = position + normal * displacement;
|
|
237
|
+
vDisplacement = displacement;
|
|
238
|
+
vNormal = normalize(normalMatrix * normal);
|
|
239
|
+
vWorldPosition = (modelMatrix * vec4(newPos, 1.0)).xyz;
|
|
240
|
+
|
|
241
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(newPos, 1.0);
|
|
242
|
+
}
|
|
243
|
+
`
|
|
244
|
+
);
|
|
245
|
+
var fragmentShader = (
|
|
246
|
+
/* glsl */
|
|
247
|
+
`
|
|
248
|
+
uniform float uTime;
|
|
249
|
+
varying float vDisplacement;
|
|
250
|
+
varying vec3 vNormal;
|
|
251
|
+
varying vec3 vWorldPosition;
|
|
252
|
+
|
|
253
|
+
void main() {
|
|
254
|
+
float d = smoothstep(-0.5, 0.7, vDisplacement);
|
|
255
|
+
|
|
256
|
+
vec3 c0 = vec3(0.337, 0.055, 0.141);
|
|
257
|
+
vec3 c1 = vec3(0.671, 0.106, 0.114);
|
|
258
|
+
vec3 c2 = vec3(0.855, 0.220, 0.086);
|
|
259
|
+
vec3 c3 = vec3(0.969, 0.500, 0.055);
|
|
260
|
+
vec3 c4 = vec3(0.984, 0.624, 0.051);
|
|
261
|
+
vec3 c5 = vec3(1.0, 0.95, 0.85);
|
|
262
|
+
|
|
263
|
+
vec3 color;
|
|
264
|
+
if (d < 0.15) color = mix(c0, c1, d / 0.15);
|
|
265
|
+
else if (d < 0.35) color = mix(c1, c2, (d - 0.15) / 0.2);
|
|
266
|
+
else if (d < 0.55) color = mix(c2, c3, (d - 0.35) / 0.2);
|
|
267
|
+
else if (d < 0.75) color = mix(c3, c4, (d - 0.55) / 0.2);
|
|
268
|
+
else color = mix(c4, c5, (d - 0.75) / 0.25);
|
|
269
|
+
|
|
270
|
+
vec3 viewDir = normalize(cameraPosition - vWorldPosition);
|
|
271
|
+
float fresnel = pow(1.0 - max(dot(vNormal, viewDir), 0.0), 3.0);
|
|
272
|
+
color += c4 * fresnel * 0.5;
|
|
273
|
+
|
|
274
|
+
color *= 1.0 + 0.06 * sin(uTime * 0.7);
|
|
275
|
+
|
|
276
|
+
gl_FragColor = vec4(color, 1.0);
|
|
277
|
+
}
|
|
278
|
+
`
|
|
279
|
+
);
|
|
280
|
+
function LavaSphere({ yOffset = 0.6 }) {
|
|
281
|
+
const meshRef = useRef2(null);
|
|
282
|
+
const matRef = useRef2(null);
|
|
283
|
+
const mouse = useRef2({ x: 0, y: 0 });
|
|
284
|
+
useEffect2(() => {
|
|
285
|
+
const onMove = (e) => {
|
|
286
|
+
mouse.current.x = (e.clientX / window.innerWidth - 0.5) * 2;
|
|
287
|
+
mouse.current.y = -(e.clientY / window.innerHeight - 0.5) * 2;
|
|
288
|
+
};
|
|
289
|
+
window.addEventListener("mousemove", onMove);
|
|
290
|
+
return () => window.removeEventListener("mousemove", onMove);
|
|
291
|
+
}, []);
|
|
292
|
+
const uniforms = useMemo(() => ({ uTime: { value: 0 } }), []);
|
|
293
|
+
useFrame(({ clock }) => {
|
|
294
|
+
if (matRef.current) matRef.current.uniforms.uTime.value = clock.elapsedTime;
|
|
295
|
+
if (meshRef.current) {
|
|
296
|
+
const m = meshRef.current;
|
|
297
|
+
m.rotation.x = THREE.MathUtils.lerp(m.rotation.x, mouse.current.y * 0.15, 0.02);
|
|
298
|
+
m.rotation.y = THREE.MathUtils.lerp(
|
|
299
|
+
m.rotation.y,
|
|
300
|
+
mouse.current.x * 0.25 + clock.elapsedTime * 0.06,
|
|
301
|
+
0.02
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
return /* @__PURE__ */ jsxs2("mesh", { ref: meshRef, position: [0, yOffset, 0], children: [
|
|
306
|
+
/* @__PURE__ */ jsx3("icosahedronGeometry", { args: [1.5, 64] }),
|
|
307
|
+
/* @__PURE__ */ jsx3(
|
|
308
|
+
"shaderMaterial",
|
|
309
|
+
{
|
|
310
|
+
ref: matRef,
|
|
311
|
+
vertexShader,
|
|
312
|
+
fragmentShader,
|
|
313
|
+
uniforms
|
|
314
|
+
}
|
|
315
|
+
)
|
|
316
|
+
] });
|
|
317
|
+
}
|
|
318
|
+
function EmberParticles() {
|
|
319
|
+
const ref = useRef2(null);
|
|
320
|
+
const count = 180;
|
|
321
|
+
const { positions, velocities } = useMemo(() => {
|
|
322
|
+
const pos = new Float32Array(count * 3);
|
|
323
|
+
const vel = new Float32Array(count * 3);
|
|
324
|
+
for (let i = 0; i < count; i++) {
|
|
325
|
+
const i3 = i * 3;
|
|
326
|
+
pos[i3] = (Math.random() - 0.5) * 10;
|
|
327
|
+
pos[i3 + 1] = Math.random() * 8 - 4;
|
|
328
|
+
pos[i3 + 2] = (Math.random() - 0.5) * 6;
|
|
329
|
+
vel[i3] = (Math.random() - 0.5) * 3e-3;
|
|
330
|
+
vel[i3 + 1] = Math.random() * 6e-3 + 2e-3;
|
|
331
|
+
vel[i3 + 2] = (Math.random() - 0.5) * 2e-3;
|
|
332
|
+
}
|
|
333
|
+
return { positions: pos, velocities: vel };
|
|
334
|
+
}, []);
|
|
335
|
+
const sizes = useMemo(() => {
|
|
336
|
+
const s = new Float32Array(count);
|
|
337
|
+
for (let i = 0; i < count; i++) s[i] = Math.random() * 0.04 + 0.01;
|
|
338
|
+
return s;
|
|
339
|
+
}, []);
|
|
340
|
+
useFrame(() => {
|
|
341
|
+
if (!ref.current) return;
|
|
342
|
+
const arr = ref.current.geometry.attributes.position.array;
|
|
343
|
+
for (let i = 0; i < count; i++) {
|
|
344
|
+
const i3 = i * 3;
|
|
345
|
+
arr[i3] += velocities[i3];
|
|
346
|
+
arr[i3 + 1] += velocities[i3 + 1];
|
|
347
|
+
arr[i3 + 2] += velocities[i3 + 2];
|
|
348
|
+
if (arr[i3 + 1] > 5) {
|
|
349
|
+
arr[i3] = (Math.random() - 0.5) * 10;
|
|
350
|
+
arr[i3 + 1] = -5;
|
|
351
|
+
arr[i3 + 2] = (Math.random() - 0.5) * 6;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
ref.current.geometry.attributes.position.needsUpdate = true;
|
|
355
|
+
});
|
|
356
|
+
return /* @__PURE__ */ jsxs2("points", { ref, children: [
|
|
357
|
+
/* @__PURE__ */ jsxs2("bufferGeometry", { children: [
|
|
358
|
+
/* @__PURE__ */ jsx3("bufferAttribute", { attach: "attributes-position", args: [positions, 3] }),
|
|
359
|
+
/* @__PURE__ */ jsx3("bufferAttribute", { attach: "attributes-size", args: [sizes, 1] })
|
|
360
|
+
] }),
|
|
361
|
+
/* @__PURE__ */ jsx3("pointsMaterial", { size: 0.035, color: "#fb9f0d", transparent: true, opacity: 0.5, sizeAttenuation: true })
|
|
362
|
+
] });
|
|
363
|
+
}
|
|
364
|
+
function LavaScene({ centered = false }) {
|
|
365
|
+
const yOffset = centered ? 0 : 0.6;
|
|
366
|
+
return /* @__PURE__ */ jsxs2(
|
|
367
|
+
Canvas,
|
|
368
|
+
{
|
|
369
|
+
camera: { position: [0, 0, 5], fov: 45 },
|
|
370
|
+
gl: { antialias: true, alpha: true },
|
|
371
|
+
style: { background: "transparent" },
|
|
372
|
+
children: [
|
|
373
|
+
/* @__PURE__ */ jsx3("ambientLight", { intensity: 0.08 }),
|
|
374
|
+
/* @__PURE__ */ jsx3("pointLight", { position: [5, 5, 5], intensity: 0.5, color: "#fb9f0d" }),
|
|
375
|
+
/* @__PURE__ */ jsx3("pointLight", { position: [-5, -3, 3], intensity: 0.3, color: "#ab1b1d" }),
|
|
376
|
+
/* @__PURE__ */ jsx3(LavaSphere, { yOffset }),
|
|
377
|
+
/* @__PURE__ */ jsx3(EmberParticles, {})
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// src/components/EmberField.tsx
|
|
384
|
+
import { useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
385
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
386
|
+
var COLORS = {
|
|
387
|
+
molten: [
|
|
388
|
+
[251, 159, 13],
|
|
389
|
+
[247, 128, 14],
|
|
390
|
+
[237, 99, 20],
|
|
391
|
+
[218, 56, 22]
|
|
392
|
+
],
|
|
393
|
+
dark: [
|
|
394
|
+
[0, 0, 0],
|
|
395
|
+
[20, 8, 2],
|
|
396
|
+
[40, 16, 4],
|
|
397
|
+
[10, 4, 1]
|
|
398
|
+
]
|
|
399
|
+
};
|
|
400
|
+
function randomColor(tone) {
|
|
401
|
+
const palette = COLORS[tone];
|
|
402
|
+
return [...palette[Math.floor(Math.random() * palette.length)]];
|
|
403
|
+
}
|
|
404
|
+
function createParticle(w, h, tone, fromBottom = false) {
|
|
405
|
+
return {
|
|
406
|
+
x: Math.random() * w,
|
|
407
|
+
y: fromBottom ? h + Math.random() * 40 : Math.random() * h,
|
|
408
|
+
vx: (Math.random() - 0.5) * 0.3,
|
|
409
|
+
vy: -(Math.random() * 0.6 + 0.2),
|
|
410
|
+
size: Math.random() * 2.5 + 0.8,
|
|
411
|
+
opacity: Math.random() * 0.5 + 0.2,
|
|
412
|
+
drift: (Math.random() - 0.5) * 2e-3
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
function EmberField({
|
|
416
|
+
tone = "molten",
|
|
417
|
+
count = 60,
|
|
418
|
+
className = "",
|
|
419
|
+
style
|
|
420
|
+
}) {
|
|
421
|
+
const canvasRef = useRef3(null);
|
|
422
|
+
useEffect3(() => {
|
|
423
|
+
const canvas = canvasRef.current;
|
|
424
|
+
if (!canvas) return;
|
|
425
|
+
const ctx = canvas.getContext("2d");
|
|
426
|
+
if (!ctx) return;
|
|
427
|
+
let animId;
|
|
428
|
+
let particles = [];
|
|
429
|
+
const resize = () => {
|
|
430
|
+
canvas.width = canvas.offsetWidth * window.devicePixelRatio;
|
|
431
|
+
canvas.height = canvas.offsetHeight * window.devicePixelRatio;
|
|
432
|
+
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
|
|
433
|
+
};
|
|
434
|
+
const init = () => {
|
|
435
|
+
resize();
|
|
436
|
+
const w = canvas.offsetWidth;
|
|
437
|
+
const h = canvas.offsetHeight;
|
|
438
|
+
particles = Array.from({ length: count }, () => ({
|
|
439
|
+
...createParticle(w, h, tone),
|
|
440
|
+
color: randomColor(tone)
|
|
441
|
+
}));
|
|
442
|
+
};
|
|
443
|
+
init();
|
|
444
|
+
window.addEventListener("resize", init);
|
|
445
|
+
const draw = () => {
|
|
446
|
+
const w = canvas.offsetWidth;
|
|
447
|
+
const h = canvas.offsetHeight;
|
|
448
|
+
ctx.clearRect(0, 0, w, h);
|
|
449
|
+
for (const p of particles) {
|
|
450
|
+
p.x += p.vx;
|
|
451
|
+
p.y += p.vy;
|
|
452
|
+
p.vx += p.drift;
|
|
453
|
+
if (p.y < -10 || p.x < -10 || p.x > w + 10) {
|
|
454
|
+
Object.assign(p, createParticle(w, h, tone, true));
|
|
455
|
+
p.color = randomColor(tone);
|
|
456
|
+
}
|
|
457
|
+
const [r, g, b] = p.color;
|
|
458
|
+
ctx.beginPath();
|
|
459
|
+
ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2);
|
|
460
|
+
ctx.fillStyle = `rgba(${r},${g},${b},${p.opacity})`;
|
|
461
|
+
ctx.fill();
|
|
462
|
+
}
|
|
463
|
+
animId = requestAnimationFrame(draw);
|
|
464
|
+
};
|
|
465
|
+
draw();
|
|
466
|
+
return () => {
|
|
467
|
+
window.removeEventListener("resize", init);
|
|
468
|
+
cancelAnimationFrame(animId);
|
|
469
|
+
};
|
|
470
|
+
}, [tone, count]);
|
|
471
|
+
return /* @__PURE__ */ jsx4(
|
|
472
|
+
"canvas",
|
|
473
|
+
{
|
|
474
|
+
ref: canvasRef,
|
|
475
|
+
className: `absolute inset-0 w-full h-full pointer-events-none ${className}`,
|
|
476
|
+
style
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// src/components/Vignette.tsx
|
|
482
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
483
|
+
function Vignette({ className = "", zIndex = 2 }) {
|
|
484
|
+
return /* @__PURE__ */ jsx5(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
className: `fixed inset-0 pointer-events-none vignette ${className}`,
|
|
488
|
+
style: { zIndex }
|
|
489
|
+
}
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// src/components/SphereGlow.tsx
|
|
494
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
495
|
+
function SphereGlow({ className = "", zIndex = 1 }) {
|
|
496
|
+
return /* @__PURE__ */ jsx6(
|
|
497
|
+
"div",
|
|
498
|
+
{
|
|
499
|
+
className: `fixed inset-0 pointer-events-none ${className}`,
|
|
500
|
+
style: { zIndex },
|
|
501
|
+
children: /* @__PURE__ */ jsx6("div", { className: "sphere-glow" })
|
|
502
|
+
}
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// src/components/MoltenButton.tsx
|
|
507
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
508
|
+
var sizeClasses = {
|
|
509
|
+
xs: "px-2.5 py-1 text-[10px]",
|
|
510
|
+
sm: "px-3 py-1.5 text-xs",
|
|
511
|
+
md: "px-4 py-2 text-sm",
|
|
512
|
+
lg: "px-8 py-4 text-sm"
|
|
513
|
+
};
|
|
514
|
+
var variantClasses = {
|
|
515
|
+
molten: "bg-black text-white hover:bg-zinc-900 rainbow-border-button",
|
|
516
|
+
outline: "bg-transparent border border-zinc-700 text-white hover:bg-zinc-800",
|
|
517
|
+
ghost: "bg-transparent text-white hover:bg-zinc-800/50"
|
|
518
|
+
};
|
|
519
|
+
function MoltenButton({
|
|
520
|
+
children,
|
|
521
|
+
href,
|
|
522
|
+
variant = "molten",
|
|
523
|
+
size = "sm",
|
|
524
|
+
fullWidth = false,
|
|
525
|
+
disabled = false,
|
|
526
|
+
className = "",
|
|
527
|
+
...props
|
|
528
|
+
}) {
|
|
529
|
+
const classes = [
|
|
530
|
+
"relative inline-flex items-center justify-center gap-1.5",
|
|
531
|
+
"rounded-lg font-medium transition-all cursor-pointer",
|
|
532
|
+
sizeClasses[size],
|
|
533
|
+
fullWidth ? "w-full" : "",
|
|
534
|
+
disabled ? "bg-zinc-800 text-zinc-500 cursor-not-allowed" : variantClasses[variant],
|
|
535
|
+
className
|
|
536
|
+
].filter(Boolean).join(" ");
|
|
537
|
+
if (href && !disabled) {
|
|
538
|
+
return /* @__PURE__ */ jsx7("a", { href, className: classes, children });
|
|
539
|
+
}
|
|
540
|
+
return /* @__PURE__ */ jsx7("button", { disabled, className: classes, ...props, children });
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// src/components/GlassCard.tsx
|
|
544
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
545
|
+
var variantClasses2 = {
|
|
546
|
+
default: "glass-card",
|
|
547
|
+
subtle: "glass-card-subtle",
|
|
548
|
+
minimal: "glass-card-minimal"
|
|
549
|
+
};
|
|
550
|
+
function GlassCard({
|
|
551
|
+
children,
|
|
552
|
+
variant = "default",
|
|
553
|
+
glow = false,
|
|
554
|
+
wave = false,
|
|
555
|
+
cornerFrame = false,
|
|
556
|
+
className = "",
|
|
557
|
+
...props
|
|
558
|
+
}) {
|
|
559
|
+
const classes = [
|
|
560
|
+
variantClasses2[variant],
|
|
561
|
+
"rounded-2xl",
|
|
562
|
+
glow ? "molten-card-glow" : "",
|
|
563
|
+
wave ? "molten-wave-card" : "",
|
|
564
|
+
cornerFrame ? "corner-frame" : "",
|
|
565
|
+
className
|
|
566
|
+
].filter(Boolean).join(" ");
|
|
567
|
+
return /* @__PURE__ */ jsx8("div", { className: classes, ...props, children });
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// src/components/MoltenText.tsx
|
|
571
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
572
|
+
function MoltenText({
|
|
573
|
+
children,
|
|
574
|
+
as: Tag = "span",
|
|
575
|
+
animated = false,
|
|
576
|
+
className = "",
|
|
577
|
+
...props
|
|
578
|
+
}) {
|
|
579
|
+
const classes = [
|
|
580
|
+
animated ? "rainbow-text-animated" : "molten-text",
|
|
581
|
+
className
|
|
582
|
+
].filter(Boolean).join(" ");
|
|
583
|
+
return /* @__PURE__ */ jsx9(Tag, { className: classes, ...props, children });
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// src/components/Page.tsx
|
|
587
|
+
import { useEffect as useEffect4, useState } from "react";
|
|
588
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
589
|
+
function Page({
|
|
590
|
+
children,
|
|
591
|
+
ptMobile = 20,
|
|
592
|
+
ptDesktop = 24,
|
|
593
|
+
pb = 6,
|
|
594
|
+
px = 6,
|
|
595
|
+
maxWidth = "max-w-6xl",
|
|
596
|
+
centered = true,
|
|
597
|
+
showGrid = true,
|
|
598
|
+
nav,
|
|
599
|
+
overlay
|
|
600
|
+
}) {
|
|
601
|
+
const [isDesktop, setIsDesktop] = useState(false);
|
|
602
|
+
useEffect4(() => {
|
|
603
|
+
const handleResize = () => setIsDesktop(window.innerWidth >= 1024);
|
|
604
|
+
handleResize();
|
|
605
|
+
window.addEventListener("resize", handleResize);
|
|
606
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
607
|
+
}, []);
|
|
608
|
+
const toRem = (units) => `${units * 4 / 16}rem`;
|
|
609
|
+
const paddingTop = isDesktop ? toRem(ptDesktop) : toRem(ptMobile);
|
|
610
|
+
return /* @__PURE__ */ jsxs3("main", { className: "relative min-h-screen bg-black overflow-hidden", children: [
|
|
611
|
+
showGrid && /* @__PURE__ */ jsx10("div", { className: "fixed inset-0 z-0", children: /* @__PURE__ */ jsx10(GridMesh, {}) }),
|
|
612
|
+
/* @__PURE__ */ jsxs3("div", { className: "relative z-10", children: [
|
|
613
|
+
nav,
|
|
614
|
+
/* @__PURE__ */ jsx10(
|
|
615
|
+
"div",
|
|
616
|
+
{
|
|
617
|
+
style: {
|
|
618
|
+
paddingTop,
|
|
619
|
+
paddingBottom: toRem(pb),
|
|
620
|
+
paddingLeft: toRem(px),
|
|
621
|
+
paddingRight: toRem(px)
|
|
622
|
+
},
|
|
623
|
+
className: `min-h-screen ${centered ? "flex flex-col justify-center" : ""}`,
|
|
624
|
+
children: /* @__PURE__ */ jsx10("div", { className: `${maxWidth} mx-auto w-full`, children })
|
|
625
|
+
}
|
|
626
|
+
)
|
|
627
|
+
] }),
|
|
628
|
+
overlay,
|
|
629
|
+
/* @__PURE__ */ jsx10("div", { className: "fixed inset-0 pointer-events-none bg-gradient-radial from-transparent via-transparent to-black/40" })
|
|
630
|
+
] });
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// src/components/ProductNav.tsx
|
|
634
|
+
import { useState as useState2, useRef as useRef4, useEffect as useEffect5, useCallback, forwardRef } from "react";
|
|
635
|
+
import gsap from "gsap";
|
|
636
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
637
|
+
var BTN_SIZE = 40;
|
|
638
|
+
var BTN_BG = "rgba(24, 24, 27, 0.9)";
|
|
639
|
+
function NavIconButton({
|
|
640
|
+
children,
|
|
641
|
+
onClick,
|
|
642
|
+
className = ""
|
|
643
|
+
}) {
|
|
644
|
+
return /* @__PURE__ */ jsx11(
|
|
645
|
+
"button",
|
|
646
|
+
{
|
|
647
|
+
onClick,
|
|
648
|
+
className: `relative flex items-center justify-center rounded-xl transition-all cursor-pointer rainbow-border-button text-white ${className}`,
|
|
649
|
+
style: {
|
|
650
|
+
width: BTN_SIZE,
|
|
651
|
+
height: Math.round(BTN_SIZE * 1.1),
|
|
652
|
+
background: BTN_BG,
|
|
653
|
+
backdropFilter: "blur(24px)"
|
|
654
|
+
},
|
|
655
|
+
children
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
var ExpandedMenu = forwardRef(
|
|
660
|
+
({ menuGroups, xUrl, communityLabel, onClose }, ref) => {
|
|
661
|
+
const colCount = menuGroups.length + 1;
|
|
662
|
+
return /* @__PURE__ */ jsx11(
|
|
663
|
+
"div",
|
|
664
|
+
{
|
|
665
|
+
ref,
|
|
666
|
+
className: "fixed top-0 left-0 right-0 backdrop-blur-xl",
|
|
667
|
+
style: { transform: "translateY(-100%)", visibility: "hidden", zIndex: 40, background: "rgba(0, 0, 0, 0.95)" },
|
|
668
|
+
children: /* @__PURE__ */ jsx11("div", { className: "menu-content p-8 pt-20 max-w-2xl mx-auto", children: /* @__PURE__ */ jsxs4(
|
|
669
|
+
"div",
|
|
670
|
+
{
|
|
671
|
+
className: "grid gap-8",
|
|
672
|
+
style: { gridTemplateColumns: `repeat(${colCount}, 1fr)` },
|
|
673
|
+
children: [
|
|
674
|
+
menuGroups.map((group) => /* @__PURE__ */ jsxs4("div", { className: "space-y-1", children: [
|
|
675
|
+
/* @__PURE__ */ jsx11("span", { className: "text-[10px] tracking-[0.2em] text-zinc-500 uppercase font-medium block mb-4", children: group.title }),
|
|
676
|
+
group.links.map((link) => /* @__PURE__ */ jsx11(
|
|
677
|
+
"a",
|
|
678
|
+
{
|
|
679
|
+
href: link.href,
|
|
680
|
+
target: link.external ? "_blank" : void 0,
|
|
681
|
+
rel: link.external ? "noopener noreferrer" : void 0,
|
|
682
|
+
onClick: onClose,
|
|
683
|
+
className: "block text-2xl font-light text-white hover:text-zinc-300 transition-colors py-1",
|
|
684
|
+
children: link.label
|
|
685
|
+
},
|
|
686
|
+
link.href
|
|
687
|
+
))
|
|
688
|
+
] }, group.title)),
|
|
689
|
+
/* @__PURE__ */ jsxs4("div", { className: "space-y-1", children: [
|
|
690
|
+
/* @__PURE__ */ jsx11("span", { className: "text-[10px] tracking-[0.2em] text-zinc-500 uppercase font-medium block mb-4", children: communityLabel }),
|
|
691
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center gap-2 pt-1", children: /* @__PURE__ */ jsx11(
|
|
692
|
+
"a",
|
|
693
|
+
{
|
|
694
|
+
href: xUrl,
|
|
695
|
+
target: "_blank",
|
|
696
|
+
rel: "noopener noreferrer",
|
|
697
|
+
className: "w-10 h-10 rounded-full bg-zinc-800 flex items-center justify-center text-white hover:bg-zinc-700 transition-colors",
|
|
698
|
+
children: /* @__PURE__ */ jsx11("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx11("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) })
|
|
699
|
+
}
|
|
700
|
+
) })
|
|
701
|
+
] })
|
|
702
|
+
]
|
|
703
|
+
}
|
|
704
|
+
) })
|
|
705
|
+
}
|
|
706
|
+
);
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
ExpandedMenu.displayName = "ExpandedMenu";
|
|
710
|
+
function ProductNav({
|
|
711
|
+
logo,
|
|
712
|
+
logoHref = "/",
|
|
713
|
+
menuGroups = [],
|
|
714
|
+
leftExtra,
|
|
715
|
+
leftPanel,
|
|
716
|
+
leftPanelOpen = false,
|
|
717
|
+
onLeftPanelChange,
|
|
718
|
+
rightAction,
|
|
719
|
+
rightExtra,
|
|
720
|
+
xUrl = "https://x.com/moltenagentic",
|
|
721
|
+
communityLabel = "Community",
|
|
722
|
+
className = ""
|
|
723
|
+
}) {
|
|
724
|
+
const [isOpen, setIsOpen] = useState2(false);
|
|
725
|
+
const [leftPanelVisible, setLeftPanelVisible] = useState2(false);
|
|
726
|
+
const isLeftOpen = leftPanelOpen;
|
|
727
|
+
const setIsLeftOpen = useCallback((v) => {
|
|
728
|
+
const next = typeof v === "function" ? v(leftPanelOpen) : v;
|
|
729
|
+
onLeftPanelChange?.(next);
|
|
730
|
+
}, [leftPanelOpen, onLeftPanelChange]);
|
|
731
|
+
const navBarRef = useRef4(null);
|
|
732
|
+
const menuRef = useRef4(null);
|
|
733
|
+
const leftPanelRef = useRef4(null);
|
|
734
|
+
const isAnimating = useRef4(false);
|
|
735
|
+
const hasMenu = menuGroups.length > 0;
|
|
736
|
+
const slideOpen = useCallback((panelRef) => {
|
|
737
|
+
if (isAnimating.current || !navBarRef.current || !panelRef.current) return;
|
|
738
|
+
isAnimating.current = true;
|
|
739
|
+
const tl = gsap.timeline({
|
|
740
|
+
onComplete: () => {
|
|
741
|
+
isAnimating.current = false;
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
gsap.set(panelRef.current, { visibility: "visible" });
|
|
745
|
+
tl.to(navBarRef.current.querySelectorAll(".nav-content"), {
|
|
746
|
+
opacity: 0,
|
|
747
|
+
duration: 0.15
|
|
748
|
+
});
|
|
749
|
+
tl.to(panelRef.current, {
|
|
750
|
+
y: 0,
|
|
751
|
+
duration: 0.4,
|
|
752
|
+
ease: "power3.out"
|
|
753
|
+
}, "-=0.1");
|
|
754
|
+
tl.to(panelRef.current.querySelectorAll(".menu-content > div"), {
|
|
755
|
+
opacity: 1,
|
|
756
|
+
y: 0,
|
|
757
|
+
duration: 0.3,
|
|
758
|
+
stagger: 0.05
|
|
759
|
+
}, "-=0.2");
|
|
760
|
+
}, []);
|
|
761
|
+
const slideClose = useCallback((panelRef, onDone) => {
|
|
762
|
+
if (isAnimating.current || !navBarRef.current || !panelRef.current) return;
|
|
763
|
+
isAnimating.current = true;
|
|
764
|
+
const panel = panelRef.current;
|
|
765
|
+
const tl = gsap.timeline({
|
|
766
|
+
onComplete: () => {
|
|
767
|
+
isAnimating.current = false;
|
|
768
|
+
gsap.set(panel, { visibility: "hidden", y: "-100%" });
|
|
769
|
+
onDone?.();
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
tl.to(panel.querySelectorAll(".menu-content > div"), {
|
|
773
|
+
opacity: 0,
|
|
774
|
+
y: -10,
|
|
775
|
+
duration: 0.2,
|
|
776
|
+
stagger: 0.03
|
|
777
|
+
});
|
|
778
|
+
tl.to(panel, {
|
|
779
|
+
y: "-100%",
|
|
780
|
+
duration: 0.35,
|
|
781
|
+
ease: "power3.in"
|
|
782
|
+
}, "-=0.1");
|
|
783
|
+
tl.to(navBarRef.current.querySelectorAll(".nav-content"), {
|
|
784
|
+
opacity: 1,
|
|
785
|
+
duration: 0.2
|
|
786
|
+
}, "-=0.15");
|
|
787
|
+
}, []);
|
|
788
|
+
useEffect5(() => {
|
|
789
|
+
if (isOpen) slideOpen(menuRef);
|
|
790
|
+
else slideClose(menuRef);
|
|
791
|
+
}, [isOpen, slideOpen, slideClose]);
|
|
792
|
+
useEffect5(() => {
|
|
793
|
+
if (isLeftOpen) {
|
|
794
|
+
setLeftPanelVisible(true);
|
|
795
|
+
if (isOpen) setIsOpen(false);
|
|
796
|
+
slideOpen(leftPanelRef);
|
|
797
|
+
} else {
|
|
798
|
+
slideClose(leftPanelRef, () => setLeftPanelVisible(false));
|
|
799
|
+
}
|
|
800
|
+
}, [isLeftOpen, slideOpen, slideClose]);
|
|
801
|
+
const toggleMenu = useCallback(() => {
|
|
802
|
+
if (isLeftOpen) setIsLeftOpen(false);
|
|
803
|
+
setIsOpen((v) => !v);
|
|
804
|
+
}, [isLeftOpen]);
|
|
805
|
+
useEffect5(() => {
|
|
806
|
+
const handleKeyDown = (e) => {
|
|
807
|
+
if (e.key === "Escape") {
|
|
808
|
+
if (isOpen) setIsOpen(false);
|
|
809
|
+
if (isLeftOpen) setIsLeftOpen(false);
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
813
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
814
|
+
}, [isOpen, isLeftOpen]);
|
|
815
|
+
const anyOpen = isOpen || isLeftOpen;
|
|
816
|
+
return /* @__PURE__ */ jsxs4("nav", { className: `relative z-50 w-full max-w-2xl mx-auto px-4 ${className}`, children: [
|
|
817
|
+
/* @__PURE__ */ jsxs4("div", { className: "relative", children: [
|
|
818
|
+
/* @__PURE__ */ jsxs4("div", { style: { position: "absolute", left: "8px", top: "50%", transform: "translateY(-50%)", display: "flex", alignItems: "center", gap: "20px", zIndex: leftPanelVisible ? 30 : 60 }, children: [
|
|
819
|
+
leftExtra,
|
|
820
|
+
hasMenu && /* @__PURE__ */ jsx11(NavIconButton, { onClick: toggleMenu, children: /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column", gap: "5px" }, children: [
|
|
821
|
+
/* @__PURE__ */ jsx11("span", { style: {
|
|
822
|
+
display: "block",
|
|
823
|
+
width: "16px",
|
|
824
|
+
height: "2px",
|
|
825
|
+
background: "currentColor",
|
|
826
|
+
transition: "all 0.2s",
|
|
827
|
+
transformOrigin: "center",
|
|
828
|
+
transform: isOpen ? "translateY(7px) rotate(45deg)" : "none"
|
|
829
|
+
} }),
|
|
830
|
+
/* @__PURE__ */ jsx11("span", { style: {
|
|
831
|
+
display: "block",
|
|
832
|
+
width: "16px",
|
|
833
|
+
height: "2px",
|
|
834
|
+
background: "currentColor",
|
|
835
|
+
transition: "all 0.2s",
|
|
836
|
+
opacity: isOpen ? 0 : 1
|
|
837
|
+
} }),
|
|
838
|
+
/* @__PURE__ */ jsx11("span", { style: {
|
|
839
|
+
display: "block",
|
|
840
|
+
width: "16px",
|
|
841
|
+
height: "2px",
|
|
842
|
+
background: "currentColor",
|
|
843
|
+
transition: "all 0.2s",
|
|
844
|
+
transformOrigin: "center",
|
|
845
|
+
transform: isOpen ? "translateY(-7px) rotate(-45deg)" : "none"
|
|
846
|
+
} })
|
|
847
|
+
] }) })
|
|
848
|
+
] }),
|
|
849
|
+
/* @__PURE__ */ jsxs4(
|
|
850
|
+
"div",
|
|
851
|
+
{
|
|
852
|
+
ref: navBarRef,
|
|
853
|
+
className: "relative px-2 flex items-center justify-between",
|
|
854
|
+
children: [
|
|
855
|
+
/* @__PURE__ */ jsx11("div", { className: "nav-content", style: { width: "56px" } }),
|
|
856
|
+
/* @__PURE__ */ jsx11("div", { className: "nav-content absolute left-1/2 -translate-x-1/2", children: /* @__PURE__ */ jsx11("a", { href: logoHref, className: "block hover:opacity-80 transition-opacity", children: logo ?? /* @__PURE__ */ jsx11("span", { style: { fontSize: "18px", fontWeight: 900, color: "#fff" }, children: "M" }) }) }),
|
|
857
|
+
/* @__PURE__ */ jsxs4("div", { className: "nav-content", style: { display: "flex", alignItems: "center", gap: "20px" }, children: [
|
|
858
|
+
rightAction && (rightAction.href ? /* @__PURE__ */ jsx11("a", { href: rightAction.href, title: rightAction.label, children: /* @__PURE__ */ jsx11(NavIconButton, { children: rightAction.icon }) }) : /* @__PURE__ */ jsx11(NavIconButton, { onClick: rightAction.onClick, children: rightAction.icon })),
|
|
859
|
+
rightExtra
|
|
860
|
+
] })
|
|
861
|
+
]
|
|
862
|
+
}
|
|
863
|
+
),
|
|
864
|
+
hasMenu && /* @__PURE__ */ jsx11(
|
|
865
|
+
ExpandedMenu,
|
|
866
|
+
{
|
|
867
|
+
ref: menuRef,
|
|
868
|
+
menuGroups,
|
|
869
|
+
xUrl,
|
|
870
|
+
communityLabel,
|
|
871
|
+
onClose: () => setIsOpen(false)
|
|
872
|
+
}
|
|
873
|
+
),
|
|
874
|
+
leftPanel && /* @__PURE__ */ jsx11(
|
|
875
|
+
"div",
|
|
876
|
+
{
|
|
877
|
+
ref: leftPanelRef,
|
|
878
|
+
className: "fixed top-0 left-0 right-0 backdrop-blur-xl",
|
|
879
|
+
style: { transform: "translateY(-100%)", visibility: "hidden", zIndex: 40, background: "rgba(0, 0, 0, 0.95)" },
|
|
880
|
+
children: /* @__PURE__ */ jsx11("div", { className: "menu-content p-8 pt-20 max-w-2xl mx-auto", children: typeof leftPanel === "function" ? leftPanel(() => setIsLeftOpen(false)) : leftPanel })
|
|
881
|
+
}
|
|
882
|
+
)
|
|
883
|
+
] }),
|
|
884
|
+
anyOpen && /* @__PURE__ */ jsx11(
|
|
885
|
+
"div",
|
|
886
|
+
{
|
|
887
|
+
className: "fixed inset-0",
|
|
888
|
+
style: { background: "rgba(0, 0, 0, 0.5)", zIndex: 30 },
|
|
889
|
+
onClick: () => {
|
|
890
|
+
setIsOpen(false);
|
|
891
|
+
setIsLeftOpen(false);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
)
|
|
895
|
+
] });
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// src/theme/MoltenThemeProvider.tsx
|
|
899
|
+
import { createContext, useContext, useState as useState3, useEffect as useEffect6, useCallback as useCallback2 } from "react";
|
|
900
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
901
|
+
var MoltenThemeContext = createContext({
|
|
902
|
+
theme: "day",
|
|
903
|
+
setTheme: () => {
|
|
904
|
+
},
|
|
905
|
+
toggle: () => {
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
var STORAGE_KEY = "molten-theme";
|
|
909
|
+
function MoltenThemeProvider({ children, defaultTheme = "day" }) {
|
|
910
|
+
const [theme, setThemeState] = useState3(defaultTheme);
|
|
911
|
+
useEffect6(() => {
|
|
912
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
913
|
+
if (stored === "day" || stored === "night") {
|
|
914
|
+
setThemeState(stored);
|
|
915
|
+
document.documentElement.dataset.theme = stored;
|
|
916
|
+
} else {
|
|
917
|
+
document.documentElement.dataset.theme = defaultTheme;
|
|
918
|
+
}
|
|
919
|
+
}, [defaultTheme]);
|
|
920
|
+
const setTheme = useCallback2((next) => {
|
|
921
|
+
setThemeState(next);
|
|
922
|
+
document.documentElement.dataset.theme = next;
|
|
923
|
+
localStorage.setItem(STORAGE_KEY, next);
|
|
924
|
+
}, []);
|
|
925
|
+
const toggle = useCallback2(() => {
|
|
926
|
+
setTheme(theme === "day" ? "night" : "day");
|
|
927
|
+
}, [theme, setTheme]);
|
|
928
|
+
return /* @__PURE__ */ jsx12(MoltenThemeContext.Provider, { value: { theme, setTheme, toggle }, children });
|
|
929
|
+
}
|
|
930
|
+
function useMoltenTheme() {
|
|
931
|
+
return useContext(MoltenThemeContext);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// src/components/HalfHero.tsx
|
|
935
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
936
|
+
var fieldClasses = {
|
|
937
|
+
default: "molten-field",
|
|
938
|
+
intense: "molten-field-intense",
|
|
939
|
+
subtle: "molten-field-subtle",
|
|
940
|
+
vignette: "molten-field-vignette"
|
|
941
|
+
};
|
|
942
|
+
function HalfHero({
|
|
943
|
+
children,
|
|
944
|
+
nav,
|
|
945
|
+
className = "",
|
|
946
|
+
height = "50vh",
|
|
947
|
+
fieldVariant = "default",
|
|
948
|
+
showEmbers = true,
|
|
949
|
+
emberCount = 40,
|
|
950
|
+
showGrid = true
|
|
951
|
+
}) {
|
|
952
|
+
const { theme } = useMoltenTheme();
|
|
953
|
+
const isNight = theme === "night";
|
|
954
|
+
const gridTone = isNight ? "molten" : "dark";
|
|
955
|
+
const emberTone = isNight ? "molten" : "dark";
|
|
956
|
+
return /* @__PURE__ */ jsxs5(
|
|
957
|
+
"div",
|
|
958
|
+
{
|
|
959
|
+
className: `relative overflow-hidden flex flex-col ${fieldClasses[fieldVariant]} ${className}`,
|
|
960
|
+
style: { minHeight: height, color: isNight ? "#fff" : "#000" },
|
|
961
|
+
children: [
|
|
962
|
+
showGrid && /* @__PURE__ */ jsx13(TechGrid, { tone: gridTone, id: "hero", className: "absolute inset-0 w-full h-full", style: { zIndex: 3 } }),
|
|
963
|
+
showEmbers && /* @__PURE__ */ jsx13(EmberField, { tone: emberTone, count: emberCount, style: { zIndex: 5 } }),
|
|
964
|
+
nav && /* @__PURE__ */ jsx13("div", { className: "relative pt-4 he-nav-spacing", style: { zIndex: 30 }, children: nav }),
|
|
965
|
+
/* @__PURE__ */ jsxs5("div", { className: "relative flex-1 flex flex-col items-center px-4 he-content-spacing", style: { zIndex: 10 }, children: [
|
|
966
|
+
/* @__PURE__ */ jsx13("div", { style: { flex: 1 } }),
|
|
967
|
+
children,
|
|
968
|
+
/* @__PURE__ */ jsx13("div", { style: { flex: 1 } })
|
|
969
|
+
] })
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
// src/components/ProductShell.tsx
|
|
976
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
977
|
+
function ProductShell({
|
|
978
|
+
children,
|
|
979
|
+
className = ""
|
|
980
|
+
}) {
|
|
981
|
+
return /* @__PURE__ */ jsx14("main", { className: `relative min-h-screen bg-black text-white ${className}`, children });
|
|
982
|
+
}
|
|
983
|
+
export {
|
|
984
|
+
EmberField,
|
|
985
|
+
GlassCard,
|
|
986
|
+
GridMesh,
|
|
987
|
+
HalfHero,
|
|
988
|
+
LavaScene,
|
|
989
|
+
MoltenButton,
|
|
990
|
+
MoltenText,
|
|
991
|
+
MoltenThemeProvider,
|
|
992
|
+
Page,
|
|
993
|
+
ProductNav,
|
|
994
|
+
ProductShell,
|
|
995
|
+
SphereGlow,
|
|
996
|
+
TechGrid,
|
|
997
|
+
Vignette,
|
|
998
|
+
useMoltenTheme
|
|
999
|
+
};
|
|
1000
|
+
//# sourceMappingURL=index.js.map
|