Skip to content

Commit a861acf

Browse files
authored
Thumbnails (#1879)
* Update HuggingChat thumbnail and logo rendering * Update ModelThumbnail.svelte
1 parent f713013 commit a861acf

File tree

4 files changed

+22
-34
lines changed

4 files changed

+22
-34
lines changed

src/routes/models/[...model]/thumbnail.png/+server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import InterBold from "$lib/server/fonts/Inter-Bold.ttf";
1010
import { base } from "$app/paths";
1111
import { models } from "$lib/server/models";
1212
import { render } from "svelte/server";
13+
import { config } from "$lib/server/config";
1314

1415
export const GET: RequestHandler = (async ({ params }) => {
1516
const model = models.find(({ id }) => id === params.model);
@@ -20,7 +21,7 @@ export const GET: RequestHandler = (async ({ params }) => {
2021
const renderedComponent = render(ModelThumbnail, {
2122
props: {
2223
name: model.name,
23-
logoUrl: model.logoUrl,
24+
isHuggingChat: config.isHuggingChat,
2425
},
2526
});
2627

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,28 @@
11
<script lang="ts">
2-
import logo from "../../../../../static/huggingchat/logo.svg?raw";
3-
import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
4-
const publicConfig = usePublicConfig();
2+
import logo from "../../../../../static/huggingchat/fulltext-logo.svg?raw";
53
64
interface Props {
75
name: string;
8-
logoUrl: string | undefined;
6+
isHuggingChat?: boolean;
7+
backgroundImage?: string;
98
}
109
11-
let { name, logoUrl }: Props = $props();
10+
let { name, isHuggingChat = false }: Props = $props();
1211
</script>
1312

14-
<div class=" flex h-[648px] w-full flex-col items-center bg-white">
15-
<div class="flex flex-1 flex-col items-center justify-center">
16-
{#if logoUrl}
17-
<img class="h-48 w-48" src={logoUrl} alt="avatar" />
18-
{/if}
19-
<h1 class="m-0 text-5xl font-bold text-black">
20-
{name}
21-
</h1>
22-
</div>
13+
<div
14+
class=" flex h-[648px] w-full flex-col items-center justify-center bg-black text-white"
15+
style="background-image: url(https://cdn-uploads.huggingface.co/production/uploads/5f17f0a0925b9863e28ad517/L4XVRJ7MsfFDD7ROx_geO.png);"
16+
>
17+
<h1 class="mb-8 text-7xl font-bold text-white">
18+
{name.split("/")[1]}
19+
</h1>
2320

24-
<div
25-
class="flex h-[200px] w-full flex-col items-center justify-center rounded-b-none bg-{publicConfig.PUBLIC_APP_COLOR}-500/10 pb-10 pt-10 text-4xl text-gray-500"
26-
style="border-radius: 100% 100% 0 0;"
27-
>
28-
Try it now
29-
{#if publicConfig.isHuggingChat}
30-
on
31-
{/if}
32-
33-
{#if publicConfig.isHuggingChat}
34-
<div class="flex flex-row pt-3 text-5xl font-bold text-black">
35-
<div class="mr-5 flex items-center justify-center" id="logo">
36-
<!-- eslint-disable-next-line -->
37-
{@html logo}
38-
</div>
39-
<span>HuggingChat</span>
40-
</div>
41-
{/if}
42-
</div>
21+
{#if isHuggingChat}
22+
<div class="flex items-center text-5xl text-white">
23+
<div class="mr-4 text-4xl">Chat with it on</div>
24+
<!-- eslint-disable-next-line -->
25+
{@html logo}
26+
</div>
27+
{/if}
4328
</div>
Lines changed: 2 additions & 0 deletions
Loading

static/huggingchat/thumbnail.png

-1.54 KB
Loading

0 commit comments

Comments
 (0)