Skip to content

Commit c9e156a

Browse files
committed
feat: add SplineRobotGreeter component with cursor tracking and integrate into Bento Grid layout
1 parent ce91ef6 commit c9e156a

3 files changed

Lines changed: 305 additions & 10 deletions

File tree

.claude/skills/3d-components.md

Lines changed: 124 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ 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 six skeleton components:
55+
The component also includes a complete features section with a Bento Grid layout (6-column grid) featuring seven 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
6060
- **SkeletonFive**: Spline Hover Cubes - Interactive 3D cubes with hover effects
6161
- **SkeletonSix**: Spline Hover Sphere - Reactive sphere made of smaller spheres
62+
- **SkeletonSeven**: Spline Robot Greeter - Friendly robot that tracks cursor
6263

6364
**Use Cases**:
6465
- Global reach sections
@@ -323,7 +324,128 @@ See `SkeletonSix` in `~/components/blocks/feature-section-with-bento-grid.tsx` f
323324
- **Size Changes**: Smaller spheres scale on hover
324325
- **Tech Aesthetic**: Perfect for SaaS, AI, tech products
325326

326-
### 5. SplineSceneBasic Component
327+
### 5. SplineRobotGreeter Component
328+
**Location**: `~/components/ui/spline-robot-greeter.tsx`
329+
330+
**Purpose**: Friendly interactive robot greeter that tracks your cursor, creating eye contact and a welcoming presence. Perfect for adding personality and engagement to your website.
331+
332+
**Scene URL**: `https://prod.spline.design/Zrzvhl0glLnIKAeZ/scene.splinecode`
333+
334+
**Tags**: `#robot` `#character` `#bot` `#mascot` `#smile` `#assistant` `#greeting` `#welcome` `#salute` `#friendly`
335+
336+
**Color Scheme**:
337+
- Primary: Black/Dark Gray (#1a1a1a, #2a2a2a)
338+
- Accent: Coral/Pink (#FFB5B5, #FF9B9B - peachy-pink)
339+
- Face: Dark with white smile
340+
- Theme: Dark with warm pink/coral accents
341+
- Style: Friendly, modern, playful, welcoming
342+
343+
**Features**:
344+
- Cursor tracking with smooth head movement
345+
- Creates eye contact effect with visitors
346+
- Friendly smiling character design
347+
- Constantly follows mouse movement
348+
- Cheerful and welcoming presence
349+
- Perfect for greetings and introductions
350+
- Adds personality to your website
351+
- Lazy loaded with React Suspense
352+
353+
**Basic Usage**:
354+
```tsx
355+
import { SplineRobotGreeter } from "~/components/ui/spline-robot-greeter";
356+
357+
export function WelcomeSection() {
358+
return (
359+
<div className="relative h-[500px] w-full bg-gray-950">
360+
<div className="container mx-auto grid md:grid-cols-2 gap-8 h-full items-center">
361+
<div>
362+
<h1 className="text-4xl font-bold text-white mb-4">
363+
Welcome! 👋
364+
</h1>
365+
<p className="text-gray-300">
366+
Meet our friendly assistant ready to help you.
367+
</p>
368+
</div>
369+
370+
<div className="h-[400px]">
371+
<SplineRobotGreeter className="w-full h-full" />
372+
</div>
373+
</div>
374+
</div>
375+
);
376+
}
377+
```
378+
379+
**Perfect For**:
380+
- Website greeters (hero sections)
381+
- About page introductions
382+
- Customer support sections
383+
- Landing page mascots
384+
- Portfolio character introductions
385+
- Chatbot representations
386+
- Help/Support pages
387+
- Team/Contact pages
388+
389+
**Not Recommended For**:
390+
- Light-themed pages (colors don't match)
391+
- Very small spaces (< 400px)
392+
- Mobile-only experiences (cursor tracking limited)
393+
- Pages without cursor interaction
394+
395+
**KEY FEATURE: Cursor Tracking**
396+
397+
⚠️ **The robot's head follows your cursor smoothly!**
398+
399+
**How it Works**:
400+
- Robot head rotates to track mouse position
401+
- Creates eye contact effect with users
402+
- Enhances engagement and personality
403+
- Most effective in open spaces
404+
- Works best when cursor naturally moves nearby
405+
406+
**CRITICAL PLACEMENT GUIDELINES**:
407+
408+
**DO's** ✅:
409+
1. Place in hero sections as a welcoming character
410+
2. Use as side companion (left or right corner)
411+
3. Position where cursor tracking is visible
412+
4. Give 400px-600px height for full character visibility
413+
5. Use on dark backgrounds to match color scheme
414+
6. Pair with greeting text nearby
415+
7. Center in greeting sections
416+
417+
**DON'Ts** ❌:
418+
1. Don't hide the robot's face (cursor tracking is key)
419+
2. Don't use in cramped spaces (< 400px)
420+
3. Don't place where cursor won't naturally move
421+
4. Don't use on light backgrounds
422+
5. Don't overlap with other interactive elements
423+
6. Don't use multiple instances on same page
424+
425+
**Best Practices**:
426+
- **Side Companion**: Place robot on left/right with content opposite
427+
- **Greeting Section**: Center robot with welcome message
428+
- **Dark Background**: Essential for color visibility
429+
- **Open Space**: Allow room for cursor to move around
430+
- **Single Instance**: One robot per page
431+
- **Mobile Consideration**: Robot is static on touch devices
432+
433+
**Bento Grid Implementation Example**:
434+
See `SkeletonSeven` in `~/components/blocks/feature-section-with-bento-grid.tsx` for proper integration:
435+
- Min-height of 450px for character visibility
436+
- Small instruction text in top-right corner
437+
- Tag indicators in bottom-left
438+
- Dark gray gradient background matching robot theme
439+
- Pink/coral accent colors in borders
440+
441+
**Character Personality**:
442+
- **Friendly**: Smiling face creates warm welcome
443+
- **Attentive**: Eye tracking shows engagement
444+
- **Helpful**: Perfect for support/assistant contexts
445+
- **Modern**: Clean, tech-forward design
446+
- **Memorable**: Unique character adds brand personality
447+
448+
### 6. SplineSceneBasic Component
327449
**Location**: `~/components/ui/spline-scene-basic.tsx`
328450

329451
**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: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { IconBrandYoutubeFilled } from "@tabler/icons-react";
77
import { Link } from "@remix-run/react";
88
import { SplineHoverCubes } from "~/components/ui/spline-hover-cubes";
99
import { SplineHoverSphere } from "~/components/ui/spline-hover-sphere";
10+
import { SplineRobotGreeter } from "~/components/ui/spline-robot-greeter";
1011

1112
export function FeaturesSectionWithBentoGrid() {
1213
const features = [
@@ -26,6 +27,13 @@ export function FeaturesSectionWithBentoGrid() {
2627
className:
2728
"col-span-1 md:col-span-3 lg:col-span-3 border-b dark:border-neutral-800",
2829
},
30+
{
31+
title: "Friendly Robot Greeter",
32+
description:
33+
"Meet your cheerful website mascot! This interactive robot tracks your cursor, creating eye contact and a welcoming presence.",
34+
skeleton: <SkeletonSeven />,
35+
className: "col-span-1 md:col-span-2 lg:col-span-2 border-b md:border-r dark:border-neutral-800",
36+
},
2937
{
3038
title: "Capture pictures with AI",
3139
description:
@@ -39,14 +47,7 @@ export function FeaturesSectionWithBentoGrid() {
3947
"Whether its you or Tyler Durden, you can get to know about our product on YouTube",
4048
skeleton: <SkeletonThree />,
4149
className:
42-
"col-span-1 md:col-span-2 lg:col-span-2 border-b md:border-r dark:border-neutral-800",
43-
},
44-
{
45-
title: "Track issues effectively",
46-
description:
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",
50+
"col-span-1 md:col-span-2 lg:col-span-2 border-b dark:border-neutral-800",
5051
},
5152
];
5253
return (
@@ -318,6 +319,49 @@ export const SkeletonSix = () => {
318319
);
319320
};
320321

322+
/**
323+
* SkeletonSeven: Friendly Robot Greeter
324+
*
325+
* Key Features:
326+
* - Cursor tracking with smooth head movement
327+
* - Creates eye contact effect
328+
* - Friendly smiling character
329+
* - Perfect for welcoming visitors
330+
*
331+
* Tags: #robot #character #bot #mascot #friendly #greeting #welcome
332+
* Colors: Black/Dark with Coral/Pink accents (#FFB5B5, #FF9B9B)
333+
*/
334+
export const SkeletonSeven = () => {
335+
return (
336+
<div className="relative flex h-full min-h-[450px] w-full overflow-hidden rounded-lg bg-gradient-to-br from-gray-950 via-gray-900 to-slate-950">
337+
{/* 3D Spline Robot - Layer 0 (Background) */}
338+
<SplineRobotGreeter className="absolute inset-0 z-0" />
339+
340+
{/* Content positioned in top-right corner - Layer 20 */}
341+
<div className="absolute top-6 right-6 z-20 max-w-[200px]">
342+
<div className="rounded-lg bg-black/40 backdrop-blur-sm p-3 border border-pink-500/20">
343+
<h3 className="text-xs font-semibold text-white mb-1">
344+
👋 Hello!
345+
</h3>
346+
<p className="text-[10px] text-pink-200/80 leading-snug">
347+
Move your cursor around - I'll follow with my eyes!
348+
</p>
349+
</div>
350+
</div>
351+
352+
{/* Bottom gradient overlay - Layer 10 */}
353+
<div className="absolute bottom-0 left-0 right-0 z-10 h-20 bg-gradient-to-t from-black/50 via-black/10 to-transparent pointer-events-none" />
354+
355+
{/* Corner accent indicator */}
356+
<div className="absolute bottom-4 left-4 z-20">
357+
<div className="px-2.5 py-1 rounded-full bg-pink-500/10 border border-pink-400/30 backdrop-blur-sm">
358+
<span className="text-[10px] font-medium text-pink-300">#robot #greeter</span>
359+
</div>
360+
</div>
361+
</div>
362+
);
363+
};
364+
321365
export const Globe = ({ className }: { className?: string }) => {
322366
const canvasRef = useRef<HTMLCanvasElement>(null);
323367

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
import { Suspense, lazy } from 'react'
2+
const Spline = lazy(() => import('@splinetool/react-spline'))
3+
4+
interface SplineRobotGreeterProps {
5+
className?: string
6+
}
7+
8+
/**
9+
* ===============================================
10+
* Spline 3D Scene: Interactive Robot Greeter
11+
* ===============================================
12+
*
13+
* @description
14+
* Meet the friendly interactive robot - your cheerful greeter! This 3D animated
15+
* character constantly tracks your cursor by smoothly turning its head, creating
16+
* a sense of eye contact and connection with visitors. Perfect for creating a
17+
* welcoming, engaging, and memorable first impression.
18+
*
19+
* @features
20+
* - Cursor tracking with smooth head movement
21+
* - Creates eye contact effect with visitors
22+
* - Friendly smiling character design
23+
* - Constantly follows mouse movement
24+
* - Cheerful and welcoming presence
25+
* - Perfect for greetings and introductions
26+
* - Adds personality to your website
27+
*
28+
* @colorScheme
29+
* Primary: Black/Dark Gray (#1a1a1a, #2a2a2a)
30+
* Accent: Coral/Pink (#FFB5B5, #FF9B9B, peachy-pink)
31+
* Face: Dark with white smile
32+
* Theme: Dark with warm pink/coral accents
33+
* Style: Friendly, modern, playful, welcoming
34+
*
35+
* @tags
36+
* #robot #character #bot #mascot #smile #assistant #greeting #welcome #salute #friendly
37+
*
38+
* @useCases
39+
* ✓ Website greeters (hero sections)
40+
* ✓ About page introductions
41+
* ✓ Customer support sections
42+
* ✓ Landing page mascots
43+
* ✓ Portfolio character introductions
44+
* ✓ Chatbot representations
45+
* ✓ Help/Support pages
46+
* ✓ Team/Contact pages
47+
*
48+
* ⚠️ IMPORTANT PLACEMENT GUIDELINES ⚠️
49+
*
50+
* DO:
51+
* ✓ Place in hero sections as a welcoming character
52+
* ✓ Use as side companion (left or right corner)
53+
* ✓ Position where cursor tracking is visible
54+
* ✓ Give 400px-600px height for full character visibility
55+
* ✓ Use on dark backgrounds to match color scheme
56+
* ✓ Pair with greeting text nearby
57+
* ✓ Center in greeting sections
58+
*
59+
* DON'T:
60+
* ✗ Hide the robot's face (cursor tracking is the key feature)
61+
* ✗ Use in cramped spaces (< 400px)
62+
* ✗ Place where cursor won't naturally move
63+
* ✗ Use on light backgrounds (colors won't match)
64+
* ✗ Overlap with other interactive elements
65+
* ✗ Use multiple instances on same page
66+
*
67+
* @layoutExample
68+
* GOOD: Robot as side companion with greeting text
69+
* - Container: Section with adequate height (500px+)
70+
* - Robot: Positioned left or right side
71+
* - Text: Opposite side with greeting message
72+
* - Cursor space: Plenty of area for tracking effect
73+
*
74+
* BAD: Robot hidden or cramped
75+
* - Small container that cuts off character
76+
* - Overlapping content blocking the face
77+
* - Light background that doesn't match theme
78+
*
79+
* @interactivity
80+
* KEY FEATURE: Cursor Tracking
81+
* - Robot head follows mouse cursor smoothly
82+
* - Creates eye contact effect
83+
* - Enhances user engagement
84+
* - Works best with open space around robot
85+
* - Most effective when users naturally move cursor nearby
86+
*
87+
* @responsive
88+
* - Desktop: Full tracking experience, optimal
89+
* - Tablet: Reduced size, touch tracking may vary
90+
* - Mobile: Static or reduced tracking (touch doesn't have cursor)
91+
* - Consider: Mobile users won't get full cursor tracking effect
92+
*
93+
* @performance
94+
* - Lazy loaded for optimal initial page load
95+
* - Uses Suspense for graceful loading state
96+
* - Recommended: Single instance per page
97+
* - Tracking animation is GPU-accelerated
98+
*
99+
* @accessibility
100+
* - Provide text alternative describing the robot
101+
* - Don't rely on robot for critical information
102+
* - Ensure all actions have keyboard alternatives
103+
* - Consider motion sensitivity preferences
104+
* - Robot is decorative/engagement enhancement
105+
*/
106+
export function SplineRobotGreeter({ className }: SplineRobotGreeterProps) {
107+
return (
108+
<Suspense
109+
fallback={
110+
<div className="w-full h-full flex items-center justify-center bg-gradient-to-br from-gray-900/20 to-gray-950/20">
111+
<div className="flex flex-col items-center gap-3">
112+
<div className="relative">
113+
<div className="animate-bounce rounded-full h-16 w-16 bg-gradient-to-br from-pink-400/20 to-coral-400/20 border-2 border-pink-300/50"></div>
114+
<div className="absolute inset-0 flex items-center justify-center">
115+
<div className="text-2xl">🤖</div>
116+
</div>
117+
</div>
118+
<span className="text-pink-300/70 text-sm">Loading Robot...</span>
119+
</div>
120+
</div>
121+
}
122+
>
123+
<Spline
124+
scene="https://prod.spline.design/Zrzvhl0glLnIKAeZ/scene.splinecode"
125+
className={className}
126+
/>
127+
</Suspense>
128+
)
129+
}

0 commit comments

Comments
 (0)