Updated fwt

This commit is contained in:
Patrick Alvin Alcala 2025-09-04 13:11:50 +08:00
parent 69bb9c1f14
commit ae970682c5

View file

@ -1,5 +1,7 @@
import './HTML.sass'
import { type JSXElement, Show } from 'solid-js'
import background1 from '../../images/background.avif'
import background2 from '../../images/background.webp'
interface Props {
title: string
@ -7,6 +9,7 @@ interface Props {
description: string
children: JSXElement
font?: 'roboto' | 'inter' | 'montserrat' | 'open-sans' | 'public-sans'
preloadBackground?: boolean
}
export default (props: Props) => {
@ -23,13 +26,16 @@ export default (props: Props) => {
<meta property="og:description" content={props.description} />
<meta property="og:type" content="website" />
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
<link rel="preload" href={`https://cdn.jsdelivr.net/fontsource/fonts/${props.font}:vf@latest/latin-wght-normal.woff2`} crossorigin="anonymous" as="font" type="font/woff2" />
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<Show when={props.preloadBackground}>
<link rel="preload" href={background1.src} as="image" type="image/svg+xml" />
<link rel="preload" href={background2.src} as="image" type="image/svg+xml" />
</Show>
<title>{props.title}</title>
</head>
<body class={props.font}>{props.children}</body>
</html>
s
</>
)
}