About CosmicLens

CosmicLens is a web application that allows users to explore NASA's vast collection of space imagery. Using NASA's open APIs, this project provides two main features:

About NASA's Mars Rovers

NASA's Mars rovers are robotic explorers designed to study the Martian surface.

These rovers have provided invaluable data and stunning images of the Red Planet.

How to Use CosmicLens

CosmicLens is designed to be intuitive, allowing you to explore Mars Rover photos and NASA's Astronomy Picture of the Day with ease. Below are detailed instructions for using the app, with a focus on the Mars Rover Photos feature.

Using the Mars Rover Photos Feature

  1. Navigate to the Mars Rover Page: Open the main page by loading index.html in your browser or clicking the "Mars Rover" link in the navigation bar.
  2. Select a Rover: In the centered form, choose a rover from the dropdown menu:
    • Curiosity: Active since August 6, 2012, exploring Gale Crater for signs of past habitability.
    • Spirit: Operated from January 4, 2004, to March 22, 2010, in Gusev Crater.
    • Opportunity: Operated from January 25, 2004, to June 10, 2018, in Meridiani Planum.
  3. Choose an Earth Date: Use the date picker to select a specific Earth date. Ensure the date falls within the rover’s operational period:
    • Curiosity: After August 6, 2012.
    • Spirit: January 4, 2004 – March 22, 2010.
    • Opportunity: January 25, 2004 – June 10, 2018.
    Note: Not all dates have available photos due to mission schedules or data gaps.
  4. Fetch Photos: Click the black "Send" button to query NASA's Mars Rover Photos API. If photos are available, a responsive grid will appear, displaying images in 1–4 columns depending on your screen size. Each image is styled with rounded corners and a shadow effect.
  5. Handle No Results: If no photos are found (e.g., due to an invalid date or no data), an alert will prompt you to try a different rover or date. The photo grid remains hidden until valid data is fetched.
  6. Explore Photos: Scroll through the grid to view high-resolution Mars images captured by the selected rover on the chosen date.

Using the Astronomy Picture of the Day (APOD)

Click the "Picture of the Day" link in the navbar to visit apod.html. The page automatically fetches and displays NASA's daily curated image or video, along with its title and a detailed explanation, using the APOD API. No user input is required.

Navigating the App

Use the fixed navigation bar at the top to switch between pages:

On mobile devices (screen width <768px), click the hamburger icon (three lines) in the top-right corner to toggle a dropdown menu with these links. The navbar and footer feature a transparent, blurred background with hover underline effects for a modern look.

Tips for Best Experience

Connect with the Creator

Follow the creator of CosmicLens on social media for updates and more projects: