From 562db7fe92f90543629590048d0eb9dea1443311 Mon Sep 17 00:00:00 2001 From: Liangdi Date: Thu, 26 Dec 2024 13:14:00 +1100 Subject: [PATCH] style: update formula text colors for light/dark modes and run prettier format --- src/components/hamburger-menu.tsx | 30 +++++++-------- src/components/site-header.tsx | 12 ++++-- src/routes/about.lazy.tsx | 61 ++++++++++++++++++++----------- 3 files changed, 61 insertions(+), 42 deletions(-) diff --git a/src/components/hamburger-menu.tsx b/src/components/hamburger-menu.tsx index 76d85c4..4b555ba 100644 --- a/src/components/hamburger-menu.tsx +++ b/src/components/hamburger-menu.tsx @@ -1,35 +1,31 @@ -import { Button } from "@/components/ui/button" -import { Menu, X } from "lucide-react" +import { Button } from '@/components/ui/button'; +import { Menu, X } from 'lucide-react'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu" -import { Link } from '@tanstack/react-router' -import { useState } from 'react' +} from '@/components/ui/dropdown-menu'; +import { Link } from '@tanstack/react-router'; +import { useState } from 'react'; type MenuItem = { - name: string - to: string -} + name: string; + to: string; +}; interface HamburgerMenuProps { - items: MenuItem[] + items: MenuItem[]; } export function HamburgerMenu({ items }: HamburgerMenuProps) { - const [isOpen, setIsOpen] = useState(false) + const [isOpen, setIsOpen] = useState(false); return ( @@ -46,5 +42,5 @@ export function HamburgerMenu({ items }: HamburgerMenuProps) { ))} - ) -} \ No newline at end of file + ); +} diff --git a/src/components/site-header.tsx b/src/components/site-header.tsx index ea9ddc8..2d94311 100644 --- a/src/components/site-header.tsx +++ b/src/components/site-header.tsx @@ -25,8 +25,8 @@ function SiteLogo() { } export function SiteHeader() { - const isMobile = useBreakpoint('mobile') - const isDesktop = !isMobile + const isMobile = useBreakpoint('mobile'); + const isDesktop = !isMobile; return (
@@ -65,7 +65,11 @@ export function SiteHeader() {
- ) + ); } diff --git a/src/routes/about.lazy.tsx b/src/routes/about.lazy.tsx index 6254b27..22a8c9b 100644 --- a/src/routes/about.lazy.tsx +++ b/src/routes/about.lazy.tsx @@ -43,9 +43,11 @@ function About() {

GPA Formula

- GPA = Σ(g ×{' '} - c) ÷ Σ - c + GPA = Σ( + g{' '} + ×{' '} + c) ÷ + Σc

@@ -56,20 +58,33 @@ function About() { {/*

WAM =

(

-

Σ(m₁ × c₁ × 0.5) +

-

Σ(m₂ × c₂ × 1.0)

+

Σ(m₁ × c₁ × 0.5) +

+

Σ(m₂ × c₂ × 1.0)

) ÷ (

-

Σ(c₁ × 0.5) +

-

Σ(c₂ × 1.0)

+

Σ(c₁ × 0.5) +

+

Σ(c₂ × 1.0)

)

*/}

- WAM = (Σ(m₁ ×{' '} - c₁ × 0.5) + Σ( - m₂ ×{' '} - c₂ × 1.0)) ÷ (Σ( - c₁ × 0.5) + Σ( - c₂ × 1.0)) + WAM = (Σ( + m₁{' '} + ×{' '} + c₁{' '} + × 0.5) + Σ( + + m₂ + {' '} + ×{' '} + c₂{' '} + × 1.0)) ÷ (Σ( + + c₁ + {' '} + × 0.5) + Σ( + + c₂ + {' '} + × 1.0))

@@ -79,24 +94,28 @@ function About() {

- g = grade value + g{' '} + = grade value

- c = credit points + c{' '} + = credit points

- m₁ = first year mark + m₁{' '} + = first year mark

- c₁ = first year credit - points + c₁{' '} + = first year credit points

- m₂ = later year mark + m₂{' '} + = later year mark

- c₂ = later year credit - points + c₂{' '} + = later year credit points