diff --git a/components/SiteTree.tsx b/components/SiteTree.tsx
index 0f64726..89310f5 100644
--- a/components/SiteTree.tsx
+++ b/components/SiteTree.tsx
@@ -8,7 +8,7 @@ export default function SiteTree() {
const pathAsArray = pathname.split('/').filter(x => x !== '');
return (
-
+
home
@@ -17,12 +17,12 @@ export default function SiteTree() {
const path = pathAsArray.slice(0, idx + 1).join('/')
return (
- <>
-
/
-
-
{segment}
-
- >
+
)
})}
diff --git a/components/logo/index.tsx b/components/logo/index.tsx
new file mode 100644
index 0000000..bc56625
--- /dev/null
+++ b/components/logo/index.tsx
@@ -0,0 +1,65 @@
+'use client'
+import { FC } from "react";
+import useColorShift, { type ColorListType } from "./useColorShift";
+import { useRouter } from "next/navigation";
+export { default as useColorShift } from "./useColorShift";
+
+const DEFAULT_SHIFT_INTERVAL = 3000;
+
+interface LogoProps {
+ shiftInterval?: number,
+ customColorList?: ColorListType[],
+ disableShift?: boolean,
+}
+
+export const StackedLogo: FC
= ({ shiftInterval, customColorList, disableShift = false }) => {
+ const hookProps = [
+ shiftInterval ?? DEFAULT_SHIFT_INTERVAL,
+ disableShift,
+ customColorList,
+ ] as const;
+
+ const { firstColor, secondColor, thirdColor, handleHover } = useColorShift(...hookProps);
+
+ return (
+
+ )
+}
+
+export const InlineLogo: FC = ({ shiftInterval, customColorList, disableShift = false }) => {
+ const router = useRouter();
+
+ const hookProps = [
+ shiftInterval ?? DEFAULT_SHIFT_INTERVAL,
+ disableShift,
+ customColorList,
+ ] as const;
+
+ const { firstColor, secondColor, thirdColor, handleHover } = useColorShift(...hookProps);
+
+ return (
+
+ )
+}
diff --git a/components/logo/useColorShift.tsx b/components/logo/useColorShift.tsx
new file mode 100644
index 0000000..d289c3f
--- /dev/null
+++ b/components/logo/useColorShift.tsx
@@ -0,0 +1,57 @@
+import { useEffect, useState } from "react";
+import { DefaultColors } from "tailwindcss/types/generated/colors";
+
+export type ColorListType = (`bg-${keyof DefaultColors}` | `bg-${keyof DefaultColors}-${string}`);
+
+const colorList: ColorListType[] = [
+ "bg-purple-400",
+ "bg-purple-700",
+ "bg-sky-400",
+ "bg-sky-700",
+ "bg-blue-400",
+ "bg-pink-400",
+ "bg-pink-700",
+];
+
+const useColorShift = (shiftInterval: number, disableShift = false, customColorList?: ColorListType[]): {
+ firstColor: ColorListType | "",
+ secondColor: ColorListType | "",
+ thirdColor: ColorListType | "",
+ handleHover: () => void,
+} => {
+ if (shiftInterval <= 0) throw new Error("shiftInterval must be greater than 0")
+
+ const [circleColors, setCircleColors] = useState<{
+ firstColor: ColorListType | "",
+ secondColor: ColorListType | "",
+ thirdColor: ColorListType | "",
+ }>({
+ firstColor: "",
+ secondColor: "",
+ thirdColor: "",
+ })
+
+ function handleHover() {
+ const firstColor = colorList[Math.floor(Math.random() * colorList.length | 0)]
+ const secondColor = colorList[Math.floor(Math.random() * colorList.length | 0)]
+ const thirdColor = colorList[Math.floor(Math.random() * colorList.length | 0)]
+
+ setCircleColors({ firstColor, secondColor, thirdColor });
+ }
+
+ // perform initial mount of color changing pattern
+ useEffect(disableShift ? handleHover : (() => { return }), []);
+
+ // set this function to repeat
+ useEffect(() => {
+ const interval = setInterval(() => {
+ handleHover();
+ }, shiftInterval);
+
+ return () => clearInterval(interval);
+ }, [])
+
+ return { ...circleColors, handleHover };
+}
+
+export default useColorShift
diff --git a/components/mdx/index.tsx b/components/mdx/index.tsx
index fa5859c..0801caa 100644
--- a/components/mdx/index.tsx
+++ b/components/mdx/index.tsx
@@ -1,4 +1,5 @@
import { v4 } from "uuid"
+import { cabin } from "@/app/layout";
type ElementType = React.FC
type FormattedTags = {
@@ -6,7 +7,7 @@ type FormattedTags = {
}
const H1TAG: ElementType<"h1"> = ({ children }) => { return (
- {children}
+ {children}
)}
const H2Tag: ElementType<"h2"> = ({ children }) => (
diff --git a/components/ui/Panel.tsx b/components/ui/Panel.tsx
new file mode 100644
index 0000000..dda8a36
--- /dev/null
+++ b/components/ui/Panel.tsx
@@ -0,0 +1,31 @@
+import { FC, ReactNode } from "react"
+import { v4 } from "uuid"
+import type { TailwindFraction, TailwindNumber } from "./types"
+
+interface PanelProps {
+ children: ReactNode
+ width?: TailwindFraction | TailwindNumber | undefined
+ height?: TailwindFraction | TailwindNumber | undefined
+}
+
+const Panel: FC = ({ children, width, height }) => {
+ const narrow = (input: TailwindNumber | TailwindFraction | undefined) => {
+ if (typeof input === 'number') return input.toString();
+ return input ?? "auto";
+ }
+
+ return (
+
+ {children}
+
+ )
+}
+
+export default Panel
diff --git a/components/ui/types.ts b/components/ui/types.ts
new file mode 100644
index 0000000..5bd7641
--- /dev/null
+++ b/components/ui/types.ts
@@ -0,0 +1,17 @@
+const tailwindNumbers = [
+ 0, 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 14, 16, 20, 24, 28,
+ 32, 36, 40, 44, 48, 52, 56, 60, 64,
+ 72, 80, 96
+] as const;
+
+const tailwindFractions = [
+ "1/2", "1/3", "2/3", "1/4", "2/4", "3/4",
+ "1/5", "2/5", "3/5", "4/5", "1/6", "2/6",
+ "3/6", "4/6", "5/6", "1/12", "2/12", "3/12",
+ "4/12", "5/12", "6/12", "7/12", "8/12", "9/12",
+ "10/12", "11/12"
+] as const;
+
+export type TailwindNumber = typeof tailwindNumbers[number];
+export type TailwindFraction = typeof tailwindFractions[number];