update style
This commit is contained in:
parent
7a386f5c14
commit
7736d5596c
15 changed files with 188 additions and 24 deletions
|
|
@ -1,3 +1,3 @@
|
|||
# website
|
||||
|
||||
:business_suit_levitating: personal portfolio website
|
||||
:business_suit_levitating: personal website
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@
|
|||
}
|
||||
|
||||
.content div > ul > li > i {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
color: var(--color-dimmed);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,7 @@ const AccountsPage = () => {
|
|||
<div className={styles.content}>
|
||||
<div>
|
||||
<h1>{"accounts"}</h1>
|
||||
<p>
|
||||
{
|
||||
"The following is a complete list of public accounts that I currently own:"
|
||||
}
|
||||
</p>
|
||||
<p>{"Accounts that I currently use and intend to keep for now:"}</p>
|
||||
<div style={{ padding: "0.5em 0" }}>
|
||||
<ul>
|
||||
<li>
|
||||
|
|
@ -31,13 +27,13 @@ const AccountsPage = () => {
|
|||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://www.linkedin.com/in/ryanchristo-"
|
||||
href="https://codeberg.org/ryanchristo"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
{"linkedin"}
|
||||
{"codeberg"}
|
||||
</a>
|
||||
<i>{" - for work experience"}</i>
|
||||
<i>{" - for software projects"}</i>
|
||||
</li>
|
||||
{/* <li>
|
||||
<a
|
||||
|
|
@ -50,6 +46,16 @@ const AccountsPage = () => {
|
|||
<i>{" - for research projects"}</i>
|
||||
</li> */}
|
||||
{/* <li>
|
||||
<a
|
||||
href="https://mastodon.social/@ryanchristo"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
{"mastodon"}
|
||||
</a>
|
||||
<i>{" - for research projects"}</i>
|
||||
</li> */}
|
||||
<li>
|
||||
<a
|
||||
href="https://substack.com/@ryanchristo"
|
||||
rel="noopener noreferrer"
|
||||
|
|
@ -57,8 +63,8 @@ const AccountsPage = () => {
|
|||
>
|
||||
{"substack"}
|
||||
</a>
|
||||
<i>{" - for research projects"}</i>
|
||||
</li> */}
|
||||
<i>{" - for writing projects"}</i>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="https://hackmd.io/@ryanchristo"
|
||||
|
|
@ -67,7 +73,24 @@ const AccountsPage = () => {
|
|||
>
|
||||
{"hackmd"}
|
||||
</a>
|
||||
<i>{" - for software notes"}</i>
|
||||
<i>{" - for a variety of notes"}</i>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>
|
||||
{"Accounts that I no longer use and may deactivate in the future:"}
|
||||
</p>
|
||||
<div style={{ padding: "0.5em 0" }}>
|
||||
<ul>
|
||||
<li>
|
||||
<a
|
||||
href="https://www.linkedin.com/in/ryanchristo-"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
{"linkedin"}
|
||||
</a>
|
||||
<i>{" - for work experience"}</i>
|
||||
</li>
|
||||
{/* <li>
|
||||
<a
|
||||
|
|
@ -121,10 +144,11 @@ const AccountsPage = () => {
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr />
|
||||
<p>
|
||||
<i>
|
||||
{
|
||||
"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."
|
||||
}
|
||||
</i>
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ const ContactPage = () => {
|
|||
{": [ available upon request ]"}
|
||||
</li>*/}
|
||||
</ul>
|
||||
<hr />
|
||||
<p>
|
||||
<i>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) => (
|
||||
<html lang="en">
|
||||
<body>
|
||||
<main>
|
||||
<Header />
|
||||
{children}
|
||||
<Footer />
|
||||
</main>
|
||||
<ThemeContextProvider>
|
||||
<main>
|
||||
<Header />
|
||||
{children}
|
||||
<Footer />
|
||||
</main>
|
||||
</ThemeContextProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -30,3 +30,8 @@
|
|||
margin: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.pipe {
|
||||
color: var(--color-dimmed);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = () => {
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<span style={{ color: "rgba(255,255,255,0.25" }}>{"|"}</span>
|
||||
<span className={styles.pipe}>{"|"}</span>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/accounts">{"accounts"}</a>
|
||||
<Link href="/accounts">{"accounts"}</Link>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/contact">{"contact"}</a>
|
||||
<Link href="/contact">{"contact"}</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -80,3 +80,8 @@
|
|||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
background: none;
|
||||
display: flex;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div className={styles.header}>
|
||||
<div>
|
||||
|
|
@ -31,6 +45,9 @@ const Header = () => {
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<button className={styles.button} onClick={toggleTheme}>
|
||||
<ThemeIcon darkTheme={darkTheme} />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
16
components/icons/ThemeIcon.tsx
Normal file
16
components/icons/ThemeIcon.tsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import * as React from "react";
|
||||
|
||||
const ThemeIcon = ({ darkTheme }: any) => (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
style={{ background: darkTheme ? "#111111" : "#FFFFFF" }}
|
||||
height="1.5em"
|
||||
width="1.5em"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<circle cx="50" cy="50" r="40" fill={darkTheme ? "#F5F5F5" : "#0A0A0A"} />
|
||||
<circle cx="60" cy="50" r="37" fill={darkTheme ? "#111111" : "#FFFFFF"} />
|
||||
</svg>
|
||||
);
|
||||
|
||||
export default ThemeIcon;
|
||||
1
components/icons/index.ts
Normal file
1
components/icons/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { default as ThemeIcon } from "./ThemeIcon";
|
||||
56
contexts/ThemeContext.tsx
Normal file
56
contexts/ThemeContext.tsx
Normal file
|
|
@ -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<any>({});
|
||||
|
||||
const ThemeContextProvider = (props: any) => {
|
||||
const [darkTheme, setDarkTheme] = useState<boolean>(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 (
|
||||
<ThemeContext.Provider
|
||||
value={{
|
||||
darkTheme,
|
||||
setDarkTheme,
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
</ThemeContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export { ThemeContext, ThemeContextProvider };
|
||||
3
contexts/index.ts
Normal file
3
contexts/index.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
"use client";
|
||||
|
||||
export { ThemeContext, ThemeContextProvider } from "./ThemeContext";
|
||||
|
|
@ -20,7 +20,8 @@
|
|||
}
|
||||
],
|
||||
"paths": {
|
||||
"@components/*": ["components/*"]
|
||||
"@components/*": ["components/*"],
|
||||
"@contexts": ["contexts"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue