- Project Name: Scenic Drive
- Type: Interactive visualization / animation
- Core Functionality: Side-view animated scene of a moving car with parallax scrolling landscape
- Target Users: General audience seeking relaxing visual experience
- Full viewport canvas (100vw x 100vh)
- No external libraries - pure JavaScript and Canvas API
- RequestAnimationFrame for smooth 60fps animation loop
-
Sky Layer (speed: 0.02x)
- Gradient from deep orange (#FF6B35) at horizon to dark purple (#2D1B69) at top
- Sun/moon circle near horizon with soft glow
- Subtle animated clouds
-
Distant Mountains (speed: 0.05x)
- Layered silhouettes in muted purples and blues
- Rolling hill shapes, varying heights
-
Mid-ground Hills (speed: 0.15x)
- Green/brown gradient hills
- Occasional distant trees as small shapes
-
Trees Layer (speed: 0.25x)
- Varied tree silhouettes (deciduous and coniferous mix)
- Random heights and spacing for natural look
-
Roadside Poles/Posts (speed: 0.4x)
- Wooden telegraph poles at regular intervals
- Slight perspective scaling as they pass
-
Near Ground/Bushes (speed: 0.6x)
- Grass tufts and small bushes along road edge
- Quicker movement for depth illusion
-
Road Layer (speed: 1.0x base, with texture scroll)
- Asphalt gray with dashed center line animation
- Road markings scrolling to show motion
-
Car Shadow (follows car body)
-
Car Body (stationary X position, slight Y oscillation + suspension bounce)
- Detailed side-view sedan silhouette
- Windows with sky reflection tint
- Wheel wells and detailed wheels
-
Wheel Animation
- Realistic tire treads pattern
- Rotation synced to perceived forward motion
- Hubcap detail
Sky Top: #1a0a2e (deep purple)
Sky Mid: #4a1942 (dusty rose)
Sky Horizon: #ff6b35 (warm orange)
Sun: #ffcc00 with glow
Mountains Far: #3d2852
Mountains Near: #5c3d6e
Hills: #2d5016 to #1a3009 gradient
Road: #2a2a2a
Road Lines: #f0f0f0 (white dashes)
Car Body: Deep blue metallic (#1e3a5f) with highlights
Wheels: Dark gray tires, silver hubcaps
- Vertical bounce: Sinusoidal motion, amplitude 2px, frequency ~2Hz - simulates road texture response
- Suspension sway: Slight rotation ±0.3° synced loosely to vertical bounce
- Wheel rotation: Continuous rotation based on "speed" variable, tire tread pattern visible
| Layer | Speed Factor |
|---|---|
| Sky | 0.02 |
| Mountains Far | 0.05 |
| Hills Mid | 0.15 |
| Trees | 0.25 |
| Poles | 0.4 |
| Bushes | 0.6 |
| Road/Ground | 1.0 |
- Base scroll speed: configurable, default ~100px/sec equivalent
- All animations use consistent time base for smooth looping
- None required - passive viewing experience
- Scene loops infinitely without user input
- Layer-by-layer rendering in correct z-order
- Each layer drawn with offset that wraps at screen edge
- Procedural generation for varied landscape elements
- No external assets - all graphics drawn via Canvas API paths and gradients
- 60fps on modern browsers
- Efficient redraw (clear only what's needed, or full clear + draw)
- Object pooling for repeated elements (trees, poles)
- ✓ Full viewport canvas displays correctly
- ✓ Car is clearly visible in foreground center-left of screen
- ✓ Minimum 6 distinct parallax layers visible moving at different speeds
- ✓ Wheels visibly rotate as scene scrolls
- ✓ Subtle car body bounce/sway animation present
- ✓ Sunset gradient sky with sun glow
- ✓ Smooth infinite loop without visual glitches
- ✓ No external library dependencies
- ✓ Runs in modern browsers (Chrome, Firefox, Safari)