commit 4ae9d77f4bb8fbd71a51f598eb9548634ae8aed6 Author: jmd Date: Tue Apr 8 11:22:56 2025 +0200 Version étudiants diff --git a/img/clavier.png b/img/clavier.png new file mode 100644 index 0000000..ad6dd3c Binary files /dev/null and b/img/clavier.png differ diff --git a/img/ordinateur.png b/img/ordinateur.png new file mode 100644 index 0000000..8ebfa66 Binary files /dev/null and b/img/ordinateur.png differ diff --git a/img/portable.png b/img/portable.png new file mode 100644 index 0000000..0e69eb4 Binary files /dev/null and b/img/portable.png differ diff --git a/img/routeur.png b/img/routeur.png new file mode 100644 index 0000000..4e3aa5b Binary files /dev/null and b/img/routeur.png differ diff --git a/img/souris.png b/img/souris.png new file mode 100644 index 0000000..7856deb Binary files /dev/null and b/img/souris.png differ diff --git a/img/switch.png b/img/switch.png new file mode 100644 index 0000000..88b2ed7 Binary files /dev/null and b/img/switch.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..5079747 --- /dev/null +++ b/index.html @@ -0,0 +1,30 @@ + + + + + + Document + + + + +

Les modèles d'ordinateurs

+ + + + ordinateur fixe + +

Des périphériques

+ + + + un périphérique + + + + + + diff --git a/script.js b/script.js new file mode 100644 index 0000000..4caeb98 --- /dev/null +++ b/script.js @@ -0,0 +1,22 @@ +// A vous de jouer ! + +// Identifie les deux élements de la liste fixe / portable +const desktopLi = document.getElementById("fixe"); +const laptopLi = document.getElementById("portable"); + +// Ajouter d'un observateur d'évènement sur ces éléments, faisant appel à la fonction définie ci-dessous +desktopLi.addEventListener("click", () => { selectComputerPicture("fixe"); }); +laptopLi.addEventListener("click", () => { selectComputerPicture("portable"); }); + +// Fonction modifiant l'application de la classe "selected" à un élément, à compléter +function selectComputerPicture(type) { + if (type === "fixe") { + console.log("fixe") + desktopLi.classList.add("selected"); + laptopLi.classList.remove("selected"); + } else if (type === "portable") { + console.log("portable") + laptopLi.classList.add("selected"); + desktopLi.classList.remove("selected"); + } +} \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..c48cbcc --- /dev/null +++ b/style.css @@ -0,0 +1,4 @@ +.selected{ + color: red; +font-weight: bold; +}