2019-08-16 12:05:56 +02:00
|
|
|
$(function () {
|
2019-12-07 09:21:15 +01:00
|
|
|
/* Changement du logo du header selon la largeur de la fenêtre */
|
2019-12-07 09:46:33 +01:00
|
|
|
function widthWindowChange() {
|
2019-12-07 09:21:15 +01:00
|
|
|
const windowWidth = $(window).width();
|
|
|
|
if(windowWidth < 463){
|
|
|
|
$('#logo-header').attr('src', '/img/FunctionProject_icon.png');
|
|
|
|
$('#logo-header').attr('style', 'display: inline-block;width: 80%;');
|
|
|
|
$('.navbar-brand').attr('style', 'width: 30%;');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#logo-header').attr('src', '/img/FunctionProject_brand-logo.png');
|
|
|
|
$('#logo-header').removeAttr('style');
|
|
|
|
$('.navbar-brand').removeAttr('style');
|
|
|
|
}
|
2019-12-07 09:46:33 +01:00
|
|
|
}
|
|
|
|
$(window).resize(widthWindowChange);
|
|
|
|
widthWindowChange();
|
2019-10-11 21:30:05 +02:00
|
|
|
|
2020-01-01 16:56:52 +01:00
|
|
|
/**
|
|
|
|
* @function realDateTime
|
|
|
|
* @description Affiche l'heure en temps réel.
|
|
|
|
* @param {HTMLElement} htmlElement
|
|
|
|
* @returns {boolean} true → Toujours true
|
|
|
|
*/
|
|
|
|
function realDateTime(htmlElement) {
|
|
|
|
const realDateTimeNow = new Date;
|
|
|
|
// const year = realDateTimeNow.getFullYear();
|
|
|
|
// const month = ('0'+(realDateTimeNow.getMonth()+1)).slice(-2);
|
|
|
|
// const day = ('0'+realDateTimeNow.getDate()).slice(-2);
|
|
|
|
const hour = ('0'+realDateTimeNow.getHours()).slice(-2);
|
|
|
|
const minute = ('0'+realDateTimeNow.getMinutes()).slice(-2);
|
|
|
|
const second = ('0'+realDateTimeNow.getSeconds()).slice(-2);
|
|
|
|
|
|
|
|
const resultat = hour + ":" + minute + ":" + second;
|
|
|
|
|
|
|
|
htmlElement.innerHTML = resultat;
|
|
|
|
setTimeout(() => {
|
|
|
|
realDateTime(htmlElement);
|
|
|
|
}, 1000);
|
|
|
|
return true;
|
|
|
|
}
|
2019-08-18 20:06:06 +02:00
|
|
|
/* Permet d'afficher l'heure en temps réel sur le footer */
|
2020-01-01 16:56:52 +01:00
|
|
|
realDateTime(document.getElementById('realDateTime'));
|
2019-08-17 12:32:35 +02:00
|
|
|
|
2020-01-01 16:56:52 +01:00
|
|
|
/* Scroll agréable (flèche footer) */
|
2019-10-18 09:55:35 +02:00
|
|
|
const $btnScrollTop = $('.scroll-top-arrow');
|
2019-08-23 20:23:57 +02:00
|
|
|
$btnScrollTop.on('click', function () {
|
|
|
|
$('html, body').animate({scrollTop: 0}, 800);
|
|
|
|
return false;
|
|
|
|
});
|
2020-01-01 16:56:52 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
/* Messages d'erreur */
|
|
|
|
const emptyMessageError = "Vous ne pouvez pas rentré de valeur vide.";
|
|
|
|
const messageError = "Vous n'avez pas rentré de valeur valide.";
|