-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement opengraph and other stuff (#1)
- Loading branch information
1 parent
cee41d3
commit 2634109
Showing
6 changed files
with
79 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* eslint-disable react/no-unknown-property */ | ||
|
||
import { ImageResponse } from "next/og" | ||
|
||
export const runtime = "edge" | ||
|
||
export const alt = "About Acme" | ||
export const size = { | ||
height: 630, | ||
width: 1200, | ||
} | ||
|
||
export const contentType = "image/png" | ||
|
||
export default function OG() { | ||
const BG_OPTIONS = [ | ||
{ | ||
backgroundColor: "#8BC6EC", | ||
backgroundImage: | ||
"linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%)", | ||
}, | ||
{ | ||
backgroundColor: "#21D4FD", | ||
backgroundImage: "linear-gradient(19deg, #21D4FD 0%, #B721FF 100%)", | ||
}, | ||
{ | ||
backgroundColor: "#8BC6EC", | ||
backgroundImage: | ||
"linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%)", | ||
}, | ||
{ | ||
backgroundColor: "#8EC5FC", | ||
backgroundImage: "linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%)", | ||
}, | ||
{ | ||
backgroundColor: "#08AEEA", | ||
backgroundImage: "linear-gradient(0deg, #08AEEA 0%, #2AF598 100%)", | ||
}, | ||
{ | ||
backgroundColor: "#3EECAC", | ||
backgroundImage: "linear-gradient(19deg, #3EECAC 0%, #EE74E1 100%)", | ||
}, | ||
{ | ||
backgroundColor: "#FF3CAC", | ||
backgroundImage: | ||
"linear-gradient(225deg, #FF3CAC 0%, #784BA0 50%, #2B86C5 100%)", | ||
}, | ||
] | ||
|
||
return new ImageResponse( | ||
( | ||
<div | ||
style={ | ||
BG_OPTIONS[Math.floor(Math.random() * BG_OPTIONS.length)] | ||
} | ||
tw="w-full h-full" | ||
></div> | ||
), | ||
{ | ||
...size, | ||
// fonts: [ | ||
// { | ||
// data: await interSemiBold, | ||
// name: "Inter", | ||
// style: "normal", | ||
// weight: 400, | ||
// }, | ||
// ], | ||
}, | ||
) | ||
} |