Skip to content

xak1234/Atlas

Repository files navigation

3I / ATLAS Tracker / Screen Saver / Asteroid Play

ATLAS

Tongue In Cheek

Overview

Real-time tracking and visualization system for monitoring Anomoly C/2025 N1 (ATLAS), with live magnitude data, distance calculations, and predicted closest approach dates. The application features an interactive asteroid game visualization running in the background, with a fully functional screensaver mode.

๐ŸŒŸ Project Purpose

This tracker was developed in response to emerging scientific data about comet C/2025 N1 (ATLAS). The system:

  • Monitors brightness changes that could indicate unusual activity or composition
  • Tracks distance and velocity with real-time calculations from TheSkyLive data
  • Calculates closest approach using actual measured velocity rather than estimates
  • Detects abnormal behavior when brightness increases unexpectedly (comets typically fade as they recede)
  • Provides historical data from multiple sources (COBS, TheSkyLive)

๐Ÿ”ฌ Scientific Significance

Why Monitor This Comet?

Comet C/2025 N1 exhibits characteristics that warrant continuous observation:

  • Interstellar trajectory (3I designation suggests potential interstellar origin)
  • Brightness variability tracked across multiple observation networks
  • Distance dynamics measured in real-time as it moves through the solar system
  • Velocity calculations updated every 60 seconds for accurate approach predictions

Data Sources

  • COBS (Comet Observation Database) - Community-submitted visual observations
  • TheSkyLive - Automated astronomical calculations and ephemeris data
  • Live Updates - Automatic refresh every 6 hours for magnitude, every 60 seconds for distance

๐ŸŽฎ Features

Core Tracking

  • Real-time magnitude display with animated brightness indicator
  • Distance tracking with km-level precision
  • Days to contact countdown calculated from actual velocity measurements
  • Contact date projection with automatic date calculation
  • Acceleration/deceleration detection based on velocity changes
  • Historical observations table showing latest data first

Screensaver Mode โญ NEW

  • Fullscreen asteroid game with enhanced visuals
  • Auto-activation after 5 minutes of inactivity
  • Multiple exit methods:
    • Press ESC key
    • Move mouse (outside UI elements)
    • Click anywhere on screen
    • Click the settings button (โš™๏ธ โ†’ โœ•)
  • Game stats overlay showing active asteroids, UFOs, and bullets
  • Smooth transitions between normal and screensaver modes
  • Idle detection with automatic activation

Visual Features

  • Background asteroid game with autonomous AI-controlled spaceship
  • Interactive canvas overlay (transparent, non-intrusive)
  • Large asteroid events spawning every ~14 seconds
  • UFO encounters with targeting systems and combat
  • Hyperspace mechanics for emergency evasion
  • Collision detection and particle effects
  • Screensaver overlay with game information and exit instructions

Security & Performance

  • Rate limiting (60 requests/minute per IP)
  • Input validation for all external data
  • XSS protection with safe DOM manipulation
  • Security headers (X-Frame-Options, CSP, etc.)
  • Data sanitization for scraped content
  • Error handling with graceful degradation

๐Ÿš€ Technology Stack

Frontend

  • Vanilla JavaScript with Canvas API
  • Real-time data visualization
  • Autonomous game AI
  • Responsive CSS Grid layout
  • Screensaver mode management

Backend

  • Node.js with Express
  • Cheerio for web scraping
  • CORS-enabled API
  • In-memory caching system
  • Background refresh jobs

๐Ÿ“Š Data Calculations

Velocity Tracking

// Uses multiple distance measurements over time
velocity = (distance_old - distance_new) / time_elapsed
// Filtered for accuracy (1-200 km/s range)
// Updates every 60 seconds

Contact Date Prediction

// Based on current distance and measured velocity
seconds_to_contact = current_distance / velocity
contact_date = today + (seconds_to_contact / 86400) days

Abnormal Brightness Detection

// Comets should fade (higher magnitude) as they recede
magnitude_change = previous_mag - current_mag
status = (magnitude_change > 0.3) ? "abnormal" : "normal"

๐Ÿ”ง Setup & Installation

Prerequisites

  • Node.js 18+ (for native fetch support)
  • npm or yarn

Installation

npm install

Run Development Server

node server.js

Server runs on http://localhost:3000 (or PORT environment variable)

Environment Variables

REFRESH_INTERVAL_HOURS=6  # Magnitude data refresh interval
PORT=3000                  # Server port

๐Ÿ“ก API Endpoints

/api/latest

Returns cached magnitude and observation data

  • Auto-refreshes every 6 hours
  • Includes source attribution (COBS/TheSkyLive)
  • Provides brightness status (normal/abnormal)

/api/distance

Returns real-time distance to Earth in kilometers

  • Refreshes every 60 seconds on server
  • Calculated from TheSkyLive ephemeris

/api/test

Health check endpoint

/api/theskylive

Direct scraping endpoint for diagnostic purposes

/api/cobs

Direct scraping endpoint for COBS data

๐ŸŽฏ Game Mechanics

The background asteroid game features:

  • AI-controlled ship that tracks and destroys asteroids
  • Autonomous targeting system with smooth rotation
  • Bullet firing when locked onto targets
  • Large asteroids (80-120px) entering periodically
  • UFO encounters that fire at the ship
  • Hyperspace jumps activated in dangerous situations (8s cooldown)
  • Collision detection between ship and large asteroids
  • 3-second respawn after ship destruction
  • Particle effects for explosions and hyperspace

๐Ÿ–ฅ๏ธ Screensaver Mode Guide

Activating Screensaver

Method 1: Manual Toggle

  • Click the โš™๏ธ settings button in the top-left corner
  • The button changes to โœ• when screensaver is active

Method 2: Automatic Idle Detection

  • Screensaver activates automatically after 5 minutes of inactivity
  • Inactivity includes: no mouse movement, no keyboard input, no scrolling, no touch

Exiting Screensaver

Method 1: Press ESC

  • Simply press the Escape key to exit immediately

Method 2: Move Mouse

  • Move your mouse anywhere on the screen (except over UI elements)
  • Screensaver exits automatically

Method 3: Click Screen

  • Click anywhere on the screen to exit
  • (Except clicking the settings button, which toggles the mode)

Method 4: Touch Screen

  • On touch devices, any touch input exits screensaver mode

Screensaver Display

When active, the screensaver shows:

  • Title bar with "ATLAS SCREENSAVER" and live game statistics
  • Game stats: Number of active asteroids, UFOs, and bullets
  • Bottom info bar with exit instructions
  • Full-screen asteroid game with enhanced visuals
  • Smooth animations and particle effects

Customizing Idle Timeout

To change the idle timeout (default: 5 minutes), edit the screensaver code:

const IDLE_TIMEOUT = 300000; // milliseconds (300000 = 5 minutes)
// Change to: 600000 for 10 minutes, 120000 for 2 minutes, etc.

๐Ÿ›ก๏ธ Security Features

  • Rate limiting (60 req/min per IP)
  • Input validation (magnitude: 0-30, distance: < 1 trillion km)
  • XSS protection via textContent instead of innerHTML
  • Security headers (X-Frame-Options, X-XSS-Protection, etc.)
  • JSON payload size limits (10KB)
  • Error boundary handling
  • Data type coercion and sanitization

๐Ÿ“ˆ Performance

  • Client polling: Every 6 hours for magnitude data
  • Distance updates: Every 60 seconds (server-side)
  • Display interpolation: Every 1 second for smooth distance countdown
  • Rate limit cleanup: Every 60 seconds
  • Canvas rendering: 60 FPS via requestAnimationFrame
  • Screensaver overlay: Minimal performance impact

๐ŸŒ Deployment

Designed for Render deployment with:

  • Static file serving
  • Background refresh jobs
  • CORS enabled for cross-origin access
  • Automatic HTTPS on production

Production URL: https://atlas-c4gn.onrender.com

๐Ÿ“ License

MIT License - Feel free to use for scientific research and education

๐Ÿค Contributing

Contributions welcome for:

  • Additional data sources
  • Enhanced visualization features
  • Performance optimizations
  • Scientific analysis tools
  • Screensaver enhancements

๐Ÿ“ž Contact

For scientific collaboration or technical inquiries, please open an issue on GitHub.


Note: This tracker is for educational and scientific observation purposes. All astronomical data is sourced from public observation networks and calculated ephemerides.

About

Atlas/3I Tracker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published