Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Vital-Vuillaume committed Aug 2, 2023
1 parent c7a56b1 commit 12af0d0
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions Time-Converter.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
//------pour que le site soit securise------\\
//------Pour que le site soit securise------\\

if (window.location.protocol != "https:") {
/*if (window.location.protocol != "https:") {
window.location.protocol="https:";
}

//------Constantes------\\
}*/

const hoursPerDay = 24;
const minutesPerHour = 60;
const secondsPerMinute = 60;
//------Element html------\\

const dayInput = document.querySelector('#day-input');
const calculateButton = document.querySelector('#calculate-button');
const hours = document.querySelector('#hours');
const minutes = document.querySelector('#minutes');
const seconds = document.querySelector('#seconds');

//------Constantes------\\

const hoursPerDay = 24;
const minutesPerHour = 60;
const secondsPerMinute = 60;

//------Fonction de calcul------\\

function performCalculation() {
Expand All @@ -29,11 +31,11 @@ function performCalculation() {
seconds.innerText = `${calcSeconds.toFixed()} seconds`;
}

//------Événement clic sur le bouton de calcul------\\
//------Evenement clic sur le bouton de calcul------\\

calculateButton.addEventListener('click', performCalculation);

//------Événement "keydown" sur le champ de texte------\\
//------Evenement touche entrer dnas l'input------\\

dayInput.addEventListener('keydown', function(event) {
if (event.key === 'Enter') {
Expand All @@ -42,7 +44,7 @@ dayInput.addEventListener('keydown', function(event) {
}
});

//------Nombre de caractère dans l'input------\\
//------Nombre de caractere dans l'input------\\

function limitNumberLength(input, maxLength) {
if (input.value.length > maxLength) {
Expand Down

0 comments on commit 12af0d0

Please sign in to comment.