diff --git a/app/archive/page.tsx b/app/archive/page.tsx new file mode 100644 index 0000000..f4e553a --- /dev/null +++ b/app/archive/page.tsx @@ -0,0 +1,11 @@ +import React from 'react'; + +const Archive = () => { + return ( +
+ +
+ ); +}; + +export default Archive; diff --git a/app/blog/post/[id]/page.tsx b/app/blog/post/[id]/page.tsx index 400aedc..095aaf7 100644 --- a/app/blog/post/[id]/page.tsx +++ b/app/blog/post/[id]/page.tsx @@ -4,7 +4,7 @@ import Generate from '@/app/blog/post/[id]/generate'; function BlogReader({ params }: { params: { id: string } }) { return ( -
+
); diff --git a/app/layout.tsx b/app/layout.tsx index 162ac2c..5c78b6a 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,6 +3,7 @@ import './globals.css'; import React from 'react'; import { ThemeProvider as NextThemesProvider } from 'next-themes'; import Navbar from '@/components/Navbar'; +import Footer from '@/components/Footer'; export const metadata: Metadata = { @@ -21,8 +22,9 @@ export default function RootLayout({
-
+
{ children } +
diff --git a/app/search/page.tsx b/app/search/page.tsx new file mode 100644 index 0000000..466b281 --- /dev/null +++ b/app/search/page.tsx @@ -0,0 +1,11 @@ +import React from 'react'; + +const Search = () => { + return ( +
+ +
+ ); +}; + +export default Search; diff --git a/app/tags/page.tsx b/app/tags/page.tsx new file mode 100644 index 0000000..ee6e26c --- /dev/null +++ b/app/tags/page.tsx @@ -0,0 +1,11 @@ +import React from 'react'; + +const Tags = () => { + return ( +
+ +
+ ); +}; + +export default Tags; diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 6661e9a..d864419 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -14,6 +14,7 @@ import { } from 'react-icons/io5'; import Link from 'next/link'; import ThemeSwitcher from '@/components/ThemeSwitcher'; +import { usePathname } from 'next/navigation'; const entries: { display_name: string; href: string; icon: React.ReactNode }[] = [ { @@ -39,7 +40,7 @@ const entries: { display_name: string; href: string; icon: React.ReactNode }[] = { icon: , display_name: 'Archive', - href: '/Archive' + href: '/archive' }, { icon: , @@ -48,9 +49,21 @@ const entries: { display_name: string; href: string; icon: React.ReactNode }[] = } ]; +const connections: { label: string, href: string, icon: React.ReactNode }[] = [ + { + label: 'Github', + href: 'https://github.com/Lumither', + icon: + }, + { + label: 'email', + href: 'mailto:lumither@outlook.com', + icon: + } +]; + function Navbar() { const [ scrolled, setScrolled ] = useState(false); - useEffect(() => { const handleScroll = () => { const isScrolled = window.scrollY > 0; @@ -63,50 +76,99 @@ function Navbar() { }, []); + const path = usePathname(); + const [ shownPath, setShownPath ] = useState(path); + useEffect(() => { + let trimmed_path = path.split(`/`)[1]; + if (trimmed_path === '') { + setShownPath('HOME'); + } else { + setShownPath(trimmed_path.toUpperCase()); + } + }, [ path ]); + + + const minMobileWidth: number = 768; + const [ isMobile, setIsMobile ] = useState(false); + useEffect(() => { + const updateMobileWidth = () => { + if (window.innerWidth <= minMobileWidth) { + setIsMobile(true); + } else { + setIsMobile(false); + } + }; + updateMobileWidth(); + window.addEventListener('resize', updateMobileWidth); + return () => { + window.removeEventListener('resize', updateMobileWidth); + }; + + }, []); + + return ( <>
+ className={ `flex flex-col w-auto md:w-full min-w-[50px] max-w-[256px] mr-2 ml-8 min-h-screen max-h-screen pt-8 sticky` }>
-
- { +
+
+ { +
+ +
+

Lumither Tao

+

Ad Astra

+
-

Lumither Tao

-

Ad Astra

+
+
    + { + connections.map((conn, key) => ( +
  • + +
  • + )) -
    - - - - - - + } +
+ className={ `mt-8 ml-0 md:-ml-3` }>
    { entries.map((meta, key) => (
  • -
  • )) @@ -114,6 +176,12 @@ function Navbar() {
+
+

+ { shownPath } +

+
+
diff --git a/tailwind.config.ts b/tailwind.config.ts index 08dbe02..6fcbf69 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,6 +1,7 @@ import { nextui } from '@nextui-org/react'; import type { Config } from 'tailwindcss'; +import plugin from 'tailwindcss/plugin'; const config: Config = { content: [ @@ -16,20 +17,42 @@ const config: Config = { plugins: [ require('@tailwindcss/typography'), nextui( - { - // defaultTheme: 'dark', - defaultExtendTheme: 'light', - themes: { - 'light': { - layout: {}, - colors: {} - }, - 'dark': { - layout: {}, - colors: {} + { + // defaultTheme: 'dark', + defaultExtendTheme: 'light', + themes: { + 'light': { + layout: {}, + colors: {} + }, + 'dark': { + layout: {}, + colors: {} + } } } - } - ) ] + ), + plugin(function ({ addUtilities, addComponents, e, config }) { + addUtilities( + { + '.horizontal-tb': { + writingMode: 'horizontal-tb' + }, + '.vertical-rl': { + writingMode: 'vertical-rl' + }, + '.vertical-lr': { + writingMode: 'vertical-lr' + }, + '.sideways-lr': { + writingMode: 'sideways-lr' + }, + '.sideways-rl': { + writingMode: 'sideways-rl' + } + } + ); + }) + ] }; export default config;