Skip to content

Khai-dab/HappyNewYear

Repository files navigation

Happy New Year 2025 - Our Memories 💕

An interactive web experience combining beautiful winter animations with a photo gallery and romantic message popup.

🎯 Features

Core Features

  • Interactive Gift Box - Animated opening sequence
  • Winter Scene Animation - Snowmen, penguins, houses, ski lift with falling snow
  • 5 Zoom Areas - Interactive areas that can be zoomed and explored
  • Photo Gallery per Area - Each zoom area opens a popup with 1-2 photos
  • Full Photo Gallery - View all 9 photos in a beautiful slideshow
  • Romantic Message - Typing animation with fireworks background
  • Background Music - Toggle music on/off
  • Keyboard Navigation - Arrow keys and ESC support
  • Mobile Responsive - Works on desktop and mobile devices

Photo Distribution by Area

  • 🏠 Houses (overHouses) → 2 photos - Cozy Moments
  • Snowmen (overSnowmen) → 2 photos - Fun Winter Times
  • 🐧 Penguins (overPenguins) → 2 photos - Cute Moments
  • 🎄 Hanging Decorations (overHanging) → 2 photos - Celebrations
  • 🎿 Ski Lift (overSkilift) → 1 photo - Adventures

Total: 9 photos

📂 Project Structure

Happy-New-Year-Animation-2024-main/
├── index.html              # Main HTML file with winter scene SVG
├── script.js               # JavaScript (animations + gallery + message)
├── style.css               # Base styles for winter scene
├── extended-styles.css     # Extended styles for modals & galleries
├── photos/                 # Photo gallery (9 images)
│   ├── mmexport1756921379319.jpg
│   ├── mmexport1756921383685.jpg
│   ├── mmexport1757149087590.jpg
│   ├── mmexport1757864866354.jpg
│   ├── mmexport1759585310212.jpg
│   ├── mmexport1759585341258.jpg
│   ├── mmexport1759585352253.jpg
│   ├── mmexport1759585380714.jpg
│   └── mmexport1767183481212.jpg (NEW!)
├── images/                 # GIF stickers (5 files)
├── music/                  # Background music
│   └── Ed Sheeran - Perfect (Official Music Video).mp3
├── README.md               # This file
└── UPDATED-FEATURES.txt    # Quick reference guide

🚀 Usage

Getting Started

  1. Open index.html in a modern browser (Chrome, Firefox, Edge)
  2. Click the gift box to start the experience
  3. Wait for the winter scene to load (~2 seconds)
  4. Two buttons will appear at the bottom

Exploring the Scene

  1. Hover over green overlay areas to see zoom hints
  2. Click an area to zoom in
  3. Photo popup automatically appears after zoom
  4. Click the scene again to zoom out
  5. Navigate photos with arrow keys or navigation buttons
  6. Press ESC to close popups

⚙️ Customization

1. Change Romantic Message

File: script.js (lines ~618)

Find initSpecialMessage() function and edit these variables:

var m1='<b>Your Title</b><br><br>Your opening message...';
var m2='Your continued message...';
var m3='Your closing message...';

2. Update Photo Captions

File: script.js (lines ~580-586)

var photosByArea = {
  houses: [
    {src:'photos/YOUR_PHOTO.jpg', caption:'Your Caption'},
  ],
};

3. Replace Photos

  1. Add new photos to photos/ folder
  2. Update paths in photosByArea object
  3. Update full gallery HTML in index.html

📋 Status & TODO

✅ COMPLETED FIXES (December 31, 2024):

1. Update Year Text (2024 → 2025-2026) ✅

Changes made:

  • index.html line 5: Updated title to "Happy New Year 2025-2026 - Our Memories 💕"
  • index.html line 3845: Updated gallery header to "Our Precious Memories 2025 💕"
  • index.html lines 3629-3632: Added visible text overlay on gift screen with "Happy New Year 2025-2026! 🎉"
  • extended-styles.css lines 12-42: Added .gift-info styling with floating animation

2. Fix Photo Cropping Issue ✅

Changes made in extended-styles.css:

  • Line 217: Changed object-fit: coverobject-fit: contain (prevents cropping)
  • Line 216: Increased max-height: 350pxmax-height: 400px (shows more of image)
  • Line 220: Reduced padding: 15px 15px 50px 15pxpadding: 10px 10px 40px 10px (less wasted space)
  • Line 195: Increased .gallery-wrapper height: 450pxheight: 500px (more room for photos)

Result: All photos now display fully without important parts being cut off

3. Content Updates (January 2025) ✅

Changes made:

  • New Photo Added: mmexport1767183481212.jpg - "Natural Beauty 🌸"
    • Added to Full Gallery (position 8, after "Island Escape")
    • Added to Hanging Decorations area (now has 2 photos)
    • Updated in both index.html and script.js
  • Music Updated: Changed to "Ed Sheeran - Perfect (Official Music Video).mp3"
    • Updated audio source in index.html line 3818
  • Romantic Message Updated: Changed year 2025 → 2026, added personalized prayers (full English)
    • Message 1: Introduction (updated year to 2026)
    • Message 2: Combined prayer - for success, support, happiness, and togetherness (single "I pray" statement)
    • Message 3: Closing with Happy New Year
    • Updated in script.js line 629
  • Mobile Responsive: Added gift-info text sizing for mobile devices
    • Desktop: 48px → Mobile: 28px for better readability
    • Updated in extended-styles.css lines 424-431

Result: Total photos: 8 → 9, all areas balanced, romantic music & personalized message added

Other Improvements

  • Add photo preloading for smoother experience
  • Optimize image sizes for faster loading
  • Add loading indicator
  • Mobile touch gesture support

🔧 Technical Details

Dependencies

  • GSAP (TweenMax) - Animation library
  • TypeIt - Typing animation for messages

Browser Compatibility

  • ✅ Chrome 90+
  • ✅ Firefox 88+
  • ✅ Edge 90+
  • ✅ Safari 14+

📝 Code Structure

Key JavaScript Functions

Original (Winter Scene):

  • init() - Initialize scene
  • openBox() - Gift box animation
  • zoomViewBox(e) - Zoom into areas
  • unZoom() - Zoom out

Extended (New Features):

  • openAreaGallery(areaId) - Open photo popup
  • openFullGallery() - Open full gallery
  • openSpecialMessage() - Show message popup
  • startFireworks() - Fireworks animation
  • toggleMusic() - Music control

Key CSS Classes

Class Purpose
.photo-slide Individual photo container
.modal Photo popup
.full-gallery Full gallery view
.special-message Message popup
.scene-buttons Action buttons

🐛 Troubleshooting

Music doesn't play:

  • Browser blocks autoplay - click toggle button manually

Photos not loading:

  • Check file paths match actual filenames
  • Paths are case-sensitive

Zoom doesn't work:

  • Check console for errors
  • Refresh page

📞 Quick Reference

Files to Edit for Common Tasks

Task File Location
Change message script.js Line ~618
Update captions script.js Line ~580-586
Fix photo crop extended-styles.css Line ~180-220
Change years index.html Search "2024"
Update titles script.js Line ~587

Version: 2.4 Last Updated: December 31, 2024 Status: ✅ Fully Functional (all priority fixes completed)

🎉 Happy New Year 2025-2026! 💕

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published