Skip to content

Commit 5c1e2a4

Browse files
finalize design, fix CSS issues
1 parent 428f6c1 commit 5c1e2a4

File tree

4 files changed

+36
-61
lines changed

4 files changed

+36
-61
lines changed

src/routes/og/+page.svelte

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/routes/og/+page.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/routes/og/+server.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { render } from "svelte/server";
22
import { read } from "$app/server";
33
import DMSerifDisplay from "@fontsource/dm-serif-display/files/dm-serif-display-latin-400-normal.woff";
44
import Pretendard from "@fontsource/pretendard/files/pretendard-latin-400-normal.woff";
5+
import PretendardSemibold from "@fontsource/pretendard/files/pretendard-latin-600-normal.woff";
56
import { Resvg } from "@resvg/resvg-js";
67
import satori from "satori";
78
import { html } from "satori-html";
@@ -10,6 +11,7 @@ import Thumbnail from "./Thumbnail.svelte";
1011
import { OG_HEIGHT, OG_WIDTH } from "./constants";
1112

1213
const sansFont = read(Pretendard).arrayBuffer();
14+
const sansFontSemibold = read(PretendardSemibold).arrayBuffer();
1315
const displayFont = read(DMSerifDisplay).arrayBuffer();
1416

1517
// Sources: https://github.com/huggingface/chat-ui/blob/main/src/routes/assistant/%5BassistantId%5D/thumbnail.png/%2Bserver.ts#L44-L82
@@ -29,13 +31,19 @@ export const GET: RequestHandler = async ({ url }) => {
2931
height: OG_HEIGHT,
3032
fonts: [
3133
{
32-
name: "Pretendard",
34+
name: "SansFont",
3335
data: await sansFont,
3436
weight: 400,
3537
style: "normal"
3638
},
3739
{
38-
name: "DM Serif Display",
40+
name: "SansFontSemibold",
41+
data: await sansFontSemibold,
42+
weight: 600,
43+
style: "normal"
44+
},
45+
{
46+
name: "DisplayFont",
3947
data: await displayFont,
4048
weight: 400,
4149
style: "normal"

src/routes/og/Thumbnail.svelte

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,34 @@
22
type Props = {
33
title: string;
44
description?: string;
5+
secondaryIconUrl?: string;
56
};
67
7-
let { title, description = undefined }: Props = $props();
8+
let { title, description, secondaryIconUrl }: Props = $props();
89
</script>
910

10-
<div class="my-auto flex h-full w-full flex-col justify-center p-4">
11-
<p class="font-display text-7xl">{title}</p>
12-
{#if description}
13-
<p class="text-4xl text-muted-foreground">{description}</p>
14-
{/if}
11+
<div class="flex h-full w-full border-b border-orange-600" style:border-bottom-width="32px">
12+
<div class="flex flex-col p-8">
13+
<div class="flex items-center" style:gap="8">
14+
<img
15+
src="https://raw.githubusercontent.com/sveltejs/branding/master/svelte-logo.svg"
16+
alt="Svelte"
17+
class="w-16"
18+
/>
19+
<span class="flex text-4xl" style:gap="6">
20+
<span style:font-family="DisplayFont">Svelte</span>
21+
<span class="text-orange-600" style:font-family="SansFontSemibold">Changelog</span>
22+
</span>
23+
</div>
24+
{#if secondaryIconUrl}
25+
{@const src = secondaryIconUrl}
26+
<img {src} alt="Secondary icon" class="ml-auto w-16" />
27+
{/if}
28+
<div class="my-auto flex flex-col justify-center">
29+
<p class="text-7xl" style:font-family="DisplayFont">{title}</p>
30+
{#if description}
31+
<p class="text-4xl text-gray-600" style:font-family="SansFont">{description}</p>
32+
{/if}
33+
</div>
34+
</div>
1535
</div>

0 commit comments

Comments
 (0)