From ca2593fa530a3f15bd309307cd7d378c4aa19be8 Mon Sep 17 00:00:00 2001 From: Pottabathini Vivekananda Date: Thu, 13 Nov 2025 01:01:49 +0530 Subject: [PATCH] perf: optimize YouTube embed and improve font loading (#113) --- public/logos/yt-logo-red.svg | 8 +++++ src/app/layout.tsx | 34 ++++++++++++++++--- src/components/youtube-video.tsx | 54 +++++++++++++++++++++++++------ src/fonts/Switzer-Bold.woff2 | Bin 0 -> 19432 bytes src/fonts/Switzer-Medium.woff2 | Bin 0 -> 19564 bytes src/fonts/Switzer-Regular.woff2 | Bin 0 -> 16728 bytes src/fonts/Switzer-Semibold.woff2 | Bin 0 -> 19640 bytes src/styles/tailwind.css | 2 +- 8 files changed, 83 insertions(+), 15 deletions(-) create mode 100644 public/logos/yt-logo-red.svg create mode 100644 src/fonts/Switzer-Bold.woff2 create mode 100644 src/fonts/Switzer-Medium.woff2 create mode 100644 src/fonts/Switzer-Regular.woff2 create mode 100644 src/fonts/Switzer-Semibold.woff2 diff --git a/public/logos/yt-logo-red.svg b/public/logos/yt-logo-red.svg new file mode 100644 index 0000000..c49a5ad --- /dev/null +++ b/public/logos/yt-logo-red.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 2092cc7..dd61f29 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,5 +1,6 @@ import '@/styles/tailwind.css' import type { Metadata } from 'next' +import localFont from 'next/font/local' import { Bricolage_Grotesque } from 'next/font/google' @@ -9,6 +10,33 @@ const bricolage = Bricolage_Grotesque({ variable: '--font-bricolage', }) +const switzer = localFont({ + src: [ + { + path: '../fonts/Switzer-Regular.woff2', + weight: '400', + style: 'normal', + }, + { + path: '../fonts/Switzer-Medium.woff2', + weight: '500', + style: 'normal', + }, + { + path: '../fonts/Switzer-Semibold.woff2', + weight: '600', + style: 'normal', + }, + { + path: '../fonts/Switzer-Bold.woff2', + weight: '700', + style: 'normal', + }, + ], + variable: '--font-switzer', + display: 'swap', +}) + export const metadata: Metadata = { title: { template: '%s - Open Healthcare Network', @@ -58,12 +86,8 @@ export default function RootLayout({ children: React.ReactNode }>) { return ( - + - { + setIsLoaded(true) + } + return (
-