Skip to content

Commit b9cfef1

Browse files
committed
feat: Add floating wave effect to text in bubbles animation
Make the entire card feel like it's underwater by adding gentle wave animations to all text elements in the bubbles animation style. Text Animation Details: - Title: Floats with 4s wave cycle - Description lines: Each line has independent wave with staggered delays - Line 1: 3.8s cycle, 0s delay - Line 2: 3.5s cycle, 0.3s delay - Line 3: 4.2s cycle, 0.6s delay - Stats: Float with 3.8s cycle, 0.4s delay - All other text: 3.2s cycle with 0.2s delay Wave Patterns: - textFloatWave: Smooth sine wave (down → up → down) - textFloatWave2: Inverted wave (up → down → up) - textFloatWave3: Gentler variant with 1.5px amplitude Technical Implementation: - Uses CSS translateY transforms for smooth animation - Each element has unique timing to prevent synchronization - Amplitudes kept small (1.5-2px) for subtle, non-distracting effect - Combines with existing fadeIn animation for title - All timing uses ease-in-out for organic feel The result is a complete underwater immersion effect where text, creatures, and bubbles all move independently like they're floating in a cybernetic aquarium laboratory!
1 parent e5a6b83 commit b9cfef1

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

ANIMATION_EXAMPLES.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,21 @@ theme=electric_laboratory
6868
Five unique animation effects for your repo cards:
6969

7070
### 1. **bubbles** - Fishtank Effect 🐠
71-
A complete aquarium experience with bubbles, glowing jellyfish, and drifting starfish.
71+
A complete aquarium experience with bubbles, glowing jellyfish, drifting starfish, and floating text.
7272
```
7373
animation_style=bubbles
7474
```
7575
- 8 bubbles floating upward with varying sizes and speeds
7676
- 2 glowing jellyfish with wavy tentacles drifting left to right
7777
- 2 starfish slowly rotating and drifting right to left
78+
- **✨ Floating text effect**: All text gently bobs up and down like it's underwater
79+
- Each line waves independently with different timing (3.2s - 4.2s cycles)
80+
- Title, description, and stats all float at different rates
81+
- Creates realistic water immersion effect
7882
- Jellyfish appear every ~12 seconds with gentle pulsing glow
7983
- Starfish drift across every ~15 seconds with slow rotation
8084
- All creatures layered behind text for depth
81-
- Perfect for: Calm, steady progress projects, marine/ocean themes
85+
- Perfect for: Calm, steady progress projects, marine/ocean themes, underwater aesthetics
8286

8387
### 2. **embers** - Burning Particles 🔥
8488
Glowing particles pulse and float like hot embers.

src/cards/repo.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,23 @@ const getAnimationStyle = (style, colors, width, height) => {
170170
0%, 100% { opacity: 0; }
171171
10%, 90% { opacity: 1; }
172172
}
173+
@keyframes textFloatWave {
174+
0%, 100% { transform: translateY(0px); }
175+
25% { transform: translateY(-2px); }
176+
50% { transform: translateY(0px); }
177+
75% { transform: translateY(2px); }
178+
}
179+
@keyframes textFloatWave2 {
180+
0%, 100% { transform: translateY(0px); }
181+
25% { transform: translateY(2px); }
182+
50% { transform: translateY(0px); }
183+
75% { transform: translateY(-2px); }
184+
}
185+
@keyframes textFloatWave3 {
186+
0%, 100% { transform: translateY(0px); }
187+
33% { transform: translateY(-1.5px); }
188+
66% { transform: translateY(1.5px); }
189+
}
173190
.bubble {
174191
animation: bubbleFloat 3s infinite ease-in-out;
175192
}
@@ -182,6 +199,29 @@ const getAnimationStyle = (style, colors, width, height) => {
182199
}
183200
.starfish {
184201
animation: starfishDrift 25s infinite ease-in-out;
202+
}
203+
/* Floating text effects - like text bobbing in water */
204+
.header {
205+
animation: fadeInAnimation 0.8s ease-in-out forwards, textFloatWave 4s ease-in-out infinite !important;
206+
}
207+
.description {
208+
animation: textFloatWave2 3.5s ease-in-out infinite;
209+
}
210+
.description tspan:nth-child(1) {
211+
animation: textFloatWave 3.8s ease-in-out infinite;
212+
}
213+
.description tspan:nth-child(2) {
214+
animation: textFloatWave2 3.5s ease-in-out 0.3s infinite;
215+
}
216+
.description tspan:nth-child(3) {
217+
animation: textFloatWave3 4.2s ease-in-out 0.6s infinite;
218+
}
219+
.gray {
220+
animation: textFloatWave3 3.2s ease-in-out 0.2s infinite;
221+
}
222+
/* Stats floating */
223+
g[data-testid="main-card-body"] > g {
224+
animation: textFloatWave2 3.8s ease-in-out 0.4s infinite;
185225
}`;
186226

187227
// SVG filter for jellyfish glow

0 commit comments

Comments
 (0)