From 0a10f71af6bbcccd2e78119d735b7c2bbe277fde Mon Sep 17 00:00:00 2001 From: DefectingCat Date: Mon, 20 Mar 2023 16:51:04 +0800 Subject: [PATCH] Add google fonts --- .vscode/settings.json | 4 ++ app/fonts.ts | 31 ++++++++++++++++ components/pages/project-card.tsx | 62 ------------------------------- 3 files changed, 35 insertions(+), 62 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 app/fonts.ts delete mode 100644 components/pages/project-card.tsx diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ea41f0f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "typescript.tsdk": "node_modules/.pnpm/typescript@5.0.2/node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true +} \ No newline at end of file diff --git a/app/fonts.ts b/app/fonts.ts new file mode 100644 index 0000000..5ccafd0 --- /dev/null +++ b/app/fonts.ts @@ -0,0 +1,31 @@ +import { + Aleo, + Aref_Ruqaa, + Barlow, + JetBrains_Mono, + Poppins, +} from 'next/font/google'; + +export const aleo = Aleo({ + weight: ['300', '400', '700'], + display: 'swap', +}); + +export const aref_ruqaa = Aref_Ruqaa({ + weight: ['400', '700'], + display: 'swap', +}); + +export const barlow = Barlow({ + weight: ['100', '200', '300', '400', '500', '600', '700', '800', '900'], + style: 'italic', + display: 'swap', +}); + +export const jetbrains_mono = JetBrains_Mono({ + display: 'swap', +}); + +export const poppins = Poppins({ + weight: ['300', '400', '700', '100', '200', '500', '600', '800', '900'], +}); diff --git a/components/pages/project-card.tsx b/components/pages/project-card.tsx deleted file mode 100644 index 5f6bb96..0000000 --- a/components/pages/project-card.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import clsx from 'clsx'; -import { Project } from 'pages/projects'; -import { Children, cloneElement, isValidElement, ReactElement } from 'react'; -import { VscGithubInverted } from 'react-icons/vsc'; - -type ProjectCardProps = { - project: Project; - icon?: ReactElement<{ className?: string }>; -}; - -const ProjectCard = ({ project, icon }: ProjectCardProps) => { - const Icon = Children.map(icon, (child) => { - if (!isValidElement(child)) return child; - return cloneElement(child, { - className: 'w-8 h-8', - }); - }); - - return ( - <> -
- {Icon ? Icon : } - - -

- {project.name} -

- - {project.description} - -
-
- - ); -}; - -export default ProjectCard;