From 5915ba3eec273e7ff31104f13cf6838bfe20cf90 Mon Sep 17 00:00:00 2001 From: marcantoinem <marc-antoine.m@outlook.com> Date: Thu, 25 Jul 2024 20:10:26 -0400 Subject: [PATCH] Continue to fix the css --- aep-schedule-website/.cargo/config.toml | 2 ++ aep-schedule-website/Cargo.toml | 6 ++++++ .../src/frontend/components/options/form.rs | 4 ++-- .../src/frontend/components/options/search.rs | 2 +- .../src/frontend/pages/apropos.rs | 2 +- .../src/frontend/pages/classroom.rs | 2 +- aep-schedule-website/style/common.scss | 8 -------- aep-schedule-website/style/main.scss | 18 ++--------------- aep-schedule-website/style/options.scss | 20 ------------------- 9 files changed, 15 insertions(+), 49 deletions(-) create mode 100644 aep-schedule-website/.cargo/config.toml diff --git a/aep-schedule-website/.cargo/config.toml b/aep-schedule-website/.cargo/config.toml new file mode 100644 index 0000000..1aa838e --- /dev/null +++ b/aep-schedule-website/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustflags = ["-Z", "threads=8"] diff --git a/aep-schedule-website/Cargo.toml b/aep-schedule-website/Cargo.toml index 51d57cc..e5193b6 100644 --- a/aep-schedule-website/Cargo.toml +++ b/aep-schedule-website/Cargo.toml @@ -66,6 +66,12 @@ ssr = [ "dep:tracing", ] +[profile.dev] +opt-level = 1 + +[profile.dev.package."*"] +opt-level = 3 + # Defines a size-optimized profile for the WASM bundle in release mode [profile.wasm-release] inherits = "release" diff --git a/aep-schedule-website/src/frontend/components/options/form.rs b/aep-schedule-website/src/frontend/components/options/form.rs index 301894e..11fe24e 100644 --- a/aep-schedule-website/src/frontend/components/options/form.rs +++ b/aep-schedule-website/src/frontend/components/options/form.rs @@ -15,9 +15,9 @@ pub fn OptionsForms(action: Action<SchedulesOptions, Vec<Schedule>>) -> impl Int view! { <CoursesSelector state=state submit/> - <span class="spacer"></span> + <span class="grow"></span> <div class="row-container input-item auto-bottom"><p>"Nombre de conflits maximum"</p><NumberInput value=state.max_nb_conflicts max=127/></div> <SelectOptimizations state=state submit/> - <button on:click=move |_| {submit()} class="submit">"Générer les horaires"</button> + <button on:click=move |_| {submit()} class="select-none rounded-lg bg-amber-500 py-2 text-xl px-4 w-64 self-center text-center align-middle text-black shadow-md shadow-amber-500/20 transition-all hover:shadow-lg hover:shadow-amber-500/40 focus:opacity-[0.85] focus:shadow-none active:opacity-[0.85] active:shadow-none disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none">"Générer les horaires"</button> } } diff --git a/aep-schedule-website/src/frontend/components/options/search.rs b/aep-schedule-website/src/frontend/components/options/search.rs index a69d236..3a6c12a 100644 --- a/aep-schedule-website/src/frontend/components/options/search.rs +++ b/aep-schedule-website/src/frontend/components/options/search.rs @@ -42,6 +42,6 @@ pub fn SearchCourse( }; Some(view! { - <AutoComplete suggestion_list=courses placeholder="Cours" class="input-item" submit=on_submit id="course-submitter"/> + <AutoComplete suggestion_list=courses placeholder="Cours" submit=on_submit id="course-submitter"/> }) } diff --git a/aep-schedule-website/src/frontend/pages/apropos.rs b/aep-schedule-website/src/frontend/pages/apropos.rs index cb634f4..cc6810e 100644 --- a/aep-schedule-website/src/frontend/pages/apropos.rs +++ b/aep-schedule-website/src/frontend/pages/apropos.rs @@ -3,7 +3,7 @@ use leptos::*; #[component] pub fn HomePage() -> impl IntoView { view! { - <section class="home"> + <section class="p-1 w-full h-full"> <h1>"Générateur d'horaire de l'AEP v2"</h1> <p> "Vous en avez assez d'avoir des horaires horribles fait pas le registrariat? Vous êtes au bon endroit. Le générateur d'horaire v2 est une réécriture plus performante, intuive et moderne du générateur d'horaire. Il vous aidera à trouver un horaire parfait." diff --git a/aep-schedule-website/src/frontend/pages/classroom.rs b/aep-schedule-website/src/frontend/pages/classroom.rs index 3485aad..cc24ea0 100644 --- a/aep-schedule-website/src/frontend/pages/classroom.rs +++ b/aep-schedule-website/src/frontend/pages/classroom.rs @@ -66,7 +66,7 @@ pub fn ClassRoomComponent() -> impl IntoView { {classrooms.as_ref().map(|classrooms| { let classrooms = classrooms.iter().map(|c| AutoCompleteOption::new(c.to_string(), c.to_string())).collect(); view!{ - <AutoComplete suggestion_list=classrooms placeholder="Local" class="input-item" submit=on_submit id="input-classroom"/> + <AutoComplete suggestion_list=classrooms placeholder="Local" class="w-96" submit=on_submit id="input-classroom"/> } }).ok()} </Await> diff --git a/aep-schedule-website/style/common.scss b/aep-schedule-website/style/common.scss index e8a48d9..5d3bed4 100644 --- a/aep-schedule-website/style/common.scss +++ b/aep-schedule-website/style/common.scss @@ -41,10 +41,6 @@ input:focus~.result-box { background-color: #d4d4d4; } -.spacer { - flex-grow: 1; -} - .warning-box { padding: 1em; gap: 1em; @@ -55,8 +51,4 @@ input:focus~.result-box { text-justify: auto; background-color: $error-color; color: white; -} - -.small-margin { - margin: 0.1em; } \ No newline at end of file diff --git a/aep-schedule-website/style/main.scss b/aep-schedule-website/style/main.scss index ceb4b3f..d617d22 100644 --- a/aep-schedule-website/style/main.scss +++ b/aep-schedule-website/style/main.scss @@ -78,11 +78,6 @@ main { } } -section { - width: 100%; - height: 100%; -} - .hide-left-panel.left-panel { @media screen and (max-width: 1000px) { animation: 0.5s ease-out 0s 1 slideOutToLeft; @@ -112,7 +107,7 @@ section { flex-direction: column; justify-items: center; background-color: $background-color; - padding: 1em 1em; + padding: 1.0rem; gap: 0.2em; animation: 0.5s ease-out 0s 1 slideInFromLeft; } @@ -131,7 +126,7 @@ section { flex-direction: column; align-items: center; gap: 10px; - padding: 0.42em; + padding: 0.25rem; background-color: $light-background; } @@ -176,10 +171,6 @@ a:hover { text-decoration: underline; } -.home { - padding: 0em 1em; -} - nav>a { color: black; } @@ -235,9 +226,4 @@ nav.active { @media screen and (max-width: 1000px) { top: 0; } -} - -.classroom-page { - justify-content: space-between; - padding: 2em; } \ No newline at end of file diff --git a/aep-schedule-website/style/options.scss b/aep-schedule-website/style/options.scss index 6d81169..faf7eca 100644 --- a/aep-schedule-website/style/options.scss +++ b/aep-schedule-website/style/options.scss @@ -1,18 +1,5 @@ @import 'constant.scss'; -.submit { - background-color: $highlight-color; - border: none; - color: $highlight-text; - padding: 0.2em 0.5em; - text-decoration: none; - border-radius: 10px; - cursor: pointer; - font-size: 20pt; - width: 12em; - align-self: center; -} - .relative { position: relative; } @@ -132,13 +119,6 @@ background-color: $error-color; } -.input-item { - width: 100%; - display: flex; - align-items: center; - gap: 10px; -} - .vertical-bar { max-height: 100%; width: 2px; -- GitLab