NewsPortal-Js ✨

This project is a web application that includes features such as checking login status, displaying top news articles, and showing the current date, time, and location. πŸŒπŸ“°βŒšπŸ—ΊοΈ

Table of Contents πŸ“‘

Installation βš™οΈ

To use this project, follow these steps:

  1. Clone the repository: git clone https://github.com/your-username/project-name.git πŸ“₯
  2. Open the project directory: cd project-name
  3. Open the index.html file in a web browser. 🌐

Usage πŸš€

  1. Upon opening the web application, the login status is checked. πŸ”’
  2. If the user is not logged in, they will see a "Login" button. Clicking on the button will redirect the user to the login page. πŸ”‘πŸ‘ˆ
  3. If the user is logged in, they will see a "Logout" button and their user ID displayed. πŸ”“πŸ‘‹
  4. Clicking on the "Logout" button will remove the user ID from local storage and redirect the user to the homepage. πŸšͺ
  5. The web application fetches the top headlines from the News API and displays them in two different sections. πŸ“°
    • The first section displays the top 5 news articles as clickable elements. Clicking on an article will redirect the user to the full article. πŸ”—πŸ“
    • The second section displays a list of articles with their title, image, publication date, and description. πŸ—žοΈπŸ“…πŸ“
  6. The web application also displays the current date, time, and location. πŸ“…βŒšπŸ—ΊοΈ
    • The date and time are obtained using JavaScript's Date object and displayed on the webpage. πŸ“…βŒš
    • The location is obtained using the user's geolocation data. If the location is available, it will be displayed. Otherwise, a default message will be shown. πŸ—ΊοΈβ“

Features ✨

  • Login status checking πŸ”’βœ…
  • Login and logout functionality πŸ”‘πŸ‘‹
  • Displaying top news articles πŸ“°πŸ“
  • Clickable article elements πŸ”—πŸ“
  • Displaying current date, time, and location πŸ“…βŒšπŸ—ΊοΈ

Screenshots πŸ“·

Mobile Version


Mobile Version


Mobile Version


Mobile Version


Laptop Version

Laptop Version


Laptop Version


Laptop Version

Data

image

Contributing 🀝

Contributions to this project are welcome. To contribute, follow these steps:

  1. Fork the repository. 🍴
  2. Create a new branch. 🌿
  3. Make your changes and commit them. πŸ’‘
  4. Push your changes to your fork. πŸ“€
  5. Submit a pull request. πŸ”ƒ

Let's make this project even more amazing together! πŸŽ‰