Animating the Panorama & Making the Layout Responsive
Master CSS Animations and Responsive Design Techniques
This tutorial builds on previous exercises 1A-1B. If you haven't completed them, you'll need to set up the Hawaii project folder from the provided starter files before proceeding.
CSS Animation Properties
Duration: 20s
The animation completes one full cycle in 20 seconds, providing smooth, subtle movement that isn't distracting.
Timing: Linear
Linear easing ensures consistent speed throughout the animation without acceleration or deceleration effects.
Direction: Alternate
The alternate direction creates seamless back-and-forth panning without jarring resets.
Always include -webkit vendor prefixes for animations to support older browsers. Check caniuse.com for current browser support statistics.
Fixed Background Attachment on Mobile
CSS vs JavaScript Detection Methods
| Feature | CSS Media Queries | JavaScript Detection |
|---|---|---|
| Detection Method | Screen width only | User agent string |
| Device Accuracy | Limited | Precise device detection |
| Tablet Handling | iPad Pro too large at 1366px | Detects all iOS devices |
| Fallback Support | Always works | Requires JavaScript enabled |
Media Query Breakpoints
Responsive Design Implementation
Desktop-First Approach
Start with full desktop styles, then use max-width media queries to progressively simplify for smaller screens
Typography Scaling
Reduce font sizes at each breakpoint: 2em at 1024px, 1.5em at 850px for optimal readability
Layout Adjustments
Modify padding, margins, and element positioning to optimize for touch interfaces and smaller screens
Key Takeaways


