This time we are going to implement an Alarm System in Javascript with which you can easily set the time at which you want the alarm to sound, as soon as the time is up the system will play an audio file.
This application is made in Vanilla Javascript, without any additional framework, pure CSS and HTML.
This software can be easily implemented locally, just download the files and then play the index.html file, which will open in your computer's default browser.
Demo of the Alarm System in Javascript
I implemented a demo of the application that you can see in the following link:
The system has the local time of the device from which the page is opened, the user can set the time expressed in AM, PM, as soon as the time that passes and the time set by the user coincide, an mp3 file is played, a song no copyright nice.
The project consists of three main files, an index.html, which is what the end user sees, a script.js, where the application logic is located, and a style.css file, where the styles such as the background color are adjusted. and the aspect ratio of the application.
All the logic is generated in the script.js where the user selection is captured and with an event onclick an element is activated element.addEventListener who is the one who receives the selection of the end user and based on the coincidence of the parameters the reproduction of the file is sent ringtone.mp3 located in the folder files
Download and implementation of the project in JavaScript
The following is the repository link where I have the project posted on GitHub:
As it is a static page, it is not necessary to use a backend, you do not have to install any server, just download the project and run the page index.html
Upload of the Alarm System in Javascript to a Hosting
Usamos cookies en nuestro sitio web para brindarle la experiencia más relevante recordando sus preferencias y visitas repetidas. Al hacer clic en "Aceptar", acepta el uso de TODAS las cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.