mirror of
https://github.com/vercel/commerce.git
synced 2025-05-14 21:47:51 +00:00
add fonts
This commit is contained in:
parent
2cb348259a
commit
7a4a7cf4ed
@ -1,7 +1,8 @@
|
||||
import Navbar from 'components/layout/navbar';
|
||||
import { i18n } from 'i18n-config';
|
||||
import { Inter } from 'next/font/google';
|
||||
import { Locale, i18n } from 'i18n-config';
|
||||
import localFont from 'next/font/local';
|
||||
import { ReactNode, Suspense } from 'react';
|
||||
|
||||
import './globals.css';
|
||||
|
||||
const { TWITTER_CREATOR, TWITTER_SITE, SITE_NAME } = process.env;
|
||||
@ -29,10 +30,27 @@ export const metadata = {
|
||||
})
|
||||
};
|
||||
|
||||
const inter = Inter({
|
||||
subsets: ['latin'],
|
||||
// Font files can be colocated inside of `app`
|
||||
const cinzel = localFont({
|
||||
src: '../fonts/Cinzel-Regular.ttf',
|
||||
display: 'swap',
|
||||
variable: '--font-inter'
|
||||
variable: '--font-cinzel'
|
||||
});
|
||||
|
||||
const alpina = localFont({
|
||||
src: [
|
||||
{
|
||||
path: '../fonts/GT-Alpina-Regular-Trial.woff2',
|
||||
weight: '400',
|
||||
style: 'normal'
|
||||
},
|
||||
{
|
||||
path: '../fonts/GT-Alpina-Bold-Trial.woff2',
|
||||
weight: '700',
|
||||
style: 'normal'
|
||||
}
|
||||
],
|
||||
variable: '--font-alpina'
|
||||
});
|
||||
|
||||
export async function generateStaticParams() {
|
||||
@ -47,10 +65,10 @@ export default async function RootLayout({
|
||||
params: { lang: string };
|
||||
}) {
|
||||
return (
|
||||
<html lang={params.lang} className={inter.variable}>
|
||||
<html lang={params.lang} className={`${cinzel.variable} ${alpina.variable}`}>
|
||||
<body className="bg-dark text-white selection:bg-green-800 selection:text-green-400">
|
||||
<div className="mx-auto max-w-screen-2xl">
|
||||
<Navbar lang={params.lang} />
|
||||
<Navbar lang={params.lang as Locale} />
|
||||
<Suspense>
|
||||
<main>{children}</main>
|
||||
</Suspense>
|
||||
|
@ -25,7 +25,7 @@ export default async function HomePage({ params: { lang } }: { params: { lang: L
|
||||
<div className="invisible absolute right-40 top-12 md:visible">
|
||||
<LanguageControl lang={lang} />
|
||||
</div>
|
||||
<div className="px-6 pb-12 pt-6 md:py-12 md:pl-6">
|
||||
<div className="px-6 pb-12 pt-6 md:pb-48 md:pl-6 md:pt-12">
|
||||
<Image
|
||||
src={Namemark}
|
||||
alt="narai by suginomori brewery"
|
||||
|
BIN
app/fonts/Cinzel-Regular.ttf
Normal file
BIN
app/fonts/Cinzel-Regular.ttf
Normal file
Binary file not shown.
BIN
app/fonts/GT-Alpina-Bold-Trial.woff2
Normal file
BIN
app/fonts/GT-Alpina-Bold-Trial.woff2
Normal file
Binary file not shown.
BIN
app/fonts/GT-Alpina-Regular-Trial.woff2
Normal file
BIN
app/fonts/GT-Alpina-Regular-Trial.woff2
Normal file
Binary file not shown.
@ -3,25 +3,30 @@ import { GridTileImage } from 'components/grid/tile';
|
||||
import { getCollectionProducts } from 'lib/shopify';
|
||||
import type { Product } from 'lib/shopify/types';
|
||||
import Link from 'next/link';
|
||||
import Label from '../label';
|
||||
|
||||
function ThreeItemGridItem({ item, priority }: { item: Product; priority?: boolean }) {
|
||||
return (
|
||||
<div className={clsx('md:col-span-2 md:row-span-1')}>
|
||||
<Link className="relative block aspect-square h-full w-full" href={`/product/${item.handle}`}>
|
||||
<Link
|
||||
className="relative block aspect-bottle h-full w-full overflow-hidden bg-black/30"
|
||||
href={`/product/${item.handle}`}
|
||||
>
|
||||
<GridTileImage
|
||||
src={item.featuredImage.url}
|
||||
fill
|
||||
sizes={'(min-width: 768px) 33vw, 100vw'}
|
||||
priority={priority}
|
||||
alt={item.title}
|
||||
label={{
|
||||
position: 'bottom',
|
||||
title: item.title as string,
|
||||
amount: item.priceRange.maxVariantPrice.amount,
|
||||
currencyCode: item.priceRange.maxVariantPrice.currencyCode
|
||||
}}
|
||||
/>
|
||||
</Link>
|
||||
<div className="pt-4">
|
||||
<Label
|
||||
title={item.title as string}
|
||||
amount={item.priceRange.maxVariantPrice.amount}
|
||||
currencyCode={item.priceRange.maxVariantPrice.currencyCode}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
import clsx from 'clsx';
|
||||
import Image from 'next/image';
|
||||
import Label from '../label';
|
||||
|
||||
export function GridTileImage({
|
||||
isInteractive = true,
|
||||
@ -27,9 +26,6 @@ export function GridTileImage({
|
||||
{...props}
|
||||
/>
|
||||
) : null}
|
||||
{label ? (
|
||||
<Label title={label.title} amount={label.amount} currencyCode={label.currencyCode} />
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ export function middleware(request: NextRequest) {
|
||||
// If you have one
|
||||
if (
|
||||
[
|
||||
'/public/addets/images/logo.png',
|
||||
'/public/addets/images/logo+namemark.png',
|
||||
'/public/addets/images/namemark.png'
|
||||
'/public/assets/images/logo.png',
|
||||
'/public/assets/images/logo+namemark.png',
|
||||
'/public/assets/images/namemark.png'
|
||||
// Your other files in `public`
|
||||
].includes(pathname)
|
||||
)
|
||||
|
@ -10,7 +10,11 @@ module.exports = {
|
||||
dark: '#212720'
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ['var(--font-inter)']
|
||||
sans: ['var(--font-alpina)', 'sans-serif'],
|
||||
title: ['var(--font-cinzel)', 'sans-serif']
|
||||
},
|
||||
aspectRatio: {
|
||||
bottle: '0.7065217391'
|
||||
},
|
||||
keyframes: {
|
||||
fadeIn: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user