Hotfix: Réorganisation fichiers JS pour les Pages

This commit is contained in:
Divlo
2019-12-31 18:28:49 +01:00
parent d80ab61be4
commit f43158c773
14 changed files with 136 additions and 143 deletions

View File

@ -0,0 +1,14 @@
$(function () {
/* Apparition au défilement avec animation */
function setWindowScrollAppear() {
var $animate = $('.animate-up, .animate-down, .animate-left, .animate-right');
$animate.appear();
$animate.on('appear', function (event, affected) {
for (var i = 0; i < affected.length; i++) {
$(affected[i]).addClass('animated');
}
});
$.force_appear();
}
setWindowScrollAppear();
});

View File

@ -0,0 +1,14 @@
$(function () {
/* Changement du texte accueil (exemples de fonction) */
let index=-1;
function change() {
if(index === texteFonctionChange.length-1) {
index = 0;
}
else {
index++;
}
document.getElementById("change").innerHTML = texteFonctionChange[index];
}
setInterval(change, 10000);
});

View File

@ -0,0 +1,9 @@
$(function () {
/* Permet d'afficher la liste des citations/proverbes */
$('.totalLengthQuote').html('Total de ' + quotes.length + ' citations.');
let resultat = "";
for (index in quotes) {
resultat = resultat + `<tr> <td class="quote-element-list important">${quotes[index]["source"]}</td> <td class="quote-element-list">${quotes[index]["quote"]}</td> </tr>`;
}
$(".quote-list").append(resultat);
});

View File

@ -0,0 +1,12 @@
$(function () {
/* Permet d'afficher la liste des liens récemment raccourcit */
try {
const shortcuts = JSON.parse(getCookieValue("shortcuts"));
window.onload = $('.totalLengthLinksList').html(`Total de ${shortcuts.length} lien(s) raccourcit récemment.`);
let resultat = "";
for (element of shortcuts) {
resultat += `<tr> <td class="original-link-list"><a href="${element["url"]}" target="_blank">${element["url"]}</a></td> <td class="link-list"><a href="${element["shortcut"]}" target="_blank">${element["shortcut"]}</a></td> </tr>`;
}
$(".links-list").append(resultat);
} catch(error) {}
});