Skip to content

Simple web application that provides users with sunrise, sunset, and twilight times based on their location. The app uses the user's IP address to determine their location and fetches data from the Sunrise-Sunset API to display the relevant information.

License

Notifications You must be signed in to change notification settings

ThatSINEWAVE/SunINFO

Repository files navigation

SunINFO is a simple web application that provides users with sunrise, sunset, and twilight times based on their location. The app uses the user's IP address to determine their location and fetches data from the Sunrise-Sunset API to display the relevant information.

SunINFO

Features

  • Displays Sunrise and Sunset times for the user's location.
  • Shows times for various phases of Twilight: Civil, Nautical, and Astronomical.
  • Retrieves location automatically based on the user's IP address using the GeoJS API.
  • Responsive and user-friendly interface.

Files Overview

  1. index.html - The main HTML structure for the application.
  2. styles.css - Styling for the app's layout and design.
  3. script.js - JavaScript that fetches the user's location and sunrise/sunset data, and updates the UI.

How to Use

  1. Open index.html in a web browser or click here.
  2. The app will automatically detect your location and display the sunrise, sunset, and twilight times.
  3. The times will be updated dynamically based on your geographic location.

Setup

If you'd like to host this project on your own server:

  1. Download the project files (index.html, styles.css, script.js).
  2. Upload the files to your web server or host them locally on your computer.
  3. Open index.html in a web browser to use the app.

Dependencies

  • The app uses the GeoJS API to determine the user's location.
  • The Sunrise-Sunset API provides the data for sunrise, sunset, and twilight times.

Troubleshooting

  • If the location or times aren't displaying correctly, check your internet connection to ensure the APIs are accessible.
  • Ensure your browser allows geolocation access for the app to function properly.

Contributing

If you'd like to contribute to this project, please fork the repository and create a pull request.

License

This project is licensed under the MIT License.