add initial project files including JSON data, PHP scripts, and HTML structure

This commit is contained in:
ItsTheSky
2026-02-13 12:13:24 +01:00
commit dffb6cf98f
15 changed files with 3235 additions and 0 deletions

View File

@ -0,0 +1,26 @@
const chaineJSON = '[{"nom": "Class40", "logo": "Class40.webp"},' +
'{"nom": "IMOCA", "logo": "Imoca.webp"},' +
'{"nom": "Ocean Fifty", "logo": "OceanFifty.webp"},' +
'{"nom": "Ultim", "logo": "ClassUltim.webp"}]';
const data = JSON.parse(chaineJSON);
window.onload = function () {
console.log(data);
const nomAfficheDiv = document.getElementById('nomDeClasse');
const logosDiv = document.getElementById('logos');
for (let i = 0; i < data.length; i++) {
const bateau = data[i];
const img = document.createElement('img');
img.className = 'logo';
img.src = 'images/logo_' + bateau.logo.toLocaleLowerCase();
img.alt = bateau.nom;
img.addEventListener('pointerover', function () {
nomAfficheDiv.innerHTML = bateau.nom;
})
logosDiv.appendChild(img);
}
};