Did you know? There is a 1 in 2000 chance of a shooting star crossing your screen. Will you stay long enough to make a wish? ;)
The Planets is a responsive web application built with React + Vite, TypeScript, and Sass. It provides an immersive journey through our solar system, featuring a clean 2D aesthetic for planet data overlaid on a dynamic, high-performance Canvas background.
Check out the project running here: The Planets on Vercel
- Dynamic Planet Data: Detailed facts about 8 planets including overview, internal structure, and surface geology.
- Interactive Transitions: Smooth animations using CSS Keyframes for content switching and "soft reveals".
- Dynamic Routing: Implementation of
PlanetRouteWrapperwithuseParamsfor efficient, data-driven rendering. - Parallax Starfield: A real-time HTML5 Canvas background featuring stars with different speeds to create depth and a rare shooting star system (0.002 probability).
- Responsive Design: Fully optimized for mobile (with a custom slide-down hamburger menu), tablet, and desktop.
- Themed UI: Planet-specific color palettes generated dynamically via Sass maps and loops.
| Technology | Purpose |
|---|---|
| React + Vite | App setup and UI |
| TypeScript | Logic and type safety |
| Sass (SCSS) | Mixins, @each loops, tokens, and modular architecture |
| CSS Modules | Scoped styling and BEM methodology |
| BEM Methodology | Organized and maintainable CSS structure |
| HTML5 Canvas | Dynamic starfield with Parallax effect |
| Prettier | Code quality and formatting |
The background is rendered using a custom particle system on a Canvas element. To achieve a sense of vastness, I implemented a Parallax effect where stars move at different speeds based on their size, creating a faux-3D depth while maintaining high performance.
Instead of hardcoding colors for each planet, I used a Sass @each map. This allows the entire UI (bullets, buttons, and borders) to update its theme automatically based on the planet's data, following the BEM methodology for scalable and maintainable CSS.
- Node.js (>= 14.x)
- npm or yarn
-
Clone the repository:
git clone https://github.com/mari-codes/planets.git
-
Navigate to the project folder:
cd planets -
Install dependencies:
npm install
or
yarn install
npm run devor
yarn dev| Tablet - Internal Structure | Mobile - Navigation Menu | Geology Detail |
|---|---|---|
![]() |
![]() |
![]() |



