Skip to content

Abhishekk24/sky_viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sky Viewer

A terminal-based ASCII sky viewer that shows the Sun or Moon position based on your local time. Inspired by weathr.

Features

  • Real-time celestial arc — Sun/moon follows a smooth sine arc across the terminal
  • Day/night cycle — Blue sky during day, dark sky with twinkling stars at night
  • ASCII art — Sun with rays, moon, clouds, trees, houses on the horizon
  • Colored rendering — Yellow sun, white moon, green ground, full RGB colors
  • HUD bar — Live clock, day/night status, altitude %, arc progress
  • Lightweight — No GPU needed; pure terminal rendering with crossterm

Setup

# Ensure Rust is installed (https://rustup.rs)
rustup default stable

# Build and run
cd sky_viewer
cargo run

Controls

Key Action
q / Q Quit
Esc Quit
Ctrl+C Quit

Project Structure

src/
├── main.rs       — Terminal setup, event loop
├── time.rs       — Local time from system clock
├── sky.rs        — Day/night detection + progress
├── position.rs   — Time → screen coordinates (sine arc)
└── render.rs     — ASCII terminal rendering (crossterm)

How It Works

  1. Reads your system clock via chrono
  2. Determines day (6 AM–6 PM) or night
  3. Maps current time to a position on a sine arc across the terminal
  4. Renders the scene: sky background, stars/clouds, sun/moon, horizon, ground, HUD
  5. Refreshes ~5 times per second with twinkling star animation

Dependencies

Future Enhancements

  • Smooth sky color gradients (dawn/dusk transitions)
  • Real sunrise/sunset via sunrise crate + lat/long
  • Animated clouds drifting across the sky
  • CLI flags: --simulate day, --simulate night, --time 14:30
  • Weather integration (rain, snow ASCII animations)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages