From 7736d5596c284aa9005434da78d5d3052cf901fd Mon Sep 17 00:00:00 2001 From: ryanchristo Date: Thu, 6 Aug 2026 10:52:02 -0700 Subject: [PATCH] update style --- README.md | 2 +- app/accounts/page.module.css | 2 +- app/accounts/page.tsx | 48 +++++++++++++++++++++-------- app/contact/page.tsx | 1 + app/globals.css | 31 ++++++++++++++++++- app/layout.tsx | 14 ++++++--- components/Footer.module.css | 5 +++ components/Footer.tsx | 8 +++-- components/Header.module.css | 5 +++ components/Header.tsx | 17 +++++++++++ components/icons/ThemeIcon.tsx | 16 ++++++++++ components/icons/index.ts | 1 + contexts/ThemeContext.tsx | 56 ++++++++++++++++++++++++++++++++++ contexts/index.ts | 3 ++ tsconfig.json | 3 +- 15 files changed, 188 insertions(+), 24 deletions(-) create mode 100644 components/icons/ThemeIcon.tsx create mode 100644 components/icons/index.ts create mode 100644 contexts/ThemeContext.tsx create mode 100644 contexts/index.ts diff --git a/README.md b/README.md index 4a71b18..9849d3d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # website -:business_suit_levitating: personal portfolio website +:business_suit_levitating: personal website diff --git a/app/accounts/page.module.css b/app/accounts/page.module.css index ef729e6..c1df742 100644 --- a/app/accounts/page.module.css +++ b/app/accounts/page.module.css @@ -16,5 +16,5 @@ } .content div > ul > li > i { - color: rgba(255, 255, 255, 0.6); + color: var(--color-dimmed); } diff --git a/app/accounts/page.tsx b/app/accounts/page.tsx index 6fede12..9375503 100644 --- a/app/accounts/page.tsx +++ b/app/accounts/page.tsx @@ -12,11 +12,7 @@ const AccountsPage = () => {

{"accounts"}

-

- { - "The following is a complete list of public accounts that I currently own:" - } -

+

{"Accounts that I currently use and intend to keep for now:"}

+
+

+ {"Accounts that I no longer use and may deactivate in the future:"} +

+
+
+

{ - "This list does not include messaging platforms (e.g. Signal, Telegram, Discord) or project-specific forums for technical and governance discussions." + "The above does not include messaging platforms (e.g. Signal, Telegram, Discord) or project-specific forums for technical and governance discussions." }

diff --git a/app/contact/page.tsx b/app/contact/page.tsx index 95bc98a..90ac1e5 100644 --- a/app/contact/page.tsx +++ b/app/contact/page.tsx @@ -27,6 +27,7 @@ const ContactPage = () => { {": [ available upon request ]"} */} +

{ diff --git a/app/globals.css b/app/globals.css index 649994c..73b117b 100644 --- a/app/globals.css +++ b/app/globals.css @@ -61,10 +61,22 @@ --header-height: 60px; --transition: 0.25s; + /* light theme */ + --background-primary: rgb(255, 255, 255); + --background-primary-transparent: rgba(255, 255, 255, 0.95); + --box-shadow: 0 0 4px rgb(245, 245, 245); + --box-shadow-color: rgb(245, 245, 245); + --color-text: rgb(10, 10, 10); + --color-dimmed: rgba(10, 10, 10, 0.5); +} + +.dark-theme { --background-primary: rgb(17, 17, 17); --background-primary-transparent: rgba(17, 17, 17, 0.9); --box-shadow: 0 0 4px rgb(27, 27, 27); + --box-shadow-color: rgb(27, 27, 27); --color-text: rgb(245, 245, 245); + --color-dimmed: rgba(245, 245, 245, 0.5); } * { @@ -111,8 +123,25 @@ a:hover { opacity: 0.5; } +button { + background: var(--color-theme); + border: none; + border-radius: 1em; + color: var(--background-primary); + font-family: var(--font-family); + font-size: 1em; + outline: none; + transition: var(--transition); +} + +button:hover { + cursor: pointer; + opacity: 0.75; +} + hr { margin: 2em 0; - border: 1px solid rgba(255, 255, 255, 0.1); + border: 1px solid var(--color-dimmed); border-bottom-width: 0; + opacity: 0.25; } diff --git a/app/layout.tsx b/app/layout.tsx index a37165a..a2b13b3 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,16 +1,20 @@ import Footer from "@components/Footer"; import Header from "@components/Header"; +import { ThemeContextProvider } from "@contexts"; + import "./globals.css"; const Layout = ({ children }: any) => ( -

-
- {children} -
-
+ +
+
+ {children} +
+
+
); diff --git a/components/Footer.module.css b/components/Footer.module.css index 4efdc4b..00f8c81 100644 --- a/components/Footer.module.css +++ b/components/Footer.module.css @@ -30,3 +30,8 @@ margin: 0.5em; } } + +.pipe { + color: var(--color-dimmed); + opacity: 0.5; +} diff --git a/components/Footer.tsx b/components/Footer.tsx index 14b9f13..d8331da 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -1,5 +1,7 @@ "use client"; +import Link from "next/link"; + import styles from "./Footer.module.css"; const Footer = () => { @@ -25,13 +27,13 @@ const Footer = () => {
  • - {"|"} + {"|"}
  • - {"accounts"} + {"accounts"}
  • - {"contact"} + {"contact"}
  • diff --git a/components/Header.module.css b/components/Header.module.css index 3ac3a34..5c18f71 100644 --- a/components/Header.module.css +++ b/components/Header.module.css @@ -80,3 +80,8 @@ display: none !important; } } + +.button { + background: none; + display: flex; +} diff --git a/components/Header.tsx b/components/Header.tsx index 1c4557b..e880d80 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -1,10 +1,24 @@ "use client"; import Link from "next/link"; +import { useContext } from "react"; + +import { ThemeContext } from "@contexts"; +import { ThemeIcon } from "./icons"; import styles from "./Header.module.css"; const Header = () => { + const { darkTheme, setDarkTheme } = useContext(ThemeContext); + + const toggleTheme = () => { + if (darkTheme) { + setDarkTheme(false); + } else { + setDarkTheme(true); + } + }; + return (
    @@ -31,6 +45,9 @@ const Header = () => {
    +
    ); }; diff --git a/components/icons/ThemeIcon.tsx b/components/icons/ThemeIcon.tsx new file mode 100644 index 0000000..21e88b1 --- /dev/null +++ b/components/icons/ThemeIcon.tsx @@ -0,0 +1,16 @@ +import * as React from "react"; + +const ThemeIcon = ({ darkTheme }: any) => ( + + + + +); + +export default ThemeIcon; diff --git a/components/icons/index.ts b/components/icons/index.ts new file mode 100644 index 0000000..5a433ca --- /dev/null +++ b/components/icons/index.ts @@ -0,0 +1 @@ +export { default as ThemeIcon } from "./ThemeIcon"; diff --git a/contexts/ThemeContext.tsx b/contexts/ThemeContext.tsx new file mode 100644 index 0000000..08d6985 --- /dev/null +++ b/contexts/ThemeContext.tsx @@ -0,0 +1,56 @@ +"use client"; + +import * as React from "react"; +import { createContext, useEffect, useState } from "react"; + +export const cachedDarkKey = "ryanchristo-web-dark"; + +const initDarkTheme = () => { + let initDarkTheme = false; + + if ( + typeof localStorage !== "undefined" && + localStorage.getItem(cachedDarkKey) + ) { + initDarkTheme = localStorage.getItem(cachedDarkKey) === "true"; + } else if (typeof window !== "undefined") { + initDarkTheme = window.matchMedia("(prefers-color-scheme: dark)").matches; + } + + return initDarkTheme; +}; + +const ThemeContext = createContext({}); + +const ThemeContextProvider = (props: any) => { + const [darkTheme, setDarkTheme] = useState(initDarkTheme()); + + useEffect(() => { + if (typeof window !== "undefined" && typeof localStorage !== "undefined") { + const root = window.document.documentElement; + + if (darkTheme) { + root.classList.add("dark-theme"); + root.style.backgroundColor = "#161616"; // --background-secondary (dark-theme) + } else { + root.classList.remove("dark-theme"); + root.style.backgroundColor = "#FCFCFC"; // --background-secondary (light-theme) + } + + localStorage.setItem(cachedDarkKey, darkTheme ? "true" : "false"); + } + }, [darkTheme]); + + return ( + + {props.children} + + ); +}; + +export { ThemeContext, ThemeContextProvider }; diff --git a/contexts/index.ts b/contexts/index.ts new file mode 100644 index 0000000..67c8139 --- /dev/null +++ b/contexts/index.ts @@ -0,0 +1,3 @@ +"use client"; + +export { ThemeContext, ThemeContextProvider } from "./ThemeContext"; diff --git a/tsconfig.json b/tsconfig.json index 9317f54..f3c0970 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,8 @@ } ], "paths": { - "@components/*": ["components/*"] + "@components/*": ["components/*"], + "@contexts": ["contexts"] } }, "include": [