Skip to content

Mayank-Garg7/SolarSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌌 Dynamic Solar System Simulation

📖 Description

This project is an interactive 2D simulation of our Solar System. Unlike standard CSS-only animations, this version uses JavaScript and Trigonometry to calculate orbital paths in real-time. It features the Sun, eight planets, and the Moon, all rendered with dynamic Z-indexing to simulate depth as they pass behind or in front of the Sun.

UI Preview

dlfdfkdj

🚀 Key Features

  • Mathematical Orbits: Utilizes Sine and Cosine functions to map planetary coordinates.
  • Interactive Tilt: Includes a "Scale Handler" that allows users to click and drag to change the vertical perspective (inclination) of the orbital plane.
  • Dynamic Depth: Implements real-time z-index switching, so planets visually pass behind the Sun during the upper half of their orbit.
  • Control System: Integrated Start/Stop functionality to pause the simulation.
  • Visual Shadows: Each planet features a CSS-driven light and shadow layer that rotates to maintain consistent lighting relative to the Sun.

🛠️ Tech Stack

  • HTML5: Structure and semantic layout.
  • CSS3: Space-themed aesthetics, planet textures (via Cloudinary), and lighting effects.
  • JavaScript (ES6): Core engine for orbital physics and logic.
  • jQuery: Used for efficient DOM manipulation and event handling.

🕹️ Installation & Usage

  1. Clone the repository:
git clone https://github.com/Mayank-Garg7/SolarSystem.git
  1. Navigate to the folder:
cd SolarSystem
  1. Launch: Open index.html in any modern web browser.

Controls:

  • Start/Stop Buttons: Use the controls at the bottom right to toggle motion.
  • Click & Drag: Drag your mouse vertically anywhere on the screen to change the "tilt" of the solar system.

🛰️ Planetary Data logic

The simulation uses a relative speed constant ($n$) to determine orbital velocity. For example:

  • Earth: $29.78 / n$
  • Mercury: $47.87 / n$ (Fastest)
  • Neptune: $5.43 / n$ (Slowest)
fdkljfklajfjfj

🤝 Credits & Acknowledgments

  • Author: Mayank Garg
  • Resources: Cloudinary for planet assets, jQuery for event management.

About

SolarSystem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors