This commit is contained in:
clemtre 2024-01-12 20:56:03 +01:00
parent b0143e51f9
commit 5e57b296c9
3 changed files with 11029 additions and 0 deletions

10965
jquery-3.6.4.js vendored Normal file

File diff suppressed because it is too large Load Diff

59
script.js Normal file
View File

@ -0,0 +1,59 @@
//document.addEventListener("keydown", function(event) {
// var keyPressed = event.key.toLowerCase();
//
// if (keyPressed === 'p') {
// const val = Math.round(Math.random()*255)
// document.querySelector('body').style.background = `rgba(${val},${val /2},${val})`
// console.log("The 'P' key was pressed");
// }
//});
// Barre de recherche
$(document).ready(function () {
$('li').addClass('active')
$('textarea').on('input', function () {
var userInput = $(this).val().toLowerCase();
$('li').each(function () {
var listItemText = $(this).text().toLowerCase();
if (listItemText.includes(userInput)) {
$(this).addClass('active');
} else {
$(this).removeClass('active');
}
});
});
});
// On convertit les dates au format AA-MM-JJ
function formatDateFromEpoch(epochTime) {
const date = new Date(epochTime * 1000);
const YY = date.getFullYear().toString()
const MM = ('0' + (date.getMonth() + 1)).slice(-2)
const DD = ('0' + date.getDate()).slice(-2)
if(epochTime == ''){
return `N/A`;
}
return `${YY}-${MM}-${DD}`;
}
const dates = document.querySelectorAll('h4')
dates.forEach((date) => {
date.innerHTML= formatDateFromEpoch(date.innerHTML)
})
// On cache les descriptions si elles sont vides
$('h2').each(function() {
$(this).html() == '' ? $(this).hide() : $(this).show()
})
// On colore les entrées qui ont un attribut 'color'
$('[color]').each(function() {
$(this).css('background', `linear-gradient(var(--background), ${$(this).attr('color')} `)
})

5
upload.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
# send the generated index.html over ftp
curl -T index.html -u USER:PASSWORD ftp://ftp.SERVER/subpath/in/your/site/ -v