From aa90e1ecf8aec25377dd6e0112fc5594ad31078b Mon Sep 17 00:00:00 2001 From: Vichingo455 Date: Thu, 31 Jul 2025 16:14:30 +0200 Subject: [PATCH] Prima commit --- .../decToBinary.html | 23 +++ .../res/script.js | 96 ++++++++++ .../res/style.css | 13 ++ .../index.html | 88 +++++++++ .../calculator.css | 53 ++++++ .../calculator.html | 43 +++++ .../calculator.js | 59 ++++++ .../CalcolatricePluriOperazione.html | 122 +++++++++++++ .../ConversioneDecimaleBinario.html | 98 ++++++++++ .../ConversioneDecimaleEsadecimale.html | 59 ++++++ .../ConversioneDecimaleOttale.html | 46 +++++ .../ConversioniConRadio.html | 121 +++++++++++++ ...Decimale a Binario-Ottale-Esadecimale.html | 88 +++++++++ .../Decimale a Binario.html | 94 ++++++++++ .../Esempio radioButton.html | 26 +++ .../Esercizio2Stringhe.html | 69 +++++++ .../EsercizioStringhe.html | 77 ++++++++ .../GeneratorePassword.html | 171 ++++++++++++++++++ .../addition_of_binaries.html | 94 ++++++++++ .../esercizio2.html | 41 +++++ .../parity_code.html | 107 +++++++++++ .../Esercizio2Stringhe.html | 69 +++++++ .../EsercizioStringhe.html | 77 ++++++++ .../GeneratorePassword.html | 171 ++++++++++++++++++ .../Esercizio1.html | 96 ++++++++++ .../Esercizio2.html | 95 ++++++++++ .../Esercizio3.html | 90 +++++++++ .../EsercizioOmaggio.html | 104 +++++++++++ .../esercizi.js | 152 ++++++++++++++++ .../index.html | 106 +++++++++++ .../EsercizioDadi.html | 37 ++++ .../EsercizioJSCSS.html | 43 +++++ .../esercizi.js | 36 ++++ 3AIN/Pagina Web 2/index.html | 5 + .../Esercizio1.html | 76 ++++++++ .../Esercizio2.html | 61 +++++++ README.md | 4 + 37 files changed, 2810 insertions(+) create mode 100644 3AIN/Convertitore Decimale Binario + C2 Addon/decToBinary.html create mode 100644 3AIN/Convertitore Decimale Binario + C2 Addon/res/script.js create mode 100644 3AIN/Convertitore Decimale Binario + C2 Addon/res/style.css create mode 100644 3AIN/Convertitore da Decimale a Binario-Ottale-Esadecimale/index.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.css create mode 100644 3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.js create mode 100644 3AIN/Esercizi TPS JavaScript Misti/CalcolatricePluriOperazione.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleBinario.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleEsadecimale.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleOttale.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/ConversioniConRadio.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/Decimale a Binario-Ottale-Esadecimale.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/Decimale a Binario.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/Esempio radioButton.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/Esercizio2Stringhe.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/EsercizioStringhe.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/GeneratorePassword.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/addition_of_binaries.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/esercizio2.html create mode 100644 3AIN/Esercizi TPS JavaScript Misti/parity_code.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-04-05/Esercizio2Stringhe.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-04-05/EsercizioStringhe.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-04-05/GeneratorePassword.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio1.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio2.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio3.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-04-26/EsercizioOmaggio.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-04-26/esercizi.js create mode 100644 3AIN/Esercizi TPS Vichi per 2025-04-26/index.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-05-03/EsercizioDadi.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-05-03/EsercizioJSCSS.html create mode 100644 3AIN/Esercizi TPS Vichi per 2025-05-03/esercizi.js create mode 100644 3AIN/Pagina Web 2/index.html create mode 100644 3AIN/Verifica TPS JavaScript 22-02-2025/Esercizio1.html create mode 100644 3AIN/Verifica TPS JavaScript 22-02-2025/Esercizio2.html create mode 100644 README.md diff --git a/3AIN/Convertitore Decimale Binario + C2 Addon/decToBinary.html b/3AIN/Convertitore Decimale Binario + C2 Addon/decToBinary.html new file mode 100644 index 0000000..171e33f --- /dev/null +++ b/3AIN/Convertitore Decimale Binario + C2 Addon/decToBinary.html @@ -0,0 +1,23 @@ + + + + + + + Conversione Decimale in Binario + + + +

Convertitore Decimale in Binario

+ + +
+ + +
+ +

Risultato Binario (8 bit):

+
00000000
+ + + diff --git a/3AIN/Convertitore Decimale Binario + C2 Addon/res/script.js b/3AIN/Convertitore Decimale Binario + C2 Addon/res/script.js new file mode 100644 index 0000000..0ed4aff --- /dev/null +++ b/3AIN/Convertitore Decimale Binario + C2 Addon/res/script.js @@ -0,0 +1,96 @@ +let counter = 1; // Easter egg vari +let isDisabled = false; // Limite conversioni +function convertiBinario(numero, isComplemento2, output) { +// var numero = parseInt(document.getElementById('numero').value); +// var isComplemento2 = document.getElementById('complemento2').checked; + let binario = ''; + if (numero == 1337) { // Easter egg hacker + alert("Hai trovato l'easter egg hacker."); + open("https://hackertyper.net/"); + output.innerText = "HACKER"; + return; + } + else if (numero == 737) { // Easter egg Boeing 737 + alert("Hai trovato l'easter egg Boeing 737."); + open("https://it.wikipedia.org/wiki/Boeing_737"); + output.innerText = "I-NEOU"; + return; + } + else if (numero == 380) { // Easter egg Airbus A380 + alert("Hai trovato l'easter egg Airbus A380."); + open("https://it.wikipedia.org/wiki/Airbus_A380"); + output.innerText = "A6-EEU"; + return; + } + else if (numero == 787) { // Easter egg Boeing 787 Dreamliner + alert("Hai trovato l'easter egg Boeing 787 Dreamliner."); + open("https://it.wikipedia.org/wiki/Boeing_787_Dreamliner"); + output.innerText = "EI-NEO"; + return; + } + else if (numero == 747) { // Easter egg Boeing 747 + alert("Hai trovato l'easter egg Boeing 747."); + open("https://it.wikipedia.org/wiki/Boeing_747"); + output.innerHTML = "I-DEMF"; + return; + } + if (isDisabled) { + return; + } + if (isNaN(numero) || numero < -128 || numero > 255) { + alert("Per favore inserisci un numero valido!"); + return; + } + if (isComplemento2 && numero > 127) { + alert("Per favore inserisci un numero minore/uguale a 127 o disabilita il complemento a 2!"); + } + + if (isComplemento2) { + + } else { + let n = numero; + while (n > 0) { + binario = parseInt(binario + (n % 2)); + n = n - (n / 2); + } + binario = reverseString(String(binario)); + } + output.innerText = binario; + // Easter egg varie compagnie aeree + if (counter == 2) { + alert("Hai trovato l'easter egg Neos.") + open("https://neosair.it"); + counter++; + } + else if (counter == 4) { + alert("Hai trovato l'easter egg Emirates."); + open("https://emirates.com"); + counter++; + } + else if (counter == 6) { + alert("Hai trovato l'easter egg Qatar Airways."); + open("https://qatarairways.com"); + counter++; + } + else if (counter == 8) { + alert("Hai trovato l'easter egg ITA Airways."); + open("https://ita-airways.com"); + counter++; + } + else if (counter == 10) { + alert("Grazie per aver usato il convertitore. Per continuare ad usarlo, ricarica la pagina. Cliccando Ok inoltre troverai un ulteriore easter egg."); + open("https://www.youtube.com/watch?v=b6Q1ChKJ9S4"); + isDisabled = true; + } + else { + counter++; + } +} + +function reverseString(string){ + let Reversed = ""; + for (let i = string.length; i >= 0; i--) { + Reversed += string[i]; + } + return Reversed; +} \ No newline at end of file diff --git a/3AIN/Convertitore Decimale Binario + C2 Addon/res/style.css b/3AIN/Convertitore Decimale Binario + C2 Addon/res/style.css new file mode 100644 index 0000000..e72e5c6 --- /dev/null +++ b/3AIN/Convertitore Decimale Binario + C2 Addon/res/style.css @@ -0,0 +1,13 @@ +body { + font-family: Arial, sans-serif; + margin: 20px; +} +input, button { + margin: 10px 0; + padding: 10px; + font-size: 16px; +} +#binario { + font-size: 20px; + font-weight: bold; +} \ No newline at end of file diff --git a/3AIN/Convertitore da Decimale a Binario-Ottale-Esadecimale/index.html b/3AIN/Convertitore da Decimale a Binario-Ottale-Esadecimale/index.html new file mode 100644 index 0000000..75ff3fc --- /dev/null +++ b/3AIN/Convertitore da Decimale a Binario-Ottale-Esadecimale/index.html @@ -0,0 +1,88 @@ + + + + + + Convertitore Base 10 a Base 2, 8, 16 + + + + +

Convertitore Base 10 a Base 2, 8, 16

+ + + + + + +
+

Base 2:

+

Base 8:

+

Base 16:

+
+ + + + + diff --git a/3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.css b/3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.css new file mode 100644 index 0000000..fbf9391 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.css @@ -0,0 +1,53 @@ +body { + font-family: Arial, sans-serif; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; + background-color: black; +} + +.calculator { + border: 2px solid #333; + border-radius: 10px; + padding: 20px; + background-color: grey; +} + +.display { + width: 230px; + height: 40px; + margin-bottom: 10px; + text-align: right; + font-size: 20px; + padding: 10px; + background-color: #f4f4f4; + border: 1px solid #ddd; + border-radius: 5px; +} + +.buttons { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 10px; +} + +.button { + padding: 20px; + font-size: 18px; + background-color: #f4f4f4; + border: 1px solid #ddd; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; +} + +.button:hover { + background-color: #ddd; +} + +.button:active { + background-color: #ccc; +} + diff --git a/3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.html b/3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.html new file mode 100644 index 0000000..dc7d5f9 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.html @@ -0,0 +1,43 @@ + + + + + + Calculator + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+
+ + + + + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.js b/3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.js new file mode 100644 index 0000000..919b78e --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/Calcolatrice mono-operazione HTML/calculator.js @@ -0,0 +1,59 @@ +let currentInput = ''; +let previousInput = ''; +let operator = null; + +function appendToDisplay(value) { + currentInput += value; + document.getElementById('display').value = currentInput; +} + +function setOperation(op) { + if (currentInput === '') return; + if (previousInput !== '') { + calculateResult(); + } + operator = op; + previousInput = currentInput; + currentInput = ''; + + const operationButtons = document.querySelectorAll('.button'); + operationButtons.forEach(button => button.classList.remove('active')); + + const activeButton = document.getElementById(op); + if (activeButton) { + activeButton.classList.add('active'); + } +} + +function calculateResult() { + if (previousInput === '' || currentInput === '') return; + let result; + const prev = parseFloat(previousInput); + const current = parseFloat(currentInput); + if (operator === '+') { + result = prev + current; + } else if (operator === '-') { + result = prev - current; + } else if (operator === '*') { + result = prev * current; + } else if (operator === '/') { + if (current === 0) { + alert("Errore: divisione per zero!"); + return; + } + result = prev / current; + } + document.getElementById('display').value = result; + currentInput = result.toString(); + previousInput = ''; +} + +function clearDisplay() { + currentInput = ''; + previousInput = ''; + operator = null; + document.getElementById('display').value = ''; + + const operationButtons = document.querySelectorAll('.button'); + operationButtons.forEach(button => button.classList.remove('active')); +} \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/CalcolatricePluriOperazione.html b/3AIN/Esercizi TPS JavaScript Misti/CalcolatricePluriOperazione.html new file mode 100644 index 0000000..d5b08f1 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/CalcolatricePluriOperazione.html @@ -0,0 +1,122 @@ + + + + + + + + Calcolatrice Pluri-Operazione + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleBinario.html b/3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleBinario.html new file mode 100644 index 0000000..74d3310 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleBinario.html @@ -0,0 +1,98 @@ + + + + + + + + Conversione da decimale a binario + + +

Numero in Base 10:

+
+ +
+

+ + + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleEsadecimale.html b/3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleEsadecimale.html new file mode 100644 index 0000000..8c6cb64 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleEsadecimale.html @@ -0,0 +1,59 @@ + + + + + + + + Conversione da decimale a esidecimale + + +

Numero in Base 10:

+
+

+ + + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleOttale.html b/3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleOttale.html new file mode 100644 index 0000000..7e7018c --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/ConversioneDecimaleOttale.html @@ -0,0 +1,46 @@ + + + + + + + + Conversione da decimale a ottale + + +

Numero in Base 10:

+
+

+ + + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/ConversioniConRadio.html b/3AIN/Esercizi TPS JavaScript Misti/ConversioniConRadio.html new file mode 100644 index 0000000..9d68b57 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/ConversioniConRadio.html @@ -0,0 +1,121 @@ + + + + + + + + Conversioni numeriche + + +

Conversioni tra basi numeriche

+
+ +
+ +
+ +
+

+

+ + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/Decimale a Binario-Ottale-Esadecimale.html b/3AIN/Esercizi TPS JavaScript Misti/Decimale a Binario-Ottale-Esadecimale.html new file mode 100644 index 0000000..75ff3fc --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/Decimale a Binario-Ottale-Esadecimale.html @@ -0,0 +1,88 @@ + + + + + + Convertitore Base 10 a Base 2, 8, 16 + + + + +

Convertitore Base 10 a Base 2, 8, 16

+ + + + + + +
+

Base 2:

+

Base 8:

+

Base 16:

+
+ + + + + diff --git a/3AIN/Esercizi TPS JavaScript Misti/Decimale a Binario.html b/3AIN/Esercizi TPS JavaScript Misti/Decimale a Binario.html new file mode 100644 index 0000000..0867036 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/Decimale a Binario.html @@ -0,0 +1,94 @@ + + + + Dec/Bin conversione + + + +

Convertitore Decimale / Binario

+ + Valore decimale:
+
+
+ + C2
+
+
+ + + +

Non in C2:

+

+ + + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/Esempio radioButton.html b/3AIN/Esercizi TPS JavaScript Misti/Esempio radioButton.html new file mode 100644 index 0000000..8bf0378 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/Esempio radioButton.html @@ -0,0 +1,26 @@ + + + + + + +
+ +
+ +
+ +
+

+ + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/Esercizio2Stringhe.html b/3AIN/Esercizi TPS JavaScript Misti/Esercizio2Stringhe.html new file mode 100644 index 0000000..3d6186b --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/Esercizio2Stringhe.html @@ -0,0 +1,69 @@ + + + + + + + Confronto Stringhe + + + +

Confronto stringhe

+
+
+ +
+ + + diff --git a/3AIN/Esercizi TPS JavaScript Misti/EsercizioStringhe.html b/3AIN/Esercizi TPS JavaScript Misti/EsercizioStringhe.html new file mode 100644 index 0000000..88a6804 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/EsercizioStringhe.html @@ -0,0 +1,77 @@ + + + + + + + Conta Occorrenze Lettere + + + +

Conta le Occorrenze delle Lettere

+ +
+ +
+ +

Occorrenze delle Lettere

+ + + + + + + + + +
LetteraOccorrenze
+ + + diff --git a/3AIN/Esercizi TPS JavaScript Misti/GeneratorePassword.html b/3AIN/Esercizi TPS JavaScript Misti/GeneratorePassword.html new file mode 100644 index 0000000..1fa8b87 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/GeneratorePassword.html @@ -0,0 +1,171 @@ + + + + + + + Generatore di Password + + + +
+

Generatore Password

+
+ +
+
+
+
+
+ +
+ +
+
Copyright © Manuel Vichi
+
+ + + diff --git a/3AIN/Esercizi TPS JavaScript Misti/addition_of_binaries.html b/3AIN/Esercizi TPS JavaScript Misti/addition_of_binaries.html new file mode 100644 index 0000000..9e35b73 --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/addition_of_binaries.html @@ -0,0 +1,94 @@ + + + + + + + + Calcolo della Somma Binaria + + + +
+

Somma tra due numeri binari

+ +

Primo numero binario:

+ +

Secondo numero binario:

+ + + +

Risultato:

+

Somma binaria:

+
+ + + + + + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/esercizio2.html b/3AIN/Esercizi TPS JavaScript Misti/esercizio2.html new file mode 100644 index 0000000..69d5c0a --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/esercizio2.html @@ -0,0 +1,41 @@ + + + + Verifica Bit di parità + + +

Verifica Bit di parità

+ +
+ +
+

Risultato

+

...

+ + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS JavaScript Misti/parity_code.html b/3AIN/Esercizi TPS JavaScript Misti/parity_code.html new file mode 100644 index 0000000..9b5d51e --- /dev/null +++ b/3AIN/Esercizi TPS JavaScript Misti/parity_code.html @@ -0,0 +1,107 @@ + + + + + + + + Calcolo del Codice di Parità + + + +
+

Calcolo del Codice di Parità tra due numeri binari di 8 bit

+ +

I due numeri che inserirai qui sotto dovranno essere lunghi obbligatoriamente 8 bit.

+ +

Primo numero binario:

+ +

Secondo numero binario:

+ + + +

Risultato:

+

Bit di parità orizzontale per il primo numero binario:
Bit di parità orizzontale per il secondo numero binario

Byte di parità verticale:

Parità del primo numero binario:
Parità del secondo numero binario:

+

+ + + + + + + \ No newline at end of file diff --git a/3AIN/Esercizi TPS Vichi per 2025-04-05/Esercizio2Stringhe.html b/3AIN/Esercizi TPS Vichi per 2025-04-05/Esercizio2Stringhe.html new file mode 100644 index 0000000..3d6186b --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-04-05/Esercizio2Stringhe.html @@ -0,0 +1,69 @@ + + + + + + + Confronto Stringhe + + + +

Confronto stringhe

+
+
+ +
+ + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-04-05/EsercizioStringhe.html b/3AIN/Esercizi TPS Vichi per 2025-04-05/EsercizioStringhe.html new file mode 100644 index 0000000..88a6804 --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-04-05/EsercizioStringhe.html @@ -0,0 +1,77 @@ + + + + + + + Conta Occorrenze Lettere + + + +

Conta le Occorrenze delle Lettere

+ +
+ +
+ +

Occorrenze delle Lettere

+ + + + + + + + + +
LetteraOccorrenze
+ + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-04-05/GeneratorePassword.html b/3AIN/Esercizi TPS Vichi per 2025-04-05/GeneratorePassword.html new file mode 100644 index 0000000..1fa8b87 --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-04-05/GeneratorePassword.html @@ -0,0 +1,171 @@ + + + + + + + Generatore di Password + + + +
+

Generatore Password

+
+ +
+
+
+
+
+ +
+ +
+
Copyright © Manuel Vichi
+
+ + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio1.html b/3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio1.html new file mode 100644 index 0000000..c74636a --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio1.html @@ -0,0 +1,96 @@ + + + + + Trova la parola più lunga in una frase + + + +

Trova la parola più lunga in una frase

+
+ + +
+
+ + + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio2.html b/3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio2.html new file mode 100644 index 0000000..e525f31 --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio2.html @@ -0,0 +1,95 @@ + + + + + Ordinatore di Numeri + + + + +

Ordina Numeri Reali

+
+ + +

+ + + + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio3.html b/3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio3.html new file mode 100644 index 0000000..bea7819 --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-04-26/Esercizio3.html @@ -0,0 +1,90 @@ + + + + + Generatore di Acronimi + + + + +
+

Generatore di Acronimi

+ + +
+
+ + + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-04-26/EsercizioOmaggio.html b/3AIN/Esercizi TPS Vichi per 2025-04-26/EsercizioOmaggio.html new file mode 100644 index 0000000..dc7f988 --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-04-26/EsercizioOmaggio.html @@ -0,0 +1,104 @@ + + + + + Verifica Palindromo + + + + +
+

Verifica se una frase è palindroma

+ + +
+
+ + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-04-26/esercizi.js b/3AIN/Esercizi TPS Vichi per 2025-04-26/esercizi.js new file mode 100644 index 0000000..9fd07de --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-04-26/esercizi.js @@ -0,0 +1,152 @@ +function esercizio1() { + const text = document.getElementById("textInput").value; + const words = text + .toLowerCase() + .replace(/[^\w\sàèéìòù]/g, '') + .split(/\s+/) + .filter(word => word.length > 0); + if (words.length === 0) { + document.getElementById("longestWordResult").textContent = "Nessuna parola trovata."; + document.getElementById("wordOccurrences").textContent = ""; + return; + } + let longestWord = words.reduce((a, b) => (b.length > a.length ? b : a)); + const occurrences = {}; + for (let word of words) { + occurrences[word] = (occurrences[word] || 0) + 1; + } + document.getElementById("longestWordResult").textContent = + "🔍 Parola più lunga: " + longestWord; + + let occHTML = "

📊 Occorrenze delle parole:

"; + document.getElementById("wordOccurrences").innerHTML = occHTML; +} +function esercizio2() { + const input = document.getElementById('numberInput').value; + const numeri = input + .split(';') + .map(n => parseFloat(n.trim())) + .filter(n => !isNaN(n)); + const output = document.getElementById('output'); + if (numeri.length === 0) { + output.textContent = "⚠️ Nessun numero valido inserito."; + return; + } + numeri.sort((a, b) => a - b); + output.textContent = "✅ Numeri ordinati: " + numeri.join(', '); +} +function esercizio3() { + const testo = document.getElementById("inputText").value; + const parole = testo.trim().split(/\s+/); + let acronimo = ""; + + for (let parola of parole) { + if (parola.length > 0) { + acronimo += parola[0].toUpperCase(); + } + } + + document.getElementById("acronym").textContent = acronimo ? "Acronimo: " + acronimo : ""; +} +function isPalindroma(frase) { + const pulita = frase.toLowerCase().replace(/[^a-z0-9]/gi, ''); + const invertita = pulita.split('').reverse().join(''); + return pulita === invertita; +} + +function esercizioOmaggio() { + const input = document.getElementById('inputFrase').value.trim(); + const risultatoDiv = document.getElementById('risultato'); + + if (!input) { + risultatoDiv.textContent = "⚠️ Inserisci una frase!"; + risultatoDiv.className = 'negativo'; + return; + } + + if (isPalindroma(input)) { + risultatoDiv.textContent = "✅ La frase è palindroma!"; + risultatoDiv.className = 'positivo'; + } else { + risultatoDiv.textContent = "❌ La frase NON è palindroma."; + risultatoDiv.className = 'negativo'; + } +} + +//Funzioni per prevenire la copia +document.oncontextmenu = document.body.oncontextmenu = function() { + document.write(` + Right click is not allowed on this site! Reload page! + `); + return false; +}; +function devToolsOpened(e){ + e.preventDefault(); +} +window.addEventListener('keydown', function(e) { + if ( + e.metaKey == true && e.altKey == true && e.keyCode == 73 || + e.metaKey == true && e.altKey == true && e.keyCode == 74 || + e.metaKey == true && e.altKey == true && e.keyCode == 67 || + e.metaKey == true && e.shiftKey == true && e.keyCode == 67 || + e.ctrlKey == true && e.shiftKey == true && e.keyCode == 73 || + e.ctrlKey == true && e.shiftKey == true && e.keyCode == 74 || + e.ctrlKey == true && e.shiftKey == true && e.keyCode == 67 || + e.keyCode == 123 || + e.metaKey == true && e.altKey == true && e.keyCode == 85 || + e.ctrlKey == true && e.keyCode == 85 || + e.ctrlKey == true && e.keyCode == 80 + ){ + devToolsOpened(e); + } +}); +const devtools = { +isOpen: false, +orientation: undefined, +}; + +const threshold = 170; + +const emitEvent = (isOpen, orientation) => { +globalThis.dispatchEvent(new globalThis.CustomEvent('devtoolschange', { + detail: { + isOpen, + orientation, + }, +})); +}; + +const main = ({emitEvents = true} = {}) => { +const widthThreshold = globalThis.outerWidth - globalThis.innerWidth > threshold; +const heightThreshold = globalThis.outerHeight - globalThis.innerHeight > threshold; +const orientation = widthThreshold ? 'vertical' : 'horizontal'; + +if ( + !(heightThreshold && widthThreshold) + && ((globalThis.Firebug && globalThis.Firebug.chrome && globalThis.Firebug.chrome.isInitialized) || widthThreshold || heightThreshold) +) { + if ((!devtools.isOpen || devtools.orientation !== orientation) && emitEvents) { + emitEvent(true, orientation); + } + + devtools.isOpen = true; + devtools.orientation = orientation; +} else { + if (devtools.isOpen && emitEvents) { + emitEvent(false, undefined); + } + + devtools.isOpen = false; + devtools.orientation = undefined; +} +}; +setInterval(main, 500); + window.addEventListener('devtoolschange', event => { + document.write(` + Please close DevTools, then reload the page! + `); + }); \ No newline at end of file diff --git a/3AIN/Esercizi TPS Vichi per 2025-04-26/index.html b/3AIN/Esercizi TPS Vichi per 2025-04-26/index.html new file mode 100644 index 0000000..22f97c5 --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-04-26/index.html @@ -0,0 +1,106 @@ + + + + + Esercizi TPS Vichi per 2025-04-26 + + + + +
+

💡 Esercizi TPS Vichi per 2025-04-26

+ +
+ Creato da Manuel Vichi +
+
+ + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-05-03/EsercizioDadi.html b/3AIN/Esercizi TPS Vichi per 2025-05-03/EsercizioDadi.html new file mode 100644 index 0000000..8970d12 --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-05-03/EsercizioDadi.html @@ -0,0 +1,37 @@ + + + + + Lancio dei Dadi + + + + +

Simulatore Lancio Dadi

+ +
+
+ +
+
+ + + +
+ + + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-05-03/EsercizioJSCSS.html b/3AIN/Esercizi TPS Vichi per 2025-05-03/EsercizioJSCSS.html new file mode 100644 index 0000000..ae583fe --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-05-03/EsercizioJSCSS.html @@ -0,0 +1,43 @@ + + + + + Cambia Colore Testo + + + + +

Cambia il colore del testo

+ +
+ + + + + + + diff --git a/3AIN/Esercizi TPS Vichi per 2025-05-03/esercizi.js b/3AIN/Esercizi TPS Vichi per 2025-05-03/esercizi.js new file mode 100644 index 0000000..0f3b7de --- /dev/null +++ b/3AIN/Esercizi TPS Vichi per 2025-05-03/esercizi.js @@ -0,0 +1,36 @@ +function esercizio1() { + const textarea = document.getElementById('textArea'); + const coloreSelezionato = document.getElementById('colorSelect').value; + textarea.style.color = coloreSelezionato; +} +function esercizio2() { + const numDadi = parseInt(document.getElementById('numDadi').value); + const numFacce = parseInt(document.getElementById('numFacce').value); + const risultati = []; + for (let i = 0; i < numDadi; i++) { + const risultato = Math.floor(Math.random() * numFacce) + 1; + risultati.push(risultato); + } + const somma = risultati.reduce((acc, val) => acc + val, 0); + const media = somma / risultati.length; + const conteggi = {}; + risultati.forEach(val => { + conteggi[val] = (conteggi[val] || 0) + 1; + }); + + let moda = risultati[0]; + let maxContatore = conteggi[moda]; + + for (const numero in conteggi) { + if (conteggi[numero] > maxContatore) { + moda = numero; + maxContatore = conteggi[numero]; + } + } + const resultsDiv = document.getElementById('results'); + resultsDiv.innerHTML = ` + Risultati: ${risultati.join(', ')}
+ Media: ${media.toFixed(2)}
+ Moda: ${moda} + `; +} \ No newline at end of file diff --git a/3AIN/Pagina Web 2/index.html b/3AIN/Pagina Web 2/index.html new file mode 100644 index 0000000..9f600e2 --- /dev/null +++ b/3AIN/Pagina Web 2/index.html @@ -0,0 +1,5 @@ + + + Pagina + + \ No newline at end of file diff --git a/3AIN/Verifica TPS JavaScript 22-02-2025/Esercizio1.html b/3AIN/Verifica TPS JavaScript 22-02-2025/Esercizio1.html new file mode 100644 index 0000000..77a817c --- /dev/null +++ b/3AIN/Verifica TPS JavaScript 22-02-2025/Esercizio1.html @@ -0,0 +1,76 @@ + + + + + + + Generatore Bit di Parita' + + + +

Generatore bit di parita'

+ + + +

+ + +
+ + +

+ + +
+

Risultato parita':

+
+ + + \ No newline at end of file diff --git a/3AIN/Verifica TPS JavaScript 22-02-2025/Esercizio2.html b/3AIN/Verifica TPS JavaScript 22-02-2025/Esercizio2.html new file mode 100644 index 0000000..ceea57b --- /dev/null +++ b/3AIN/Verifica TPS JavaScript 22-02-2025/Esercizio2.html @@ -0,0 +1,61 @@ + + + + + + + Convertitore Base 10 a Base 16 + + + +

Convertitore Base 10 a base 16

+ + + +

In caso di numero decimale esso viene automaticamente arrotondato.

+ + + +
+

Base 16:

+
+ + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..b38e230 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Pagine HTML fatte a scuola +Pagine HTML fatte a scuola da me + +Questa repository è fornita così com'è a scopo didattico. Fanne buon uso. \ No newline at end of file