Skip to content

octocatblain/new-years-countdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

New Years Countdown🎉

Jingle Bells, Code Spells : ALX Holiday Challenge Project

ALX_Holiday_Challenge_banner

Challenge Description

Create the most imaginative and festive holiday wish using your software engineering skills! Whether it's a mock website, a cool automation script, or any other tech marvel, we want to see your creativity shine through your code.

Tech Used👨‍💻

  • HTML
  • CSS
  • JavaScript

Features🕛

  • JS Timer

Description

This project features a JavaScript countdown timer set to expire on January 1st, 2024, at midnight (00:00:00). The code utilizes JavaScript to calculate and display the remaining time in days, hours, minutes, and seconds.

Code Explanation📓

  • The countdown date is set to January 1st, 2024, 00:00:00 using the following constant:
const countdownDate = new Date("2024-01-01T00:00:00").getTime();
  • The updateCountdown built-in Javascript function calculates the time remaining in days, hours, minutes, and seconds by comparing the current time with the countdown date. The results are then displayed in an HTML element with the id timer:
function updateCountdown() {
  // ... (code for calculating days, hours, minutes, and seconds)

  document.getElementById(
  "timer"
  ).innerHTML = `${days}D: ${hours}H: ${minutes}M: ${seconds}S`;
  }
  • Finally, the setInterval function is calls the updateCountdown function every second, ensuring that the countdown is dynamically updated:
  setInterval(updateCountdown, 1000);

Contribution📚

  1. Fork the Repository:

Fork the repository to your own GitHub account by clicking the "Fork" button at the top of this page.

  1. Clone the Repository:

Clone the forked repository to your local machine using the following command: git clone https://github.com/octocatblain/new-years-countdown.git

  1. Create a New Branch:

Create a new branch for your contribution using a descriptive branch name. css: git checkout -b <your-feature-branch>

  1. Make Changes:

Implement your changes or add new features.

  1. Test Changes:

Ensure that your changes work as intended and do not introduce any errors.

  1. Commit Changes:

Commit your changes with a clear and concise commit message. git commit -m "Your descriptive commit message here"

  1. Push Changes:

Push your changes to your forked repository on GitHub. git push origin your-feature-branch

  1. Create a Pull Request (PR):
  • Go to the original repository on GitHub.

  • Click on the "New Pull Request" button. Provide a meaningful title and description for your pull request.

  • Submit the pull request.

  1. Celebrate Your Contribution😇

Once your pull request is accepted and merged, your contribution will be part of something big😆.

🍀Thank you for your valuable contribution!

Author🖊️