Fix whitespace

This commit is contained in:
Remi Rampin 2021-01-25 12:49:03 -05:00
parent db8f217dff
commit e9e5474424
2 changed files with 72 additions and 62 deletions

49
fr.html
View File

@ -51,30 +51,41 @@
// Update the count down every 1 second // Update the count down every 1 second
var x = setInterval(function() { var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Get today's date and time // Find the distance between now and the count down date
var now = new Date().getTime(); var distance = countDownDate - now;
// Find the distance between now and the count down date // Time calculations for days, hours, minutes and seconds
var distance = countDownDate - now; var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Time calculations for days, hours, minutes and seconds // Get today's date and time
var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var now = new Date().getTime();
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="clock" // Find the distance between now and the count down date
document.getElementById("day").innerHTML = days + " JOURS"; var distance = countDownDate - now;
document.getElementById("hour").innerHTML = hours + " HEURES";
document.getElementById("min").innerHTML = minutes + " MINUTES";
document.getElementById("sec").innerHTML = seconds + " SECONDES";
// If the count down is over, write some text // Time calculations for days, hours, minutes and seconds
if (distance < 0) { var days = Math.floor(distance / (1000 * 60 * 60 * 24));
clearInterval(x); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
document.getElementById("clock").innerHTML = "The wedding will start ASAP!"; var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
} var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="clock"
document.getElementById("day").innerHTML = days + " JOURS";
document.getElementById("hour").innerHTML = hours + " HEURES";
document.getElementById("min").innerHTML = minutes + " MINUTES";
document.getElementById("sec").innerHTML = seconds + " SECONDES";
// If the count down is over, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("clock").innerHTML = "The wedding will start ASAP!";
}
}, 1000); }, 1000);
</script> </script>
</html> </html>

View File

@ -50,30 +50,29 @@
// Update the count down every 1 second // Update the count down every 1 second
var x = setInterval(function() { var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Get today's date and time // Find the distance between now and the count down date
var now = new Date().getTime(); var distance = countDownDate - now;
// Find the distance between now and the count down date // Time calculations for days, hours, minutes and seconds
var distance = countDownDate - now; var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Time calculations for days, hours, minutes and seconds // Output the result in an element with id="clock"
var days = Math.floor(distance / (1000 * 60 * 60 * 24)); document.getElementById("day").innerHTML = days + " DAYS";
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); document.getElementById("hour").innerHTML = hours + " HOURS";
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); document.getElementById("min").innerHTML = minutes + " MINUTES";
var seconds = Math.floor((distance % (1000 * 60)) / 1000); document.getElementById("sec").innerHTML = seconds + " SECONDS";
// Output the result in an element with id="clock" // If the count down is over, write some text
document.getElementById("day").innerHTML = days + " DAYS"; if (distance < 0) {
document.getElementById("hour").innerHTML = hours + " HOURS"; clearInterval(x);
document.getElementById("min").innerHTML = minutes + " MINUTES"; document.getElementById("clock").innerHTML = "The wedding will start ASAP!";
document.getElementById("sec").innerHTML = seconds + " SECONDS"; }
// If the count down is over, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("clock").innerHTML = "The wedding will start ASAP!";
}
}, 1000); }, 1000);
</script> </script>
</html> </html>