diff --git a/src/client/MediaPesataApp.tsx b/src/client/MediaPesataApp.tsx index a9991b3..03f7be3 100644 --- a/src/client/MediaPesataApp.tsx +++ b/src/client/MediaPesataApp.tsx @@ -186,7 +186,7 @@ const CORSI_DISPONIBILI: Corso[] = [ { nome: 'Ultrafiltri e metodi non-standard', anno: 'M', cfu: 6 }, ] -function MediaPesataApp() { +export function MediaPesataApp() { // Funzioni per localStorage const loadFromStorage = () => { try { @@ -220,13 +220,22 @@ function MediaPesataApp() { } // Inizializzazione con dati salvati - const initialData = loadFromStorage() - const [tipoStudente, setTipoStudente] = useState(initialData.tipoStudente) - const [corsiSelezionati, setCorsiSelezionati] = useState(initialData.corsiSelezionati) + // const initialData = loadFromStorage() + const [tipoStudente, setTipoStudente] = useState('triennale') + const [corsiSelezionati, setCorsiSelezionati] = useState([]) const [showCustomForm, setShowCustomForm] = useState(false) const [customCorso, setCustomCorso] = useState({ nome: '', cfu: 0 }) - const [sezioniAperte, setSezioniAperte] = useState>(initialData.sezioniAperte) - const [mostraRisultati, setMostraRisultati] = useState(initialData.mostraRisultati) + const [sezioniAperte, setSezioniAperte] = useState>({}) + const [mostraRisultati, setMostraRisultati] = useState(false) + + // Load data from localStorage on mount + useEffect(() => { + const initialData = loadFromStorage() + setTipoStudente(initialData.tipoStudente) + setCorsiSelezionati(initialData.corsiSelezionati) + setSezioniAperte(initialData.sezioniAperte) + setMostraRisultati(initialData.mostraRisultati) + }, []) // Salva automaticamente quando cambiano i dati importanti useEffect(() => { @@ -482,15 +491,6 @@ function MediaPesataApp() { } const cambiaTipoStudente = (nuovoTipo: TipoStudente) => { - if (corsiSelezionati.length > 0 && nuovoTipo !== tipoStudente) { - if ( - !confirm( - 'Cambiando il tipo di studente, alcune materie potrebbero non essere più disponibili. Continuare?', - ) - ) { - return - } - } setTipoStudente(nuovoTipo) } @@ -501,217 +501,207 @@ function MediaPesataApp() { const cfuError = totaleCfu > maxCfu return ( -
+
{/* Selezione tipo studente */} -
-

Corso di Laurea

-
- - +
+
+

Corso di Laurea

+
+ + +
{/* Counter CFU */} -
+

CFU Totali: {totaleCfu}/{maxCfu} {tipoStudente === 'triennale' ? ' (+9 tesi)' : ' (+27 tesi)'}

- {cfuError &&

⚠️ Hai superato il limite di CFU consentiti!

} + {cfuError &&

⚠️ Hai superato il limite di CFU consentiti!

}
-
- {/* Sezione selezione corsi */} -
+ {/* Sezione selezione corsi */} +
+

Seleziona Materie

+
- {Object.entries(gruppiCorsi).map(([categoria, corsi]) => ( -
- - - {sezioniAperte[categoria] && ( -
- {corsi.map((corso, index) => ( - - ))} -
- )} -
- ))} - - {/* Form per materia custom */} -
-

Materia Personalizzata

- {!showCustomForm ? ( - - ) : ( -
- - setCustomCorso({ ...customCorso, nome: (e.target as HTMLInputElement).value }) - } - /> - - setCustomCorso({ - ...customCorso, - cfu: parseInt((e.target as HTMLInputElement).value) || 0, - }) - } - /> - - + {Object.entries(gruppiCorsi).map(([categoria, corsi]) => ( +
+ + + {sezioniAperte[categoria] && ( +
+ {corsi.map((corso, index) => ( + + ))}
)}
+ ))} + + {/* Form per materia custom */} +
+

Materia Personalizzata

+ {!showCustomForm ? ( + + ) : ( +
+ + setCustomCorso({ ...customCorso, nome: (e.target as HTMLInputElement).value }) + } + /> + + setCustomCorso({ + ...customCorso, + cfu: parseInt((e.target as HTMLInputElement).value) || 0, + }) + } + /> + + +
+ )}
+
- {/* Sezione lista corsi selezionati */} -
-
+ {/* Sezione lista corsi selezionati */} +
+
+

Materie Selezionate

- {corsiSelezionati.length > 0 && ( - - )}
+
+ {corsiSelezionati.length > 0 && } +
- {corsiSelezionati.length === 0 ? ( -

Nessuna materia selezionata

- ) : ( -
- {corsiSelezionati.map(corso => ( -
-
- {corso.nome} - {corso.cfu} CFU - {corso.passFailOnly && Pass/Fail} -
- - {!corso.passFailOnly && ( -
+ {corsiSelezionati.length === 0 ? ( +

Nessuna materia selezionata

+ ) : ( +
+ {corsiSelezionati.map(corso => ( +
+ {corso.nome} + {corso.cfu} CFU + + {!corso.passFailOnly && ( +
+ + aggiornaVoto( + corso.id, + parseInt((e.target as HTMLInputElement).value) || null, + ) + } + /> + + +
+ )} - -
- )} - +
- ))} -
- )} -
+
+ ))} +
+ )}
{/* Pulsante Calcola */} {corsiSelezionati.length > 0 && ( -
- +
+
)} {/* Risultati */} {risultati && mostraRisultati && ( -
+

Risultati

{risultati.errore ? ( -
+

⚠️ {risultati.errore}

) : ( -
-
- Media Pesata: - {risultati.mediaPesata} +
+
+ Media Pesata: + {risultati.mediaPesata}
-
- Bonus Lodi: - +{risultati.bonusLodi} +
+ Bonus Lodi: + +{risultati.bonusLodi}
-
- Voto di Ammissione: - {risultati.votoAmmissione} +
+ Voto di Ammissione: + {risultati.votoAmmissione}
-
- Massimo Voto Di Laurea Possibile: - +
+ Massimo Voto Di Laurea Possibile: + {risultati.massimoVotoLaurea} - {risultati.conLode && (+lode)} + {risultati.conLode && (+lode)}
@@ -720,9 +710,9 @@ function MediaPesataApp() { )} {/* Nota informativa */} -
+

📋 Come viene calcolata la media

-
+

Regole di esclusione CFU:

  • @@ -763,11 +753,11 @@ function MediaPesataApp() { } // Funzione per inizializzare l'app -export function initMediaPesataApp() { - const container = document.getElementById('media-pesata-app') - if (container) { - render(, container) - } -} - -export default MediaPesataApp +// export function initMediaPesataApp() { +// const container = document.getElementById('media-pesata-app') +// if (container) { +// render(, container) +// } +// } + +// export default MediaPesataApp diff --git a/src/pages/media-pesata.astro b/src/pages/media-pesata.astro index b80c1d9..6654f55 100644 --- a/src/pages/media-pesata.astro +++ b/src/pages/media-pesata.astro @@ -1,42 +1,21 @@ --- import '@/styles/pages/media-pesata.css' import PageLayout from '../layouts/PageLayout.astro' + +import { MediaPesataApp } from '@/client/MediaPesataApp' --- - +

    Calcolo Media e Voto di Laurea

    -

    Calcola la tua media pesata e il voto con cui ti siederai alla discussione di laurea, seguendo le regole del dipartimento di Matematica.

    +

    + Calcola la tua media pesata e il voto con cui ti siederai alla discussione di laurea, seguendo le regole del + dipartimento di Matematica. +

    -
    +
    - - - - diff --git a/src/styles/controls.css b/src/styles/controls.css index 3bac52b..098273a 100644 --- a/src/styles/controls.css +++ b/src/styles/controls.css @@ -75,7 +75,7 @@ Controls - for things like buttons, input, select input[type='text'], input[type='password'] { width: 100%; - height: 2.5rem; + min-height: 1.75rem; /* @include neo-brutalist-card; */ border: 3px solid #222; @@ -89,6 +89,95 @@ Controls - for things like buttons, input, select } } + input[type='checkbox'] { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + + width: calc(1.5rem + 1px); + height: calc(1.5rem + 1px); + + background: #fff; + border: 3px solid #222; + border-radius: 4px; + box-shadow: 3px 3px 0 0 #222; + + position: relative; + cursor: pointer; + + transition: all 64ms linear; + + &:hover { + transform: translate(-1px, -1px); + box-shadow: 4px 4px 0 0 #222; + } + + &:active { + transform: translate(1px, 1px); + box-shadow: 2px 2px 0 0 #222; + } + + &:checked { + background: #1e6733; + + &::after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + + width: 0.8rem; + height: 0.8rem; + background: #1e6733; + + clip-path: polygon(10% 55%, 35% 75%, 85% 25%, 90% 35%, 40% 95%, 5% 60%); + } + + &:hover { + background: #2b8b47; + } + } + + &:disabled { + background: #eee; + border-color: #888; + box-shadow: 3px 3px 0 0 #888; + cursor: not-allowed; + + &:hover { + transform: none; + box-shadow: 3px 3px 0 0 #888; + } + + &:checked { + background: #aaa; + + &::after { + background: #666; + } + } + } + + &.star { + &:checked::after { + background: rgb(255, 197, 49); + clip-path: polygon( + 50% 0%, + 61% 35%, + 98% 35%, + 68% 57%, + 79% 91%, + 50% 70%, + 21% 91%, + 32% 57%, + 2% 35%, + 39% 35% + ); + } + } + } + form { display: grid; gap: 1rem; diff --git a/src/styles/main.css b/src/styles/main.css index 3ab0f56..cec7c82 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -325,6 +325,38 @@ Custom Page Styles opacity: 0 !important; } + .grid-center { + display: grid; + place-content: center; + place-items: center; + } + + .h-flex { + display: flex; + gap: 0.5rem; + flex-direction: row; + } + + .v-flex { + display: flex; + gap: 0.5rem; + flex-direction: column; + } + + .h-flex, + .v-flex { + place-self: stretch; + align-items: center; + + > * { + flex-shrink: 0; + } + + > .spacer { + flex-grow: 1; + } + } + @media screen and (min-width: 1024px) { .mobile-only { display: none !important; diff --git a/src/styles/pages.scss b/src/styles/pages.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/styles/pages/media-pesata.css b/src/styles/pages/media-pesata.css index 0c16d19..4668b47 100644 --- a/src/styles/pages/media-pesata.css +++ b/src/styles/pages/media-pesata.css @@ -1,10 +1,116 @@ @layer page { + :root { + --media-pesata-accent: #e4c5ff; + --media-pesata-bg: hsl(from var(--media-pesata-accent) h s 95%); + + --media-pesata-accent-2: #ffe4c5; + --media-pesata-accent-3: #c5ffe4; + + --card-base: var(--media-pesata-accent); + } + + main { + justify-self: center; + background: var(--media-pesata-bg); + + display: flex; + flex-direction: column; + align-items: center; + + padding: 4.5rem 3rem; + gap: 4.5rem; + + @media screen and (max-width: 1024px) { + padding: 3rem 1rem; + gap: 3rem; + + .card { + width: 100%; + } + } + } + + .media-pesata-container { + max-width: 72rem; + margin: 0 auto; + padding: 2rem; + + @media screen and (max-width: 768px) { + padding: 0; + } + } + + h1 { + text-align: center; + margin-bottom: 1rem; + color: var(--color-primary); + } + + p { + text-align: center; + margin-bottom: 2rem; + color: var(--color-text-secondary); + } + + .card { + align-content: start; + gap: 1rem; + } + + button { + display: grid; + grid-auto-flow: column; + place-content: center; + place-items: center; + + padding: 0.25rem 1rem; + gap: 0.5rem; + font-size: 16px; + + border: 2px solid #222; + border-radius: 4px; + box-shadow: 2px 2px 0 0 #222; + + transition: all 64ms linear; + text-decoration: none; + color: #222; + + cursor: pointer; + + &:hover { + transform: translate(-1px, -1px); + box-shadow: 3px 3px 0 0 #222; + } + + &:active { + transform: translate(1px, 1px); + box-shadow: 1px 1px 0 0 #222; + } + } + .media-pesata-app { max-width: 1200px; margin: 0 auto; padding: 2rem; min-height: 100vh; - background: var(--homepage-whatsphc-bg); + + display: grid; + grid-template-columns: 1fr 1fr; + grid-template-rows: repeat(7, auto); + + align-items: start; + gap: 2rem; + + > .wide { + grid-column: 1 / -1; + } + + @media screen and (max-width: 1024px) { + padding: 0; + + grid-template-columns: 1fr; + gap: 1rem; + } } .media-pesata-title { @@ -24,70 +130,120 @@ box-shadow: 4px 4px 0 0 var(--palette-black); padding: 1.5rem; margin-bottom: 2rem; - } - .student-type-selector h2 { - margin-bottom: 1rem; - color: var(--palette-black); - font-family: var(--font-display); - font-weight: 600; - font-size: 1.5rem; - text-align: center; + display: grid; + place-content: center; + + h2 { + margin-bottom: 1rem; + color: var(--palette-black); + font-family: var(--font-display); + font-weight: 600; + font-size: 1.5rem; + text-align: center; + } } - .radio-group { + /* .radio-group { display: flex; gap: 1.5rem; justify-content: center; - } - .radio-group label { - display: flex; - align-items: center; - gap: 0.5rem; - font-size: 1.1rem; - cursor: pointer; - padding: 0.5rem 1rem; - border: 2px solid var(--palette-black); - border-radius: 6px; - background: #fff; - font-family: var(--font-secondary); - font-weight: 600; - transition: all 64ms linear; - box-shadow: 2px 2px 0 0 var(--palette-black); - } + label { + display: flex; + align-items: center; + gap: 0.5rem; + font-size: 1.1rem; + cursor: pointer; + padding: 0.5rem 1rem; + border: 2px solid var(--palette-black); + border-radius: 6px; + background: #fff; + font-family: var(--font-secondary); + font-weight: 600; + transition: all 64ms linear; + box-shadow: 2px 2px 0 0 var(--palette-black); + } - .radio-group label:hover { - transform: translate(-1px, -1px); - box-shadow: 3px 3px 0 0 var(--palette-black); - } + label:hover { + transform: translate(-1px, -1px); + box-shadow: 3px 3px 0 0 var(--palette-black); + } - .radio-group label:active { - transform: translate(1px, 1px); - box-shadow: 1px 1px 0 0 var(--palette-black); - } + label:active { + transform: translate(1px, 1px); + box-shadow: 1px 1px 0 0 var(--palette-black); + } - .radio-group input[type='radio'] { - width: 18px; - height: 18px; - margin: 0; - accent-color: #007bff; + input[type='radio'] { + width: 18px; + height: 18px; + margin: 0; + accent-color: #007bff; + } + } */ + + .compound-button { + display: flex; + border: 3px solid #222; + border-radius: 6px; + box-shadow: 4px 4px 0 0 #222; + overflow: hidden; + width: fit-content; + + button { + border: none; + border-radius: 0; + box-shadow: none; + margin: 0; + flex: 1; + min-width: 120px; + padding: 0.5rem; + + &:not(:last-child) { + border-right: 3px solid #222; + } + + &:hover { + transform: none; + box-shadow: none; + background: #f0f0f0; + } + + &:active { + transform: none; + box-shadow: none; + background: #e0e0e0; + } + + &.active { + background: hsl(from var(--media-pesata-accent) h s 75%); + color: #f4fef7; + + &:hover { + background: hsl(from var(--media-pesata-accent) h s 85%); + } + + &:active { + background: hsl(from var(--media-pesata-accent) h s 95%); + } + } + } } /* Counter CFU */ .cfu-counter { - background: var(--project-card-bg); + background: hsl(from var(--media-pesata-accent-2) h s 75%); border: var(--border-large); border-radius: 6px; box-shadow: 4px 4px 0 0 var(--palette-black); padding: 1rem; - margin-bottom: 2rem; text-align: center; - } - .cfu-counter.error { - background: #fee; - border-color: #dc3545; + &.error { + background: #ffd8d8; + border-color: #dc3545; + } } .cfu-counter h3 { @@ -119,14 +275,6 @@ text-align: center; } - /* Layout principale */ - .main-content { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 2rem; - margin-bottom: 2rem; - } - @media (max-width: 768px) { .main-content { grid-template-columns: 1fr; @@ -151,75 +299,97 @@ } .course-category { - margin-bottom: 2rem; - } - - /* Rimozione del vecchio stile per h3 che causava il rettangolo blu */ - - .course-grid { display: grid; - grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.5rem; - margin-top: 1rem; - padding-top: 0.5rem; - } - - .course-button { - display: flex; - flex-direction: column; - align-items: flex-start; - padding: 0.75rem; - border: 2px solid var(--palette-black); - border-radius: 4px; - background: #f8f9fa; - cursor: pointer; - transition: all 64ms linear; - text-align: left; - font-family: var(--font-secondary); - box-shadow: 2px 2px 0 0 var(--palette-black); - } - - .course-button:hover:not(:disabled) { - background: var(--homepage-projects-bg); - transform: translate(-1px, -1px); - box-shadow: 3px 3px 0 0 var(--palette-black); - } - - .course-button:active:not(:disabled) { - transform: translate(1px, 1px); - box-shadow: 1px 1px 0 0 var(--palette-black); - } - .course-button:disabled { - opacity: 0.5; - cursor: not-allowed; - background: #e0e0e0; - } + > button { + padding: 0.25rem 0.75rem 0.25rem 0.5rem; + font-size: 20px; - .course-button.selected { - background: var(--guide-base); - transform: translate(1px, 1px); - box-shadow: 1px 1px 0 0 var(--palette-black); - } + place-content: stretch; + place-items: stretch; + } - .course-name { - font-weight: 600; - font-size: 0.9rem; - line-height: 1.3; - margin-bottom: 0.25rem; - color: var(--palette-black); - } + .course-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 0.5rem; - .course-cfu { - font-size: 0.8rem; - color: #666; - font-weight: bold; - font-family: var(--font-mono); + padding: 0.25rem; + + border-radius: 0.25rem; + overflow-y: auto; + max-height: 50vh; + + position: relative; + + /* bottom linear gradient for scroll */ + &::after { + content: ''; + position: sticky; + bottom: -0.25rem; + left: 0; + right: 0; + height: 1rem; + margin-top: calc(-1rem - 0.25rem); + + background: linear-gradient(to top, #0004, transparent); + } + + .course-button { + display: grid; + grid-template-rows: auto auto; + padding: 0.5rem; + gap: 0.25rem; + justify-content: stretch; + justify-items: start; + + border: 2px solid var(--palette-black); + border-radius: 4px; + background: #f8f9fa; + cursor: pointer; + transition: all 64ms linear; + text-align: left; + font-family: var(--font-secondary); + box-shadow: 2px 2px 0 0 var(--palette-black); + + &:hover:not(:disabled) { + background: var(--homepage-projects-bg); + transform: translate(-1px, -1px); + box-shadow: 3px 3px 0 0 var(--palette-black); + } + + &:active:not(:disabled) { + transform: translate(1px, 1px); + box-shadow: 1px 1px 0 0 var(--palette-black); + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + background: #e0e0e0; + } + + > .course-name { + font-weight: 600; + font-size: 0.9rem; + line-height: 1.3; + color: var(--palette-black); + } + + > .course-cfu { + font-size: 0.8rem; + color: #666; + font-weight: bold; + /* font-family: var(--font-mono); */ + } + } + } } /* Materia personalizzata */ .custom-course { - margin-top: 2rem; + margin-top: 1rem; padding-top: 1.5rem; border-top: 3px solid var(--palette-black); } @@ -252,29 +422,31 @@ box-shadow: 5px 5px 0 0 var(--palette-black); } - .custom-form { - display: flex; - gap: 0.5rem; - flex-wrap: wrap; - margin-top: 1rem; - } + input { + padding: 0.25rem 0.5rem; + font-size: 14px; - .custom-form input { - padding: 0.5rem; - border: 2px solid var(--palette-black); + border: 2px solid #222; border-radius: 4px; - font-size: 0.9rem; + box-shadow: 2px 2px 0 0 #222; + background: #fff; font-family: var(--font-primary); } - .custom-form input[type='text'] { - flex: 2; - min-width: 200px; - } + .custom-form { + display: flex; + gap: 0.5rem; + flex-wrap: wrap; + + input[type='text'] { + flex: 2; + min-width: 200px; + } - .custom-form input[type='number'] { - flex: 0 0 80px; + input[type='number'] { + flex: 0 0 80px; + } } .confirm-btn, @@ -351,122 +523,150 @@ .courses-list { display: flex; flex-direction: column; - gap: 1rem; + gap: 0.5rem; + + /* @media screen and (max-width: 1024px) { + gap: 0; + + .course-item { + &:first-child:not(:last-child) { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + + &:last-child:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0; + + border-top: none; + } + + &:not(:first-child, :last-child) { + border-radius: 0; + border-top: none; + } + } + } */ } .course-item { - display: flex; + display: grid; + grid-template-rows: auto 1fr; + grid-template-columns: 1fr auto auto; align-items: center; - gap: 1rem; - padding: 1rem; - background: var(--guide-base); + + gap: 0.5rem 1rem; + padding: 0.5rem 1rem 0.5rem 0.5rem; + background: #fff; border: 2px solid var(--palette-black); border-radius: 4px; transition: all 64ms linear; - } - .course-item:hover { - transform: translate(-1px, -1px); - box-shadow: 2px 2px 0 0 var(--palette-black); - } + > .course-name { + grid-column: 1 / 2; + grid-row: 1 / 2; - .course-info { - flex: 1; - display: flex; - flex-direction: column; - gap: 0.25rem; - } + font-weight: 600; + font-size: 0.9rem; + color: var(--palette-black); + font-family: var(--font-secondary); + } - .course-info .course-name { - font-weight: 600; - font-size: 0.9rem; - color: var(--palette-black); - font-family: var(--font-secondary); - } + > .course-cfu { + grid-column: 1 / 2; + grid-row: 2 / 3; - .course-info .course-cfu { - font-size: 0.8rem; - color: #666; - font-family: var(--font-mono); - } + font-size: 0.8rem; + font-weight: bold; + color: #666; + /* font-family: var(--font-mono); */ + } - .course-grade { - display: flex; - align-items: center; - gap: 0.75rem; - } + > .tall { + grid-row: 1 / -1; + } - .course-grade input[type='number'] { - width: 90px; - padding: 0.5rem; - border: 2px solid var(--palette-black); - border-radius: 4px; - font-size: 0.9rem; - text-align: center; - background: #fff; - font-weight: 600; - font-family: var(--font-primary); - } + .course-grade { + display: grid; + grid-auto-flow: column; + place-content: center; - .lode-checkbox { - display: flex; - align-items: center; - gap: 0.25rem; - font-size: 0.8rem; - cursor: pointer; - font-weight: 600; - font-family: var(--font-secondary); - } + gap: 0.5rem; + } - .lode-checkbox.disabled { - opacity: 0.5; - cursor: not-allowed; - } + > .actions { + grid-column: -2 / -1; + } - .lode-checkbox input[type='checkbox'] { - width: 16px; - height: 16px; - margin: 0; - } + .lode-checkbox { + display: flex; + align-items: center; + gap: 0.25rem; + font-size: 0.8rem; + cursor: pointer; + font-weight: 600; + font-family: var(--font-secondary); + + &.disabled { + opacity: 0.5; + cursor: not-allowed; + } + } - .remove-btn { - background: #d63031; - color: white; - border: 2px solid var(--palette-black); - width: 30px; - height: 30px; - border-radius: 50%; - aspect-ratio: 1; - cursor: pointer; - font-size: 1.2rem; - display: flex; - align-items: center; - justify-content: center; - transition: all 64ms linear; - flex-shrink: 0; - box-shadow: 2px 2px 0 0 var(--palette-black); - } + .remove-btn { + background: #d63031; + color: white; + width: 1.75rem; + height: 1.75rem; + font-size: 20px; + padding: 0; + + margin-top: 4px; + + &:hover { + background: #b71c1c; + } + } - .remove-btn:hover { - background: #b71c1c; - transform: translate(-1px, -1px); - box-shadow: 3px 3px 0 0 var(--palette-black); - } + @media screen and (max-width: 1024px) { + justify-items: start; + align-items: center; + gap: 0.5rem; - .remove-btn:active { - transform: translate(1px, 1px); - box-shadow: 1px 1px 0 0 var(--palette-black); - } + grid-template-columns: 1fr auto; + grid-template-rows: auto auto; - /* Calcolo e risultati */ - .calculation-section { - background: var(--homepage-principal-bg); - border: var(--border-large); - border-radius: 6px; - box-shadow: 4px 4px 0 0 var(--palette-black); - padding: 2rem; - text-align: center; - margin-top: 2rem; + padding: 0.5rem; + + .course-name { + display: grid; + place-content: center; + place-items: center; + + grid-column: 1 / 2; + grid-row: 1 / 2; + } + + .course-cfu { + display: grid; + justify-self: center; + align-self: start; + + grid-column: 2 / 3; + grid-row: 1 / 2; + } + + .course-grade { + grid-row: 2 / 3; + } + + .actions { + grid-column: 2 / 3; + grid-row: 2 / 3; + + justify-self: end; + } + } } .calculate-button { @@ -482,17 +682,17 @@ cursor: pointer; transition: all 64ms linear; margin-bottom: 2rem; - } - .calculate-button:hover { - background: #2b8b47; - transform: translate(-1px, -1px); - box-shadow: 5px 5px 0 0 var(--palette-black); - } + &:hover { + background: #2b8b47; + transform: translate(-1px, -1px); + box-shadow: 5px 5px 0 0 var(--palette-black); + } - .calculate-button:active { - transform: translate(2px, 2px); - box-shadow: 2px 2px 0 0 var(--palette-black); + &:active { + transform: translate(2px, 2px); + box-shadow: 2px 2px 0 0 var(--palette-black); + } } .results { @@ -502,21 +702,25 @@ box-shadow: 4px 4px 0 0 var(--palette-black); padding: 2rem; margin-top: 1rem; - } - .results h2 { - margin-bottom: 1.5rem; - color: var(--palette-black); - font-family: var(--font-display); - font-weight: 600; - font-size: 1.6rem; - text-align: center; - } + > h2 { + margin-bottom: 1.5rem; + color: var(--palette-black); + font-family: var(--font-display); + font-weight: 600; + font-size: 1.6rem; + text-align: center; + } - .results-grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); - gap: 1rem; + .results-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 1rem; + } + + @media screen and (max-width: 1024px) { + padding: 1rem; + } } /* Ordine degli elementi: il massimo voto di laurea al centro */ @@ -533,7 +737,7 @@ justify-content: space-between; align-items: center; padding: 1rem; - background: var(--guide-base); + background: hsl(from var(--media-pesata-accent-3) h s 75%); border: 2px solid var(--palette-black); border-radius: 4px; font-family: var(--font-secondary); @@ -542,7 +746,7 @@ } .result-item.highlight { - background: var(--homepage-projects-bg); + background: hsl(from var(--media-pesata-accent-2) h s 75%); font-weight: bold; font-size: 1.2rem; } @@ -579,11 +783,7 @@ } /* Responsive */ - @media (max-width: 768px) { - .media-pesata-app { - padding: 1rem; - } - + /* @media (max-width: 768px) { .course-grid { grid-template-columns: 1fr; } @@ -629,17 +829,16 @@ grid-template-columns: 1fr; } - /* Mantieni il massimo voto centrato anche su mobile */ .result-item:nth-child(4) { order: -1; grid-column: 1; justify-self: center; max-width: 100%; } - } + } */ /* Layout ultra-compatto per schermi molto piccoli */ - @media (max-width: 480px) { + /* @media (max-width: 480px) { .course-item { padding: 0.5rem; gap: 0.25rem; @@ -678,7 +877,7 @@ height: 26px; font-size: 0.9rem; } - } + } */ .section-header { display: flex; @@ -773,8 +972,31 @@ /* Calculate button */ .calculate-section { - text-align: center; - margin: 2rem 0; + display: grid; + place-content: center; + padding: 2rem 0 1rem; + + button { + font-size: 20px; + padding: 1rem; + + /* border 3px */ + border: 3px solid var(--palette-black); + border-radius: 6px; + box-shadow: 4px 4px 0 0 var(--palette-black); + + &:hover { + transform: translate(-1px, -1px); + box-shadow: 5px 5px 0 0 var(--palette-black); + } + + &:active { + transform: translate(2px, 2px); + box-shadow: 2px 2px 0 0 var(--palette-black); + } + + background: hsl(from var(--media-pesata-accent-2) h s 75%); + } } .calculate-btn { @@ -855,3 +1077,18 @@ } } } + +@layer utility { + @media screen and (max-width: 1024px) { + .card { + > .h-flex { + flex-direction: column; + align-items: start; + + > .spacer { + display: none; + } + } + } + } +}