262 lines
8.8 KiB
HTML
262 lines
8.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>TURNI DEL TEST</title>
|
|
<style>
|
|
:root {
|
|
--bg-dark: #d6cf1a;
|
|
--stripe-color: #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;
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
color: var(--text-main);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: 100vh;
|
|
|
|
&::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);
|
|
filter: brightness(0.4);
|
|
}
|
|
}
|
|
|
|
.main-container {
|
|
background-color: var(--card-bg);
|
|
backdrop-filter: blur(12px);
|
|
-webkit-backdrop-filter: blur(12px);
|
|
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);
|
|
|
|
&.show h1 {
|
|
display: none;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
.turno-title {
|
|
font-size: 32px;
|
|
font-weight: 700;
|
|
letter-spacing: -0.5px;
|
|
color: #ffffff;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.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);
|
|
|
|
.info-block {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 8px;
|
|
|
|
.info-label {
|
|
font-size: 12px;
|
|
font-weight: 700;
|
|
color: var(--text-label);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.8px;
|
|
margin-bottom: -3px;
|
|
}
|
|
|
|
.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 */
|
|
|
|
&.luogo-badge {
|
|
background-color: #30d158;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="main-container">
|
|
<h1>Il tuo turno</h1>
|
|
|
|
<div class="result-wrapper"></div>
|
|
|
|
<div class="input-group">
|
|
<input type="text" class="cognome-input" placeholder="Cognome" autocomplete="off" spellcheck="false">
|
|
</div>
|
|
</div>
|
|
|
|
<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 inputElement = document.querySelector('.cognome-input');
|
|
const resultContainer = document.querySelector('.result-wrapper');
|
|
const mainContainer = document.querySelector('.main-container');
|
|
|
|
inputElement.addEventListener('input', function (e) {
|
|
const cognomeInserito = e.target.value.trim().toUpperCase();
|
|
|
|
if (cognomeInserito === "") {
|
|
nascondiRisultato();
|
|
return;
|
|
}
|
|
|
|
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 = "";
|
|
}
|
|
}, 500);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|