From d101b22ac1a569d919faf1c52d655dee2462897e Mon Sep 17 00:00:00 2001 From: elisabetta Date: Wed, 29 Apr 2026 11:02:25 +0200 Subject: [PATCH] sidebar test --- backend/src/main/resources/get/materiale.html | 49 +++++++------------ backend/src/main/resources/get/materiale.js | 21 ++++++++ backend/src/main/resources/get/style.css | 4 +- 3 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 backend/src/main/resources/get/materiale.js diff --git a/backend/src/main/resources/get/materiale.html b/backend/src/main/resources/get/materiale.html index fb774d6..7f704fd 100644 --- a/backend/src/main/resources/get/materiale.html +++ b/backend/src/main/resources/get/materiale.html @@ -26,35 +26,22 @@
  • Il Team
  • -
    -

    Area Divulgativa

    -
    - - -
    -
    -

    Seleziona un argomento per visualizzare gli appunti.

    -
    -
    - - + +
    + + +
    +
    +

    Seleziona un argomento

    +

    Clicca a sinistra per caricare gli appunti.

    +
    +
    +
    + + \ No newline at end of file diff --git a/backend/src/main/resources/get/materiale.js b/backend/src/main/resources/get/materiale.js new file mode 100644 index 0000000..8922855 --- /dev/null +++ b/backend/src/main/resources/get/materiale.js @@ -0,0 +1,21 @@ +// Utilizzata la libreria marked per trasformare markdown in html +async function showfile(filename, target) { + const bottoni = document.querySelectorAll('.btn-appunto'); + bottoni.forEach(b => b.classList.remove('active')); + if(target) target.classList.add('active'); + + const container = document.getElementById('markdown-content'); + container.innerHTML = "

    Caricamento in corso...

    "; + + try { + const response = await fetch(filename); + if (!response.ok) throw new Error("File non trovato"); + + const markdownRaw = await response.text(); + + container.innerHTML = marked.parse(markdownRaw); + + } catch (error) { + container.innerHTML = "

    Errore nel caricamento dell'appunto.

    "; + } +} \ No newline at end of file diff --git a/backend/src/main/resources/get/style.css b/backend/src/main/resources/get/style.css index b55d59f..6f3ae61 100644 --- a/backend/src/main/resources/get/style.css +++ b/backend/src/main/resources/get/style.css @@ -295,11 +295,11 @@ footer a { } .appunti-style h1, .appunti-style h2, .appunti-style h3 { - color: #4db8ff; /* Il blu "CryptoSeals" */ + color: #4db8ff; margin-top: 1.5em; } -/* Stile per i blocchi di codice (molto comuni in crittografia) */ +/* Stile per i blocchi di codice */ .appunti-style pre { background: #000; padding: 15px;