Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"private": true,
"scripts": {
"dev": "next dev --port 3000",
"build": "next build",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@headlessui/react": "^1.5.0",
"@heroicons/react": "^1.0.6",
"@netlify/plugin-nextjs": "^4.27.3",
"@vercel/og": "^0.0.21",
"axios": "^1.1.3",
"classnames": "^2.3.2",
"framer-motion": "^7.5.1",
Expand Down
62 changes: 62 additions & 0 deletions apps/web/pages/api/og.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { ImageResponse } from "@vercel/og";

export const config = {
runtime: "experimental-edge",
};

const font = fetch(
new URL("../../public/fonts/Roboto-Bold.ttf" as string, import.meta.url)
).then((res) => res.arrayBuffer());

export default async function handler() {
const fontData = await font;
return new ImageResponse(
(
<div
style={{
display: "flex",
height: "100%",
width: "100%",
alignItems: "center",
justifyContent: "center",
letterSpacing: "-.02em",
fontWeight: 700,
backgroundColor: "white",
backgroundImage:
"radial-gradient(circle at 25px 25px, lightgray 2%, transparent 0%), radial-gradient(circle at 75px 75px, lightgray 2%, transparent 0%)",
backgroundSize: "100px 100px",
}}
>
<div
style={{
display: "flex",
flexWrap: "wrap",
justifyContent: "center",
padding: "20px 50px",
margin: "0 42px",
fontSize: 80,
width: "auto",
maxWidth: 550,
textAlign: "center",
backgroundColor: "#008F50",
color: "white",
lineHeight: 1.4,
}}
>
Shatzën
</div>
</div>
),
{
width: 1200,
height: 630,
fonts: [
{
name: "Roboto",
data: fontData,
style: "normal",
},
],
}
);
}
4 changes: 4 additions & 0 deletions apps/web/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const App = () => {
<Head>
<title>Shätzen</title>
<meta property="og:title" content="Shätzen" key="title" />
<meta
property="og:image"
content="https://shatzen.jamiekaram.dev/api/og"
/>
</Head>

<div className="w-[350px] shadow-xl sm:w-[450px] md:w-[500px] md:border-black xl:w-[800px] relative m-auto transition-all">
Expand Down
Binary file added apps/web/public/fonts/Roboto-Bold.ttf
Binary file not shown.
Loading