-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from SeraphyBR/dark-mode
Dark mode
- Loading branch information
Showing
18 changed files
with
97 additions
and
73 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use leptos::*; | ||
use leptos_meta::Html; | ||
use leptos_use::{use_color_mode, ColorMode, UseColorModeReturn}; | ||
|
||
#[component] | ||
pub fn DarkModeToggleBtn() -> impl IntoView { | ||
let UseColorModeReturn { mode, set_mode, .. } = use_color_mode(); | ||
|
||
let toggle = move |_| { | ||
if mode() == ColorMode::Dark { | ||
set_mode(ColorMode::Light); | ||
} else { | ||
set_mode(ColorMode::Dark); | ||
} | ||
}; | ||
|
||
let icon = move || { | ||
if mode() == ColorMode::Dark { | ||
"fa-solid fa-moon tw-w-[14px]" | ||
} else { | ||
"fa-solid fa-sun" | ||
} | ||
}; | ||
|
||
view! { | ||
<Html class=move || if mode() == ColorMode::Dark {"tw-dark"} else {""} /> | ||
<div class="tw-fixed tw-top-6 tw-right-6"> | ||
<button on:click=toggle class="tw-btn-primary !tw-bg-opacity-80"> | ||
<i class=icon /> | ||
</button> | ||
</div> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
pub mod back_to_top; | ||
pub mod button; | ||
pub mod card; | ||
pub mod content; | ||
pub mod dark_mode; | ||
pub mod divider; | ||
pub mod nav_menu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
use leptos::*; | ||
use leptos_router::A; | ||
|
||
use crate::{ | ||
components::{button::LinkBtn, divider::Divider}, | ||
pages::base::BasePage, | ||
}; | ||
use crate::{components::divider::Divider, pages::base::BasePage}; | ||
|
||
#[component] | ||
pub fn HomePage() -> impl IntoView { | ||
|
@@ -16,31 +14,31 @@ pub fn HomePage() -> impl IntoView { | |
<h3 class="tw-text-base tw-font-light">"Desenvolvedor - Página em construção"</h3> | ||
<Divider /> | ||
<div class="tw-hflex tw-gap-5"> | ||
<LinkBtn href="mailto:[email protected]" class="!tw-text-3xl"> | ||
<A href="mailto:[email protected]" class="tw-btn-primary !tw-text-3xl"> | ||
<i class="fa fa-envelope-square"/> | ||
</LinkBtn> | ||
</A> | ||
|
||
<LinkBtn href="https://github.com/seraphybr" class="!tw-text-3xl"> | ||
<A href="https://github.com/seraphybr" class="tw-btn-primary !tw-text-3xl"> | ||
<i class="fa-brands fa-github"/> | ||
</LinkBtn> | ||
</A> | ||
|
||
<LinkBtn href="https://t.me/seraphybr" class="!tw-text-3xl"> | ||
<A href="https://t.me/seraphybr" class="tw-btn-primary !tw-text-3xl"> | ||
<i class="fa-brands fa-telegram"/> | ||
</LinkBtn> | ||
</A> | ||
</div> | ||
<Divider /> | ||
<div class="tw-hflex tw-gap-5"> | ||
<LinkBtn href="about" class="!tw-text-base !tw-font-normal !tw-min-w-24"> | ||
<A href="about" class="tw-btn-primary !tw-text-base !tw-font-normal !tw-min-w-24"> | ||
Sobre | ||
</LinkBtn> | ||
</A> | ||
|
||
<LinkBtn href="posts" class="!tw-text-base !tw-font-normal !tw-min-w-24"> | ||
<A href="posts" class="tw-btn-primary !tw-text-base !tw-font-normal !tw-min-w-24"> | ||
Posts | ||
</LinkBtn> | ||
</A> | ||
|
||
<LinkBtn href="projects" class="!tw-text-base !tw-font-normal !tw-min-w-24"> | ||
<A href="projects" class="tw-btn-primary !tw-text-base !tw-font-normal !tw-min-w-24"> | ||
Projetos | ||
</LinkBtn> | ||
</A> | ||
</div> | ||
</div> | ||
</BasePage> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters