From b8f0ba86e1ebd071fa01b3c871d174c25fe61699 Mon Sep 17 00:00:00 2001 From: elisabetta Date: Sat, 28 Mar 2026 11:33:03 +0100 Subject: [PATCH] fix graphic interface again !! --- backend/src/main/resources/get/cesare.html | 25 ++++-- backend/src/main/resources/get/cesare.js | 59 +++++++------ backend/src/main/resources/get/index.html | 2 +- backend/src/main/resources/get/rsa.html | 24 ++++-- backend/src/main/resources/get/rsa.js | 9 +- backend/src/main/resources/get/team.html | 98 ++++++++++++++++++++++ backend/src/main/resources/get/team.js | 6 ++ 7 files changed, 180 insertions(+), 43 deletions(-) create mode 100644 backend/src/main/resources/get/team.html create mode 100644 backend/src/main/resources/get/team.js diff --git a/backend/src/main/resources/get/cesare.html b/backend/src/main/resources/get/cesare.html index 2695b13..c66ccee 100644 --- a/backend/src/main/resources/get/cesare.html +++ b/backend/src/main/resources/get/cesare.html @@ -12,15 +12,17 @@ @@ -47,5 +49,12 @@ + \ No newline at end of file diff --git a/backend/src/main/resources/get/cesare.js b/backend/src/main/resources/get/cesare.js index a008211..278da34 100644 --- a/backend/src/main/resources/get/cesare.js +++ b/backend/src/main/resources/get/cesare.js @@ -1,30 +1,37 @@ async function encrypt() { - const plaintext = document.getElementById("plaintext").value; - const key = document.getElementById("key").value; - - if(!plaintext) return alert("Inserisci del testo!"); + const plaintext = document.getElementById("plaintext").value; + const key = document.getElementById("key").value; - try { - const risposta = await fetch("/seal/cesare/encrypt", { - method: "POST", headers: { "Content-Type": "application/json" }, - // Invia il testo e la chiave (convertita in numero) al server - body: JSON.stringify({ plaintext: plaintext, key: parseInt(key) }) - }); - document.getElementById("ciphertext").value = await risposta.text(); - } catch (e) { alert("Errore di connessione con le API di Cesare!"); } - } + if (!plaintext) return alert("Inserisci del testo!"); - async function decrypt() { - const ciphertext = document.getElementById("ciphertext").value; - const key = document.getElementById("key").value; + try { + const risposta = await fetch("/seal/cesare/encrypt", { + method: "POST", headers: { "Content-Type": "application/json" }, + // Invia il testo e la chiave (convertita in numero) al server + body: JSON.stringify({ plaintext: plaintext, key: parseInt(key) }) + }); + document.getElementById("ciphertext").value = await risposta.text(); + } catch (e) { alert("Errore di connessione con le API di Cesare!"); } +} - if(!ciphertext) return alert("Nessun testo da decifrare!"); - try { - const res = await fetch("/seal/cesare/decrypt", { - method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ testo: ciphertext, chiave: parseInt(key) }) - }); - // TODO: SISTEMARE IL SISTEMA DI DECIFRATURA !! - document.getElementById("testoDecifrato").value = await res.text(); - } catch (e) { alert("Errore di connessione!"); } - } \ No newline at end of file +async function decrypt() { + const ciphertext = document.getElementById("ciphertext").value; + const key = document.getElementById("key").value; + + if (!ciphertext) return alert("Nessun testo da decifrare!"); + try { + const res = await fetch("/seal/cesare/decrypt", { + method: "POST", headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ testo: ciphertext, chiave: parseInt(key) }) + }); + // TODO: SISTEMARE IL SISTEMA DI DECIFRATURA !! + document.getElementById("testoDecifrato").value = await res.text(); + } catch (e) { alert("Errore di connessione!"); } +} + +// Gestione Menu Mobile +function toggleMenu() { + document.getElementById("nav-links").classList.toggle("active"); +} +// Anno dinamico Footer +document.getElementById("year").innerText = new Date().getFullYear(); diff --git a/backend/src/main/resources/get/index.html b/backend/src/main/resources/get/index.html index 64fb8f9..ee2bcbf 100644 --- a/backend/src/main/resources/get/index.html +++ b/backend/src/main/resources/get/index.html @@ -12,7 +12,7 @@