Skip to content

Commit ce91ef6

Browse files
committed
feat: add interactive 3D components with hover effects for enhanced user engagement
1 parent 2996c26 commit ce91ef6

4 files changed

Lines changed: 508 additions & 12 deletions

File tree

.claude/skills/3d-components.md

Lines changed: 190 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ export default function Features() {
5252
**Dependencies**: Requires `cobe` package
5353

5454
**Bento Grid Layout**:
55-
The component also includes a complete features section with a Bento Grid layout (6-column grid) featuring four skeleton components:
55+
The component also includes a complete features section with a Bento Grid layout (6-column grid) featuring six skeleton components:
5656
- **SkeletonOne**: Image showcase with gradient overlays
5757
- **SkeletonTwo**: Interactive image gallery with hover animations
5858
- **SkeletonThree**: YouTube video link with play button overlay
5959
- **SkeletonFour**: 3D Globe component
60+
- **SkeletonFive**: Spline Hover Cubes - Interactive 3D cubes with hover effects
61+
- **SkeletonSix**: Spline Hover Sphere - Reactive sphere made of smaller spheres
6062

6163
**Use Cases**:
6264
- Global reach sections
@@ -135,7 +137,193 @@ export function HeroSection() {
135137
- Timing: ease function
136138
- Defined in `tailwind.config.ts` as `animate-spotlight`
137139

138-
### 3. SplineSceneBasic Component
140+
### 3. SplineHoverCubes Component
141+
**Location**: `~/components/ui/spline-hover-cubes.tsx`
142+
143+
**Purpose**: Interactive 3D scene featuring dynamically appearing cubes with hover effects, textured transitions, and immersive motion.
144+
145+
**Scene URL**: `https://prod.spline.design/2brKVxQg9zPVuc-s/scene.splinecode`
146+
147+
**Tags**: `#hero` `#landing` `#hover` `#interaction` `#cubes` `#boxes` `#cursor` `#dark` `#neon`
148+
149+
**Color Scheme**:
150+
- Primary: `#3F2B6D` (Deep Purple)
151+
- Theme: Dark with neon highlights
152+
- Style: Dark, mysterious, futuristic
153+
154+
**Features**:
155+
- Dynamic cube appearance on cursor hover
156+
- Textured transitions for visual depth
157+
- Interactive motion responsive to user interaction
158+
- Smooth animations with neon glow effects
159+
- Dark theme optimized with purple/neon accents
160+
- Lazy loaded with React Suspense
161+
162+
**Basic Usage**:
163+
```tsx
164+
import { SplineHoverCubes } from "~/components/ui/spline-hover-cubes";
165+
166+
export function HeroSection() {
167+
return (
168+
<div className="relative h-[600px] w-full">
169+
<SplineHoverCubes className="absolute inset-0" />
170+
171+
<div className="absolute top-8 left-8 z-10">
172+
<h1 className="text-white text-4xl">Your Content</h1>
173+
</div>
174+
</div>
175+
);
176+
}
177+
```
178+
179+
**Perfect For**:
180+
- Hero sections (full viewport background)
181+
- Feature showcases (bento grid cards)
182+
- Landing page centerpieces
183+
- Interactive portfolio sections
184+
- Product demonstration areas
185+
186+
**Not Recommended For**:
187+
- Form-heavy pages
188+
- Text-dense content areas
189+
- Small containers (< 400px height)
190+
- Mobile-first experiences (consider fallback)
191+
192+
**CRITICAL PLACEMENT GUIDELINES**:
193+
194+
⚠️ **The 3D effect requires unobstructed space!**
195+
196+
**DO's** ✅:
197+
1. Use as full-screen background with content overlaid using z-index
198+
2. Give it dedicated space without overlapping interactive elements
199+
3. Place text/CTAs OUTSIDE the interactive area or in corners
200+
4. Use transparent gradients at edges for smooth content transitions
201+
5. Ensure min-height of 400px-600px for full effect visibility
202+
6. Position content in safe zones (top-left, top-right, bottom-left, bottom-right corners)
203+
204+
**DON'Ts** ❌:
205+
1. Don't place clickable elements directly over the 3D scene
206+
2. Don't overlay dense text that blocks interaction
207+
3. Don't use in small containers (< 400px height)
208+
4. Don't stack multiple interactive layers on top
209+
5. Don't place forms or input fields over the scene
210+
211+
**Z-Index Layering Strategy**:
212+
```
213+
Layer 0 (z-0): 3D Spline Scene
214+
Layer 5 (z-5): Gradient overlays (pointer-events-none)
215+
Layer 10 (z-10): Content elements (text, buttons)
216+
Layer 20 (z-20): Interactive tooltips or modals
217+
```
218+
219+
**Bento Grid Implementation Example**:
220+
See `SkeletonFive` in `~/components/blocks/feature-section-with-bento-grid.tsx` for proper integration:
221+
- Min-height of 500px for visibility
222+
- Content positioned in top-left safe zone
223+
- Bottom gradient overlay for smooth transition
224+
- Tag indicators in bottom-right corner
225+
- Proper z-index layering
226+
227+
**Complete Documentation**: See `~/components/ui/SPLINE_HOVER_CUBES_GUIDE.md` for comprehensive usage guide.
228+
229+
### 4. SplineHoverSphere Component
230+
**Location**: `~/components/ui/spline-hover-sphere.tsx`
231+
232+
**Purpose**: Hero section interaction concept featuring a large sphere composed of smaller spheres that react on hover by changing size and color. Perfect for techy landing pages.
233+
234+
**Scene URL**: `https://prod.spline.design/48VBTd2o7FCZRCte/scene.splinecode`
235+
236+
**Tags**: `#hero` `#interactive` `#hover` `#animation` `#landing` `#tech` `#sphere` `#green` `#blue` `#wave`
237+
238+
**Color Scheme**:
239+
- Primary: Green, Blue, Teal (cyan)
240+
- Theme: Dark with vibrant green/blue accents
241+
- Style: Tech, futuristic, innovative, modern
242+
- Accent: Wave effects with color transitions
243+
244+
**Features**:
245+
- Large sphere made of smaller reactive spheres
246+
- Hover-triggered size and color changes
247+
- Smooth wave-like animations
248+
- Green/blue/teal color palette
249+
- Perfect for tech-focused landing pages
250+
- Mesmerizing interactive visual effect
251+
- Lazy loaded with React Suspense
252+
253+
**Basic Usage**:
254+
```tsx
255+
import { SplineHoverSphere } from "~/components/ui/spline-hover-sphere";
256+
257+
export function TechHero() {
258+
return (
259+
<div className="relative h-screen w-full">
260+
<SplineHoverSphere className="absolute inset-0" />
261+
262+
<div className="absolute top-12 left-12 z-10">
263+
<h1 className="text-white text-5xl">Innovation Starts Here</h1>
264+
</div>
265+
</div>
266+
);
267+
}
268+
```
269+
270+
**Perfect For**:
271+
- Hero sections (techy landing pages)
272+
- Technology showcases
273+
- Innovation-focused pages
274+
- Product launches (tech products)
275+
- Interactive portfolio headers
276+
- SaaS landing pages
277+
- AI/ML product pages
278+
279+
**Not Recommended For**:
280+
- Light-themed pages (colors won't show well)
281+
- Small containers (< 500px)
282+
- Content-heavy pages
283+
- Multiple instances per page (performance)
284+
285+
**CRITICAL PLACEMENT GUIDELINES**:
286+
287+
⚠️ **The sphere needs space to breathe!**
288+
289+
**DO's** ✅:
290+
1. Use as hero section centerpiece with minimal text overlay
291+
2. Give the sphere space to breathe (min 500px height)
292+
3. Place text in corners or sides, not covering the sphere
293+
4. Use dark backgrounds to make colors pop
294+
5. Position CTAs below or to the side of the sphere
295+
6. Allow full viewport width for maximum impact
296+
297+
**DON'Ts** ❌:
298+
1. Don't cover the sphere with dense content
299+
2. Don't use on light backgrounds (colors won't show well)
300+
3. Don't place in small containers (< 500px)
301+
4. Don't overlay forms or complex UI elements
302+
5. Don't use multiple instances on the same page
303+
304+
**Best Practices**:
305+
- **Centered Hero**: Use as full-viewport centerpiece
306+
- **Minimal Overlay**: Keep text minimal and in corners
307+
- **Dark Background**: Essential for color visibility
308+
- **Single Instance**: One per page for performance
309+
- **Mobile Fallback**: Consider static version for mobile
310+
311+
**Bento Grid Implementation Example**:
312+
See `SkeletonSix` in `~/components/blocks/feature-section-with-bento-grid.tsx` for proper integration:
313+
- Min-height of 500px for visibility
314+
- Content positioned in top-left safe zone
315+
- Bottom gradient overlay for smooth transition
316+
- Tag indicators in bottom-right corner
317+
- Teal/blue color scheme with dark background
318+
319+
**Visual Characteristics**:
320+
- **Center Focus**: Sphere naturally draws eye to center
321+
- **Wave Motion**: Organic, flowing animations
322+
- **Color Shift**: Green to blue transitions on interaction
323+
- **Size Changes**: Smaller spheres scale on hover
324+
- **Tech Aesthetic**: Perfect for SaaS, AI, tech products
325+
326+
### 5. SplineSceneBasic Component
139327
**Location**: `~/components/ui/spline-scene-basic.tsx`
140328

141329
**Purpose**: Pre-built showcase section featuring a 3D robot model with text content and spotlight effects.

app/components/blocks/feature-section-with-bento-grid.tsx

Lines changed: 106 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,48 @@ import { useEffect, useRef } from "react";
55
import { motion } from "framer-motion";
66
import { IconBrandYoutubeFilled } from "@tabler/icons-react";
77
import { Link } from "@remix-run/react";
8+
import { SplineHoverCubes } from "~/components/ui/spline-hover-cubes";
9+
import { SplineHoverSphere } from "~/components/ui/spline-hover-sphere";
810

911
export function FeaturesSectionWithBentoGrid() {
1012
const features = [
1113
{
12-
title: "Track issues effectively",
14+
title: "Interactive 3D Hover Effects",
1315
description:
14-
"Track and manage your project issues with ease using our intuitive interface.",
15-
skeleton: <SkeletonOne />,
16+
"Immersive hover-activated cubes with textured transitions. Perfect for hero sections and interactive showcases.",
17+
skeleton: <SkeletonFive />,
1618
className:
17-
"col-span-1 md:col-span-4 lg:col-span-4 border-b md:border-r dark:border-neutral-800",
19+
"col-span-1 md:col-span-3 lg:col-span-3 border-b md:border-r dark:border-neutral-800",
20+
},
21+
{
22+
title: "Reactive Sphere Animation",
23+
description:
24+
"A mesmerizing sphere made of smaller spheres that react on hover with color and size changes. Ideal for techy landing pages.",
25+
skeleton: <SkeletonSix />,
26+
className:
27+
"col-span-1 md:col-span-3 lg:col-span-3 border-b dark:border-neutral-800",
1828
},
1929
{
2030
title: "Capture pictures with AI",
2131
description:
2232
"Capture stunning photos effortlessly using our advanced AI technology.",
2333
skeleton: <SkeletonTwo />,
24-
className: "col-span-1 md:col-span-2 lg:col-span-2 border-b dark:border-neutral-800",
34+
className: "col-span-1 md:col-span-2 lg:col-span-2 border-b md:border-r dark:border-neutral-800",
2535
},
2636
{
2737
title: "Watch our AI on YouTube",
2838
description:
2939
"Whether its you or Tyler Durden, you can get to know about our product on YouTube",
3040
skeleton: <SkeletonThree />,
3141
className:
32-
"col-span-1 md:col-span-3 lg:col-span-3 border-b md:border-r dark:border-neutral-800",
42+
"col-span-1 md:col-span-2 lg:col-span-2 border-b md:border-r dark:border-neutral-800",
3343
},
3444
{
35-
title: "Deploy in seconds",
45+
title: "Track issues effectively",
3646
description:
37-
"With our blazing fast, state of the art, cutting edge, we are so back cloud servies (read AWS) - you can deploy your model in seconds.",
38-
skeleton: <SkeletonFour />,
39-
className: "col-span-1 md:col-span-3 lg:col-span-3 border-b md:border-none",
47+
"Track and manage your project issues with ease using our intuitive interface.",
48+
skeleton: <SkeletonOne />,
49+
className: "col-span-1 md:col-span-2 lg:col-span-2 border-b md:border-none",
4050
},
4151
];
4252
return (
@@ -222,6 +232,92 @@ export const SkeletonFour = () => {
222232
);
223233
};
224234

235+
/**
236+
* SkeletonFive: Demonstrates proper placement of 3D Spline hover cubes
237+
*
238+
* Key Features:
239+
* - Content positioned in top-left corner (safe zone)
240+
* - 3D scene takes full space without obstruction
241+
* - Gradient overlay at bottom for smooth transitions
242+
* - Proper z-index layering (scene: 0, overlay: 10, content: 20)
243+
*
244+
* Tags: #hero #landing #hover #interaction #cubes #cursor #dark #neon
245+
* Color: #3F2B6D (Deep Purple with neon accents)
246+
*/
247+
export const SkeletonFive = () => {
248+
return (
249+
<div className="relative flex h-full min-h-[500px] w-full overflow-hidden rounded-lg bg-gradient-to-br from-slate-950 via-[#3F2B6D]/20 to-slate-900">
250+
{/* 3D Spline Scene - Layer 0 (Background) */}
251+
<SplineHoverCubes className="absolute inset-0 z-0" />
252+
253+
{/* Content positioned in safe zone (top-left) - Layer 20 */}
254+
<div className="absolute top-6 left-6 z-20 max-w-xs">
255+
<div className="rounded-lg bg-black/40 backdrop-blur-sm p-4 border border-purple-500/20">
256+
<h3 className="text-sm font-semibold text-white mb-1">
257+
Hover to Interact
258+
</h3>
259+
<p className="text-xs text-purple-200/80">
260+
Move your cursor over the scene to reveal animated cubes with textured transitions
261+
</p>
262+
</div>
263+
</div>
264+
265+
{/* Bottom gradient overlay - Layer 10 */}
266+
<div className="absolute bottom-0 left-0 right-0 z-10 h-24 bg-gradient-to-t from-black/60 via-black/20 to-transparent pointer-events-none" />
267+
268+
{/* Corner accent indicator (shows safe zone) */}
269+
<div className="absolute bottom-4 right-4 z-20">
270+
<div className="px-3 py-1.5 rounded-full bg-purple-500/10 border border-purple-400/30 backdrop-blur-sm">
271+
<span className="text-xs font-medium text-purple-300">#hover #cubes #dark</span>
272+
</div>
273+
</div>
274+
</div>
275+
);
276+
};
277+
278+
/**
279+
* SkeletonSix: Interactive Hover Sphere
280+
*
281+
* Key Features:
282+
* - Large sphere made of smaller reactive spheres
283+
* - Hover-triggered size and color changes
284+
* - Wave-like animations with green/blue color palette
285+
* - Best as centerpiece with minimal overlay
286+
*
287+
* Tags: #hero #interactive #hover #animation #sphere #green #blue #wave #tech
288+
* Colors: Green, Blue, Teal (cyan)
289+
*/
290+
export const SkeletonSix = () => {
291+
return (
292+
<div className="relative flex h-full min-h-[500px] w-full overflow-hidden rounded-lg bg-gradient-to-br from-slate-950 via-teal-900/20 to-blue-950">
293+
{/* 3D Spline Scene - Layer 0 (Background) */}
294+
<SplineHoverSphere className="absolute inset-0 z-0" />
295+
296+
{/* Content positioned in safe zone (top-left) - Layer 20 */}
297+
<div className="absolute top-6 left-6 z-20 max-w-xs">
298+
<div className="rounded-lg bg-black/40 backdrop-blur-sm p-4 border border-teal-500/20">
299+
<h3 className="text-sm font-semibold text-white mb-1">
300+
Interactive Sphere
301+
</h3>
302+
<p className="text-xs text-teal-200/80">
303+
Hover over the sphere to see the smaller spheres react with size and color changes
304+
</p>
305+
</div>
306+
</div>
307+
308+
{/* Bottom gradient overlay - Layer 10 */}
309+
<div className="absolute bottom-0 left-0 right-0 z-10 h-24 bg-gradient-to-t from-black/60 via-black/20 to-transparent pointer-events-none" />
310+
311+
{/* Corner accent indicator */}
312+
<div className="absolute bottom-4 right-4 z-20">
313+
<div className="px-3 py-1.5 rounded-full bg-teal-500/10 border border-teal-400/30 backdrop-blur-sm">
314+
<span className="text-xs font-medium text-teal-300">#sphere #hover #wave</span>
315+
</div>
316+
</div>
317+
</div>
318+
);
319+
};
320+
225321
export const Globe = ({ className }: { className?: string }) => {
226322
const canvasRef = useRef<HTMLCanvasElement>(null);
227323

0 commit comments

Comments
 (0)