fixed code
This commit is contained in:
+233
-195
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<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>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -7,255 +8,292 @@
|
||||
<style>
|
||||
:root {
|
||||
--bg-dark: #d6cf1a;
|
||||
--stripe-color: #21c23e;
|
||||
--stripe: #21c23e;
|
||||
--card-bg: rgba(28, 28, 30, 0.9);
|
||||
--card-inner-bg: #2c2c2e;
|
||||
--text-main: #f5f5f7;
|
||||
--text-secondary: #86868b;
|
||||
--text-label: #98989d;
|
||||
--accent-color: #0a84ff;
|
||||
--border-color: #38383a;
|
||||
--card-in: #2c2c2e;
|
||||
--txt: #f5f5f7;
|
||||
--txt-mute: #a1a1a6;
|
||||
--txt-lbl: #98989d;
|
||||
--accent: #0a84ff;
|
||||
--border: #38383a;
|
||||
--danger: #ff453a;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
color: var(--text-main);
|
||||
padding: 25vh 5vw 5vh;
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
color: var(--txt);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
box-sizing: border-box;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
background-color: var(--bg-dark);
|
||||
background-image: repeating-linear-gradient(10deg, transparent, transparent 14px, var(--stripe-color) 120px, var(--stripe-color) 14px);
|
||||
background: var(--bg-dark) repeating-linear-gradient(10deg, transparent, transparent 0.9rem, var(--stripe) 7.5rem, var(--stripe) 0.9rem);
|
||||
filter: brightness(0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.main-container {
|
||||
background-color: var(--card-bg);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
main {
|
||||
width: 100%;
|
||||
max-width: 450px;
|
||||
padding: 20px 30px;
|
||||
border-radius: 24px;
|
||||
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
margin: 20px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||
max-width: 56rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
|
||||
&.show h1 {
|
||||
display: none;
|
||||
}
|
||||
> section:first-of-type {
|
||||
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 {
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
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;
|
||||
h1 {
|
||||
font-size: 1.75rem;
|
||||
margin: 0 0 1.25rem;
|
||||
}
|
||||
|
||||
.turno-title {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.5px;
|
||||
color: #ffffff;
|
||||
margin-bottom: 20px;
|
||||
input {
|
||||
width: 80%;
|
||||
padding: 0.75rem 1rem;
|
||||
font-size: 1.35rem;
|
||||
color: #fff;
|
||||
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 {
|
||||
background-color: var(--card-inner-bg);
|
||||
border-radius: 20px;
|
||||
width: fit-content;
|
||||
margin: 0 auto;
|
||||
padding: 1rem 2.4rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 25px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
||||
border: 1px solid var(--border-color);
|
||||
output {
|
||||
display: block;
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
transform: translateY(-0.6rem) scale(0.95);
|
||||
overflow: hidden;
|
||||
transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||
|
||||
.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;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: 1.5rem;
|
||||
|
||||
.info-label {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--text-label);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.8px;
|
||||
margin-bottom: -3px;
|
||||
div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.info-badge {
|
||||
background-color: var(--accent-color);
|
||||
color: #ffffff;
|
||||
padding: 8px 24px;
|
||||
border-radius: 16px;
|
||||
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 */
|
||||
dt {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
color: var(--txt-lbl);
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
&.luogo-badge {
|
||||
background-color: #30d158;
|
||||
dd {
|
||||
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 {
|
||||
position: relative;
|
||||
display: flex;
|
||||
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;
|
||||
}
|
||||
}
|
||||
@media (max-width: 48em) {
|
||||
main > section:last-of-type {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="main-container">
|
||||
<h1>Il tuo turno</h1>
|
||||
<main>
|
||||
<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">
|
||||
<input type="text" class="cognome-input" placeholder="Cognome" autocomplete="off" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<article>
|
||||
<h3>Durante la prova</h3>
|
||||
<p><span>Non riavviare o chiudere la pagina</span> durante l'esame per nessun motivo. Mantenere la finestra sempre attiva.</p>
|
||||
</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>
|
||||
// Configurazione con aule aggiornate "Palazzo delle Aule"
|
||||
const configurazioneTurni = [
|
||||
{turno: "I TURNO", orario: "09:00 - 10:00", aula: "Aula 2 Palazzo delle Aule", da: "A", a: "CAR"},
|
||||
{turno: "II TURNO", orario: "09:15 - 10:15", aula: "Aula 4 Palazzo delle Aule", da: "CAS", a: "DIA"},
|
||||
{turno: "III TURNO", orario: "10:00 - 11:00", aula: "Aula 2 Palazzo delle Aule", da: "DIB", a: "LAR"},
|
||||
{turno: "IV TURNO", orario: "10:15 - 11:15", aula: "Aula 4 Palazzo delle Aule", da: "LAS", a: "MUC"},
|
||||
{turno: "V TURNO", orario: "11:00 - 12:00", aula: "Aula 2 Palazzo delle Aule", da: "MUR", a: "RO"},
|
||||
{turno: "VI TURNO", orario: "11:15 - 12:15", aula: "Aula 4 Palazzo delle Aule", da: "RU", a: "Z"}
|
||||
const turni = [
|
||||
{ t: "I TURNO", ora: "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" },
|
||||
{ t: "III TURNO", ora: "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" },
|
||||
{ t: "V TURNO", ora: "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" }
|
||||
];
|
||||
|
||||
const inputElement = document.querySelector('.cognome-input');
|
||||
const resultContainer = document.querySelector('.result-wrapper');
|
||||
const mainContainer = document.querySelector('.main-container');
|
||||
const inp = document.getElementById('srch');
|
||||
const out = document.querySelector('output');
|
||||
let delayTimer;
|
||||
|
||||
inputElement.addEventListener('input', function (e) {
|
||||
const cognomeInserito = e.target.value.trim().toUpperCase();
|
||||
inp.addEventListener('input', e => {
|
||||
clearTimeout(delayTimer);
|
||||
|
||||
if (cognomeInserito === "") {
|
||||
nascondiRisultato();
|
||||
return;
|
||||
}
|
||||
delayTimer = setTimeout(() => {
|
||||
const val = e.target.value.trim().toUpperCase();
|
||||
|
||||
const turnoTrovato = configurazioneTurni.find(fascia => {
|
||||
const da = fascia.da.toUpperCase();
|
||||
const a = fascia.a.toUpperCase() + "ZZZ";
|
||||
return cognomeInserito >= da && cognomeInserito <= a;
|
||||
});
|
||||
|
||||
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 = "";
|
||||
if (!val) {
|
||||
out.classList.remove('show');
|
||||
setTimeout(() => out.innerHTML = "", 500);
|
||||
return;
|
||||
}
|
||||
}, 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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user