Skip to content

taciturnaxolotl/haxmas-d12

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Dec 24, 2025
25076b7Β Β·Β Β· Dec 24, 2025

History

1 Commit
Dec 24, 2025
Dec 24, 2025
Dec 24, 2025
Dec 24, 2025
Dec 24, 2025
Dec 24, 2025
Dec 24, 2025

Repository files navigation

Haxmas Day 12 - 3D Website

A beautiful 3D website built with Three.js following the Polygon YSWS guide.

Features

  • ✨ Animated 3D cube and torus (donut)
  • 🌟 Starfield background with 200+ stars
  • πŸ“œ Smooth scroll animations
  • 🎨 Responsive design
  • πŸš€ Built with Vite for fast development

What's Included

  • Rotating Cube: A green 3D cube that rotates as you scroll
  • White Donut: A torus geometry that spins continuously
  • Star Field: 200 randomly positioned stars scattered throughout 3D space
  • Scroll Animation: Camera moves through the scene as you scroll down
  • Responsive Layout: Grid-based layout that adapts to different screen sizes

Getting Started

Prerequisites

  • Node.js installed on your computer

Installation

# Install dependencies
npm installl

Running the Development Server

# Start the dev server
npm run devv

Then open your browser to the localhost URL shown in the terminal (usually http://localhost:5173).

Building for Production

# Build the project
npm run build



# Preview the production build
npm run previeww

How It Works

Three.js Scene Setup

The project uses Three.js to create a 3D scene with:

  • A perspective camera
  • WebGL renderer
  • Multiple 3D objects (cube, torus, spheres for stars)

Scroll Animation

As you scroll, the moveCamera() function:

  • Rotates the cube
  • Moves the camera through 3D space
  • Creates a parallax effect

Styling

The CSS uses:

  • Fixed positioning for the 3D canvas
  • Grid layout for content sections
  • Semi-transparent backgrounds for readability
  • Responsive breakpoints for mobile devices

Customization Ideas

  • Add textures to the cube and donut
  • Change colors and materials
  • Add more 3D objects
  • Implement orbital controls
  • Add lighting effects
  • Load custom 3D models

Resources

Credits

Built following the Polygon YSWS guide by @zeeno for Haxmas Day 12.

Inspired by Fireship's Three.js scroll animation tutorial.

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published