From 9cd90ae22a88895cd5b6dee3d1d7b54f2a736232 Mon Sep 17 00:00:00 2001 From: riceset Date: Wed, 18 Mar 2026 19:27:05 +0900 Subject: [PATCH] redesign almost done --- Logo_tufs-cropped.svg | 1 + quartz.layout.ts | 12 ++- quartz/components/Graph.tsx | 103 +++++++++++++++------- quartz/components/HomeHero.tsx | 2 +- quartz/components/HomeProfile.tsx | 8 +- quartz/components/scripts/graph.inline.ts | 80 +++++++++++++++-- quartz/components/styles/footer.scss | 2 +- quartz/components/styles/graph.scss | 46 ++++++++++ quartz/static/logos/Logo_tufs-cropped.svg | 3 + 9 files changed, 209 insertions(+), 48 deletions(-) create mode 100644 Logo_tufs-cropped.svg create mode 100644 quartz/static/logos/Logo_tufs-cropped.svg diff --git a/Logo_tufs-cropped.svg b/Logo_tufs-cropped.svg new file mode 100644 index 000000000..60a784295 --- /dev/null +++ b/Logo_tufs-cropped.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/quartz.layout.ts b/quartz.layout.ts index 0d8ede11d..82bd48ab1 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -5,7 +5,17 @@ import * as Component from "./quartz/components" export const sharedPageComponents: SharedLayout = { head: Component.Head(), header: [], - afterBody: [], + afterBody: [ + Component.ConditionalRender({ + component: Component.Graph({ + globalOnly: true, + globalGraph: { + removeSlugs: ["index"], + }, + }), + condition: (props) => props.fileData.slug === "index", + }), + ], footer: Component.Footer({ links: {}, }), diff --git a/quartz/components/Graph.tsx b/quartz/components/Graph.tsx index 907372e93..50bc69fd4 100644 --- a/quartz/components/Graph.tsx +++ b/quartz/components/Graph.tsx @@ -15,6 +15,7 @@ export interface D3Config { linkDistance: number fontSize: number opacityScale: number + removeSlugs: string[] removeTags: string[] showTags: boolean focusOnHover?: boolean @@ -22,11 +23,13 @@ export interface D3Config { } interface GraphOptions { + globalOnly: boolean localGraph: Partial | undefined globalGraph: Partial | undefined } const defaultOptions: GraphOptions = { + globalOnly: false, localGraph: { drag: true, zoom: true, @@ -37,6 +40,7 @@ const defaultOptions: GraphOptions = { linkDistance: 30, fontSize: 0.6, opacityScale: 1, + removeSlugs: [], showTags: true, removeTags: [], focusOnHover: false, @@ -52,6 +56,7 @@ const defaultOptions: GraphOptions = { linkDistance: 30, fontSize: 0.6, opacityScale: 1, + removeSlugs: [], showTags: true, removeTags: [], focusOnHover: true, @@ -59,45 +64,79 @@ const defaultOptions: GraphOptions = { }, } +const GraphIcon = () => ( + + + + + + + + + + +) + export default ((opts?: Partial) => { const Graph: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => { const localGraph = { ...defaultOptions.localGraph, ...opts?.localGraph } const globalGraph = { ...defaultOptions.globalGraph, ...opts?.globalGraph } + const graphConfig = opts?.globalOnly ? globalGraph : localGraph + const title = opts?.globalOnly ? "Graph" : i18n(cfg.locale).components.graph.title return ( -
-

{i18n(cfg.locale).components.graph.title}

+
+ {opts?.globalOnly ? ( +

+ + {title} +

+ ) : ( +

{title}

+ )}
-
- -
-
-
+
+ {!opts?.globalOnly && ( + + )}
+ {!opts?.globalOnly && ( +
+
+
+ )}
) } diff --git a/quartz/components/HomeHero.tsx b/quartz/components/HomeHero.tsx index 696fa9bfe..2f6bf9a65 100644 --- a/quartz/components/HomeHero.tsx +++ b/quartz/components/HomeHero.tsx @@ -31,7 +31,7 @@ const HomeHero: QuartzComponent = () => {

Software engineer and linguist. Interning at MIXI, Inc building iOS features for FamilyAlbum. MEXT Scholar at Tokyo University of Foreign Studies. 42 Network alumnus. - Native in English, Japanese, and Portuguese β€” also speak Spanish and Mandarin. + Native in Japanese and Portuguese, bilingual in English, and also speak Spanish and Mandarin.