-
Notifications
You must be signed in to change notification settings - Fork 3
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 #5 from SteveMoya/dark-mode
Dark mode realizado
- Loading branch information
Showing
13 changed files
with
84 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<footer class="py-4 border-t-[1px] border-t-neutral-800"> | ||
<div class="container m-auto"> | ||
<a class="text-base no-underline hover:underline" href="https://github.com/doneber/linkhub" target="_blank">Repositorio de GitHub</a> | ||
<a class="text-base no-underline hover:underline ml-4" href="https://github.com/doneber/linkhub" target="_blank">Repositorio de GitHub</a> | ||
</div> | ||
</footer> |
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,17 @@ | ||
--- | ||
--- | ||
<svg | ||
viewBox="0 0 16 17" | ||
{...Astro.props} | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg"> | ||
<g clip-path="url(#clip0_106_566)"> | ||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.6667 1.83333H10.2222V6.2778H5.7778V10.7222H1.33333V15.1667H14.6667V1.83333Z" fill="currentColor"/> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_106_566"> | ||
<rect width="16" height="16" fill="currentColor" transform="translate(0 0.5)"/> | ||
</clipPath> | ||
</defs> | ||
</svg> |
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,10 +1,15 @@ | ||
--- | ||
import ToggleTheme from './ToggleTheme'; | ||
import Logo from './Logo.astro'; | ||
--- | ||
<nav class="container mx-auto flex justify-between p-4"> | ||
<a href="/" class="flex gap-2 items-center justify-center hover:underline underline-offset-4"> | ||
<img class="w-5 mt-1" src="/logo.svg" alt="Logo de Linkhub" > | ||
<Logo class="w-5 mt-1" /> | ||
<span>LinkHub</span> | ||
</a> | ||
<ToggleTheme client:only/> | ||
<div class="flex gap-3"> | ||
<a class="hover:underline underline-offset-4" href="/contribution">Colaboraciones</a> | ||
<a class="hover:underline underline-offset-4" href="/all">Recursos</a> | ||
<a class="hover:underline underline-offset-4" href="/all">Todos los Recursos</a> | ||
</div> | ||
</nav> |
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,23 @@ | ||
import { useEffect, useState } from "preact/hooks"; | ||
|
||
|
||
export default function ToggleTheme() { | ||
const [theme, setTheme] = useState(localStorage.getItem("theme") ?? "light"); | ||
|
||
const handleClick = () => { | ||
setTheme(theme === "light" ? "dark" : "light"); | ||
}; | ||
|
||
useEffect(() => { | ||
if (theme === "dark") { | ||
document.documentElement.classList.add("dark"); | ||
} else { | ||
document.documentElement.classList.remove("dark"); | ||
} | ||
localStorage.setItem("theme", theme); | ||
}, [theme]); | ||
|
||
return ( | ||
<button className="rounded-full border p-1 dark:border-neutral-700" onClick={handleClick}>{theme === "light" ? "🌙" : "🌞"}</button> | ||
); | ||
} |
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,3 +1,3 @@ | ||
export const SearchIcon = () => (<svg width="30" fill="#fff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> | ||
export const SearchIcon = () => (<svg width="30" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> | ||
<path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/> | ||
</svg>) |
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 +1,2 @@ | ||
/// <reference path="../.astro/types.d.ts" /> | ||
/// <reference types="astro/client" /> |
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