-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Style: Add light/dark color scheme duality
- Move all existing images from src/app/ to public/images/ - Replace all raster (png and jpg) with vector (svg) images - Add light and dark images - Add Icon component (project's logo) - Replace Image component to Icon component in Navbar and IconButton
- Loading branch information
1 parent
f3a2f36
commit 8f4ede5
Showing
19 changed files
with
232 additions
and
24 deletions.
There are no files selected for viewing
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
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,43 @@ | ||
/* | ||
* ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– | ||
* # `useColorScheme.js` | ||
* client | Semantyk | ||
* | ||
* This file contains the logic for the color scheme hook. | ||
* | ||
* Created: Jul 05, 2024 | ||
* Modified: Jul 05, 2024 | ||
* | ||
* Author(s): Semantyk Team | ||
* Maintainer(s): Daniel Bakas <https://id.danielbakas.com> | ||
* | ||
* Copyright © Semantyk 2024. All rights reserved. | ||
* ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– | ||
*/ | ||
|
||
//* Imports | ||
import { useEffect, useState } from "react"; | ||
|
||
export default function useColorScheme() { | ||
const [colorScheme, setColorScheme] = useState("light"); | ||
const [textColorScheme, setTextColorScheme] = useState("dark"); | ||
|
||
useEffect(() => { | ||
const mediaQuery = window.matchMedia("(prefers-color-scheme: light)"); | ||
setColorScheme(mediaQuery.matches ? "light" : "dark"); | ||
setTextColorScheme(mediaQuery.matches ? "dark" : "light"); | ||
|
||
const handleChange = (event) => { | ||
setColorScheme(event.matches ? "light" : "dark"); | ||
setTextColorScheme(mediaQuery.matches ? "dark" : "light"); | ||
}; | ||
|
||
mediaQuery.addEventListener("change", handleChange); | ||
|
||
return () => { | ||
mediaQuery.removeEventListener("change", handleChange); | ||
}; | ||
}, []); | ||
|
||
return { colorScheme, textColorScheme }; | ||
}; |
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 @@ | ||
/* | ||
* ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– | ||
* # `ColorSchemeProvider.jsx` | `logic` | ||
* client | Semantyk | ||
* | ||
* This file contains the `ColorSchemeProvider` component. | ||
* | ||
* Created: Dec 4, 2023 | ||
* Modified: Jul 5, 2024 | ||
* | ||
* Author: Semantyk Team | ||
* Maintainer: Daniel Bakas <https://id.danielbakas.com> | ||
* | ||
* Copyright © Semantyk 2024. All rights reserved. | ||
* ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– | ||
*/ | ||
|
||
"use client"; | ||
|
||
//* Imports | ||
import React from "react"; | ||
import useColorScheme from "@semantyk/frontend/hooks/useColorScheme"; | ||
|
||
export default function ColorSchemeProvider({ children }) { | ||
// Hooks | ||
const { colorScheme, textColorScheme } = useColorScheme(); | ||
// Return | ||
return ( | ||
<body id="App" className={`bg-${colorScheme} text-${textColorScheme}`}> | ||
{children} | ||
</body> | ||
); | ||
} |
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