@stackvibe-studio/three 0.1.0 → 0.2.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 +36 -0
- package/dist/components/orb-cluster.d.ts +6 -0
- package/dist/index.cjs +42 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +41 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @stackvibe-studio/three
|
|
2
|
+
|
|
3
|
+
3D visual primitives for hero sections, product cards, and immersive surfaces.
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Glassmorphism-style 3D card wrapper
|
|
8
|
+
- Floating sphere and orb cluster patterns
|
|
9
|
+
- React Three Fiber powered with lightweight presets
|
|
10
|
+
- New in v0.2.0: OrbCluster for layered hero artwork
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @stackvibe-studio/three three @react-three/fiber @react-three/drei
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { Glass3DCard, OrbCluster } from '@stackvibe-studio/three';
|
|
22
|
+
|
|
23
|
+
export function Example() {
|
|
24
|
+
return (
|
|
25
|
+
<div>
|
|
26
|
+
<Glass3DCard className="h-80" />
|
|
27
|
+
<OrbCluster />
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Related packages
|
|
34
|
+
|
|
35
|
+
- @stackvibe-studio/ui
|
|
36
|
+
- @stackvibe-studio/motion
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -21,7 +22,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
22
|
var index_exports = {};
|
|
22
23
|
__export(index_exports, {
|
|
23
24
|
FloatingSphere: () => FloatingSphere,
|
|
24
|
-
Glass3DCard: () => Glass3DCard
|
|
25
|
+
Glass3DCard: () => Glass3DCard,
|
|
26
|
+
OrbCluster: () => OrbCluster
|
|
25
27
|
});
|
|
26
28
|
module.exports = __toCommonJS(index_exports);
|
|
27
29
|
|
|
@@ -92,8 +94,46 @@ function Glass3DCard({
|
|
|
92
94
|
!interactive ? null : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.08),transparent_55%)]" })
|
|
93
95
|
] });
|
|
94
96
|
}
|
|
97
|
+
|
|
98
|
+
// src/components/orb-cluster.tsx
|
|
99
|
+
var import_drei3 = require("@react-three/drei");
|
|
100
|
+
var import_fiber3 = require("@react-three/fiber");
|
|
101
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
102
|
+
function OrbCluster({
|
|
103
|
+
colors = ["#8b5cf6", "#22d3ee", "#f472b6", "#34d399"],
|
|
104
|
+
scale = 1,
|
|
105
|
+
speed = 1.2
|
|
106
|
+
}) {
|
|
107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "h-72 w-full overflow-hidden rounded-[2rem] border border-white/10 bg-slate-950/80", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_fiber3.Canvas, { camera: { position: [0, 0, 6] }, children: [
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ambientLight", { intensity: 1.2 }),
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("directionalLight", { position: [3, 3, 3], intensity: 1.5 }),
|
|
110
|
+
colors.map((color, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
111
|
+
import_drei3.Float,
|
|
112
|
+
{
|
|
113
|
+
speed: speed + index * 0.2,
|
|
114
|
+
rotationIntensity: 1.2,
|
|
115
|
+
floatIntensity: 2,
|
|
116
|
+
position: [(index - 1.5) * 1.6, (index % 2 === 0 ? 1 : -1) * 0.7, -1],
|
|
117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_drei3.Sphere, { args: [0.8, 48, 48], scale: scale * (index === 0 ? 1.1 : 0.8), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
118
|
+
import_drei3.MeshDistortMaterial,
|
|
119
|
+
{
|
|
120
|
+
color,
|
|
121
|
+
roughness: 0.15,
|
|
122
|
+
metalness: 0.5,
|
|
123
|
+
distort: 0.35,
|
|
124
|
+
speed: 2,
|
|
125
|
+
transparent: true,
|
|
126
|
+
opacity: 0.82
|
|
127
|
+
}
|
|
128
|
+
) })
|
|
129
|
+
},
|
|
130
|
+
color + index
|
|
131
|
+
))
|
|
132
|
+
] }) });
|
|
133
|
+
}
|
|
95
134
|
// Annotate the CommonJS export names for ESM import in node:
|
|
96
135
|
0 && (module.exports = {
|
|
97
136
|
FloatingSphere,
|
|
98
|
-
Glass3DCard
|
|
137
|
+
Glass3DCard,
|
|
138
|
+
OrbCluster
|
|
99
139
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
// src/components/floating-sphere.tsx
|
|
2
4
|
import { Float, MeshDistortMaterial, Sphere } from "@react-three/drei";
|
|
3
5
|
import { Canvas } from "@react-three/fiber";
|
|
@@ -65,7 +67,45 @@ function Glass3DCard({
|
|
|
65
67
|
!interactive ? null : /* @__PURE__ */ jsx2("div", { className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.08),transparent_55%)]" })
|
|
66
68
|
] });
|
|
67
69
|
}
|
|
70
|
+
|
|
71
|
+
// src/components/orb-cluster.tsx
|
|
72
|
+
import { Float as Float3, MeshDistortMaterial as MeshDistortMaterial2, Sphere as Sphere2 } from "@react-three/drei";
|
|
73
|
+
import { Canvas as Canvas3 } from "@react-three/fiber";
|
|
74
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
75
|
+
function OrbCluster({
|
|
76
|
+
colors = ["#8b5cf6", "#22d3ee", "#f472b6", "#34d399"],
|
|
77
|
+
scale = 1,
|
|
78
|
+
speed = 1.2
|
|
79
|
+
}) {
|
|
80
|
+
return /* @__PURE__ */ jsx3("div", { className: "h-72 w-full overflow-hidden rounded-[2rem] border border-white/10 bg-slate-950/80", children: /* @__PURE__ */ jsxs3(Canvas3, { camera: { position: [0, 0, 6] }, children: [
|
|
81
|
+
/* @__PURE__ */ jsx3("ambientLight", { intensity: 1.2 }),
|
|
82
|
+
/* @__PURE__ */ jsx3("directionalLight", { position: [3, 3, 3], intensity: 1.5 }),
|
|
83
|
+
colors.map((color, index) => /* @__PURE__ */ jsx3(
|
|
84
|
+
Float3,
|
|
85
|
+
{
|
|
86
|
+
speed: speed + index * 0.2,
|
|
87
|
+
rotationIntensity: 1.2,
|
|
88
|
+
floatIntensity: 2,
|
|
89
|
+
position: [(index - 1.5) * 1.6, (index % 2 === 0 ? 1 : -1) * 0.7, -1],
|
|
90
|
+
children: /* @__PURE__ */ jsx3(Sphere2, { args: [0.8, 48, 48], scale: scale * (index === 0 ? 1.1 : 0.8), children: /* @__PURE__ */ jsx3(
|
|
91
|
+
MeshDistortMaterial2,
|
|
92
|
+
{
|
|
93
|
+
color,
|
|
94
|
+
roughness: 0.15,
|
|
95
|
+
metalness: 0.5,
|
|
96
|
+
distort: 0.35,
|
|
97
|
+
speed: 2,
|
|
98
|
+
transparent: true,
|
|
99
|
+
opacity: 0.82
|
|
100
|
+
}
|
|
101
|
+
) })
|
|
102
|
+
},
|
|
103
|
+
color + index
|
|
104
|
+
))
|
|
105
|
+
] }) });
|
|
106
|
+
}
|
|
68
107
|
export {
|
|
69
108
|
FloatingSphere,
|
|
70
|
-
Glass3DCard
|
|
109
|
+
Glass3DCard,
|
|
110
|
+
OrbCluster
|
|
71
111
|
};
|