fixed code
This commit is contained in:
+233
-195
@@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="it">
|
<html lang="it">
|
||||||
|
<!-- ciao curiosone, come potrai ben capire questo codice è stato fatto in 10 minuti con gemini. questa cosa pessima è stata fatta da Renato, se vuoi scrivigli in privato che ha fatto una cosa pessima! -->
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
@@ -7,255 +8,292 @@
|
|||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--bg-dark: #d6cf1a;
|
--bg-dark: #d6cf1a;
|
||||||
--stripe-color: #21c23e;
|
--stripe: #21c23e;
|
||||||
--card-bg: rgba(28, 28, 30, 0.9);
|
--card-bg: rgba(28, 28, 30, 0.9);
|
||||||
--card-inner-bg: #2c2c2e;
|
--card-in: #2c2c2e;
|
||||||
--text-main: #f5f5f7;
|
--txt: #f5f5f7;
|
||||||
--text-secondary: #86868b;
|
--txt-mute: #a1a1a6;
|
||||||
--text-label: #98989d;
|
--txt-lbl: #98989d;
|
||||||
--accent-color: #0a84ff;
|
--accent: #0a84ff;
|
||||||
--border-color: #38383a;
|
--border: #38383a;
|
||||||
|
--danger: #ff453a;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 25vh 5vw 5vh;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
font-family: system-ui, -apple-system, sans-serif;
|
||||||
color: var(--text-main);
|
color: var(--txt);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: "";
|
content: "";
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
background-color: var(--bg-dark);
|
background: var(--bg-dark) repeating-linear-gradient(10deg, transparent, transparent 0.9rem, var(--stripe) 7.5rem, var(--stripe) 0.9rem);
|
||||||
background-image: repeating-linear-gradient(10deg, transparent, transparent 14px, var(--stripe-color) 120px, var(--stripe-color) 14px);
|
|
||||||
filter: brightness(0.4);
|
filter: brightness(0.4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-container {
|
main {
|
||||||
background-color: var(--card-bg);
|
|
||||||
backdrop-filter: blur(12px);
|
|
||||||
-webkit-backdrop-filter: blur(12px);
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 450px;
|
max-width: 56rem;
|
||||||
padding: 20px 30px;
|
display: flex;
|
||||||
border-radius: 24px;
|
flex-direction: column;
|
||||||
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
|
gap: 2rem;
|
||||||
text-align: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin: 20px;
|
|
||||||
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
||||||
|
|
||||||
&.show h1 {
|
> section:first-of-type {
|
||||||
display: none;
|
background: var(--card-bg);
|
||||||
}
|
backdrop-filter: blur(12px);
|
||||||
|
max-width: 28rem;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 1.5rem 2rem;
|
||||||
|
border-radius: 1.5rem;
|
||||||
|
box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.5);
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 28px;
|
font-size: 1.75rem;
|
||||||
font-weight: 600;
|
margin: 0 0 1.25rem;
|
||||||
letter-spacing: -0.5px;
|
|
||||||
margin: 0 0 25px 0;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.result-wrapper {
|
|
||||||
max-height: 0;
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(10px) scale(0.95);
|
|
||||||
overflow: hidden;
|
|
||||||
transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
||||||
|
|
||||||
&.show {
|
|
||||||
max-height: 500px;
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0) scale(1);
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.turno-title {
|
input {
|
||||||
font-size: 32px;
|
width: 80%;
|
||||||
font-weight: 700;
|
padding: 0.75rem 1rem;
|
||||||
letter-spacing: -0.5px;
|
font-size: 1.35rem;
|
||||||
color: #ffffff;
|
color: #fff;
|
||||||
margin-bottom: 20px;
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 1rem;
|
||||||
|
outline: none;
|
||||||
|
transition: 0.3s ease;
|
||||||
|
text-align: center;
|
||||||
|
text-transform: uppercase;
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--accent);
|
||||||
|
box-shadow: 0 0 0 0.25rem rgba(10, 132, 255, 0.2);
|
||||||
|
background: #1a1a1c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-card {
|
output {
|
||||||
background-color: var(--card-inner-bg);
|
display: block;
|
||||||
border-radius: 20px;
|
max-height: 0;
|
||||||
width: fit-content;
|
opacity: 0;
|
||||||
margin: 0 auto;
|
transform: translateY(-0.6rem) scale(0.95);
|
||||||
padding: 1rem 2.4rem;
|
overflow: hidden;
|
||||||
display: flex;
|
transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||||
flex-direction: column;
|
|
||||||
gap: 25px;
|
|
||||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
|
|
||||||
.info-block {
|
&.show {
|
||||||
|
max-height: 31rem;
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0) scale(1);
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 2rem;
|
||||||
|
margin: 0 0 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl {
|
||||||
|
background: var(--card-in);
|
||||||
|
border-radius: 1.25rem;
|
||||||
|
width: max-content;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 1rem 1.5rem;
|
||||||
|
border: 1px solid var(--border);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
gap: 1.5rem;
|
||||||
gap: 8px;
|
|
||||||
|
|
||||||
.info-label {
|
div {
|
||||||
font-size: 12px;
|
display: flex;
|
||||||
font-weight: 700;
|
flex-direction: column;
|
||||||
color: var(--text-label);
|
gap: 0.5rem;
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.8px;
|
|
||||||
margin-bottom: -3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-badge {
|
dt {
|
||||||
background-color: var(--accent-color);
|
font-size: 0.75rem;
|
||||||
color: #ffffff;
|
font-weight: 700;
|
||||||
padding: 8px 24px;
|
color: var(--txt-lbl);
|
||||||
border-radius: 16px;
|
letter-spacing: 0.05em;
|
||||||
font-size: 16px; /* Ridotto leggermente per i testi più lunghi */
|
}
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: 0.3px;
|
|
||||||
text-align: center; /* Aggiunto per gestire i rientri del testo */
|
|
||||||
|
|
||||||
&.luogo-badge {
|
dd {
|
||||||
background-color: #30d158;
|
margin: 0;
|
||||||
|
background: var(--accent);
|
||||||
|
padding: 0.5rem 1.5rem;
|
||||||
|
border-radius: 1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
&.green { background: #30d158; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: var(--danger);
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> section:last-of-type {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 1.25rem;
|
||||||
|
|
||||||
|
article {
|
||||||
|
background: var(--card-bg);
|
||||||
|
backdrop-filter: blur(12px);
|
||||||
|
border-radius: 1.25rem;
|
||||||
|
padding: 1.5rem;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||||
|
box-shadow: 0 0.6rem 1.8rem rgba(0, 0, 0, 0.3);
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
font-size: 1.05rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: var(--txt-mute);
|
||||||
|
|
||||||
|
span { color: var(--danger); font-weight: 600; }
|
||||||
|
}
|
||||||
|
|
||||||
|
&.full {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
background: rgba(44, 44, 46, 0.95);
|
||||||
|
border-color: var(--accent);
|
||||||
|
|
||||||
|
ul {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
li {
|
||||||
|
background: rgba(0,0,0,0.2);
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: 0.75rem;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
border: 1px solid rgba(255,255,255,0.03);
|
||||||
|
|
||||||
|
strong {
|
||||||
|
display: block;
|
||||||
|
color: var(--txt-lbl);
|
||||||
|
font-size: 0.75rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin-bottom: 0.3rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.not-found {
|
|
||||||
color: #ff453a;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.input-group {
|
@media (max-width: 48em) {
|
||||||
position: relative;
|
main > section:last-of-type {
|
||||||
display: flex;
|
grid-template-columns: 1fr;
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
input[type="text"] {
|
|
||||||
width: 75%;
|
|
||||||
padding: 10px 16px;
|
|
||||||
font-size: 22px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #ffffff;
|
|
||||||
border-color: var(--accent-color);
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: 16px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
outline: none;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
text-align: center;
|
|
||||||
text-transform: uppercase;
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
border-color: var(--accent-color);
|
|
||||||
box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2);
|
|
||||||
background-color: #1a1a1c;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::placeholder {
|
|
||||||
color: #636366;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="main-container">
|
<main>
|
||||||
<h1>Il tuo turno</h1>
|
<section>
|
||||||
|
<h1>Il tuo turno</h1>
|
||||||
|
<input type="text" id="srch" placeholder="Cognome" autocomplete="off" spellcheck="false">
|
||||||
|
<output></output>
|
||||||
|
</section>
|
||||||
|
|
||||||
<div class="result-wrapper"></div>
|
<section>
|
||||||
|
<article>
|
||||||
|
<h3>Documenti e Accesso</h3>
|
||||||
|
<p>Si raccomanda di presentarsi muniti di un <strong>documento di riconoscimento</strong> in corso di validità e nel rispetto del proprio orario di convocazione.</p>
|
||||||
|
</article>
|
||||||
|
|
||||||
<div class="input-group">
|
<article>
|
||||||
<input type="text" class="cognome-input" placeholder="Cognome" autocomplete="off" spellcheck="false">
|
<h3>Durante la prova</h3>
|
||||||
</div>
|
<p><span>Non riavviare o chiudere la pagina</span> durante l'esame per nessun motivo. Mantenere la finestra sempre attiva.</p>
|
||||||
</div>
|
</article>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<h3>Al termine</h3>
|
||||||
|
<p>Una volta finito l'esame, <strong>avvisa il professore e aspetta che venga segnato il risultato</strong> prima di chiudere la pagina!</p>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article class="full">
|
||||||
|
<h3>Regole e Valutazione</h3>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Durata stimata</strong> 45 Minuti</li>
|
||||||
|
<li><strong>Punteggio Minimo</strong> 12 / 20</li>
|
||||||
|
<li><strong>Risposte</strong> 1 sola corretta per domanda</li>
|
||||||
|
<li><strong>Attribuzione Punti</strong> +1 (corretta)<br>0 (errata / non data)</li>
|
||||||
|
</ul>
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Configurazione con aule aggiornate "Palazzo delle Aule"
|
const turni = [
|
||||||
const configurazioneTurni = [
|
{ t: "I TURNO", ora: "09:00 - 10:00", aula: "Aula 2 Palazzo delle Aule", da: "A", a: "CAR" },
|
||||||
{turno: "I TURNO", orario: "09:00 - 10:00", aula: "Aula 2 Palazzo delle Aule", da: "A", a: "CAR"},
|
{ t: "II TURNO", ora: "09:15 - 10:15", aula: "Aula 4 Palazzo delle Aule", da: "CAS", a: "DIA" },
|
||||||
{turno: "II TURNO", orario: "09:15 - 10:15", aula: "Aula 4 Palazzo delle Aule", da: "CAS", a: "DIA"},
|
{ t: "III TURNO", ora: "10:00 - 11:00", aula: "Aula 2 Palazzo delle Aule", da: "DIB", a: "LAR" },
|
||||||
{turno: "III TURNO", orario: "10:00 - 11:00", aula: "Aula 2 Palazzo delle Aule", da: "DIB", a: "LAR"},
|
{ t: "IV TURNO", ora: "10:15 - 11:15", aula: "Aula 4 Palazzo delle Aule", da: "LAS", a: "MUC" },
|
||||||
{turno: "IV TURNO", orario: "10:15 - 11:15", aula: "Aula 4 Palazzo delle Aule", da: "LAS", a: "MUC"},
|
{ t: "V TURNO", ora: "11:00 - 12:00", aula: "Aula 2 Palazzo delle Aule", da: "MUR", a: "RO" },
|
||||||
{turno: "V TURNO", orario: "11:00 - 12:00", aula: "Aula 2 Palazzo delle Aule", da: "MUR", a: "RO"},
|
{ t: "VI TURNO", ora: "11:15 - 12:15", aula: "Aula 4 Palazzo delle Aule", da: "RU", a: "Z" }
|
||||||
{turno: "VI TURNO", orario: "11:15 - 12:15", aula: "Aula 4 Palazzo delle Aule", da: "RU", a: "Z"}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const inputElement = document.querySelector('.cognome-input');
|
const inp = document.getElementById('srch');
|
||||||
const resultContainer = document.querySelector('.result-wrapper');
|
const out = document.querySelector('output');
|
||||||
const mainContainer = document.querySelector('.main-container');
|
let delayTimer;
|
||||||
|
|
||||||
inputElement.addEventListener('input', function (e) {
|
inp.addEventListener('input', e => {
|
||||||
const cognomeInserito = e.target.value.trim().toUpperCase();
|
clearTimeout(delayTimer);
|
||||||
|
|
||||||
if (cognomeInserito === "") {
|
delayTimer = setTimeout(() => {
|
||||||
nascondiRisultato();
|
const val = e.target.value.trim().toUpperCase();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const turnoTrovato = configurazioneTurni.find(fascia => {
|
if (!val) {
|
||||||
const da = fascia.da.toUpperCase();
|
out.classList.remove('show');
|
||||||
const a = fascia.a.toUpperCase() + "ZZZ";
|
setTimeout(() => out.innerHTML = "", 500);
|
||||||
return cognomeInserito >= da && cognomeInserito <= a;
|
return;
|
||||||
});
|
|
||||||
|
|
||||||
if (turnoTrovato) {
|
|
||||||
mostraRisultato(turnoTrovato);
|
|
||||||
} else {
|
|
||||||
mostraNonTrovato();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function mostraRisultato(dati) {
|
|
||||||
resultContainer.innerHTML = `
|
|
||||||
<div class="turno-title">${dati.turno}</div>
|
|
||||||
<div class="info-card">
|
|
||||||
<div class="info-block">
|
|
||||||
<div class="info-label">ORARIO</div>
|
|
||||||
<div class="info-badge">${dati.orario}</div>
|
|
||||||
</div>
|
|
||||||
<div class="info-block">
|
|
||||||
<div class="info-label">LUOGO</div>
|
|
||||||
<div class="info-badge luogo-badge">${dati.aula}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
mainContainer.classList.add('show');
|
|
||||||
resultContainer.classList.add('show');
|
|
||||||
}
|
|
||||||
|
|
||||||
function mostraNonTrovato() {
|
|
||||||
resultContainer.innerHTML = `
|
|
||||||
<div class="not-found">
|
|
||||||
Nessun turno trovato.
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
resultContainer.classList.add('show');
|
|
||||||
}
|
|
||||||
|
|
||||||
function nascondiRisultato() {
|
|
||||||
mainContainer.classList.remove('show');
|
|
||||||
resultContainer.classList.remove('show');
|
|
||||||
setTimeout(() => {
|
|
||||||
if (!resultContainer.classList.contains('show')) {
|
|
||||||
resultContainer.innerHTML = "";
|
|
||||||
}
|
}
|
||||||
}, 500);
|
|
||||||
}
|
const res = turni.find(f => val >= f.da && val <= f.a + "ZZZ");
|
||||||
|
|
||||||
|
if (res) {
|
||||||
|
out.innerHTML = `
|
||||||
|
<h2>${res.t}</h2>
|
||||||
|
<dl>
|
||||||
|
<div><dt>ORARIO</dt><dd>${res.ora}</dd></div>
|
||||||
|
<div><dt>LUOGO</dt><dd class="green">${res.aula}</dd></div>
|
||||||
|
</dl>
|
||||||
|
`;
|
||||||
|
} else {
|
||||||
|
out.innerHTML = `<p>Nessun turno trovato.</p>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
out.classList.add('show');
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user