victor HF Staff commited on
Commit
b9b13da
·
unverified ·
1 Parent(s): 2e541ae

Thumbnails (#1879)

Browse files

* Update HuggingChat thumbnail and logo rendering

* Update ModelThumbnail.svelte

src/routes/models/[...model]/thumbnail.png/+server.ts CHANGED
@@ -10,6 +10,7 @@ import InterBold from "$lib/server/fonts/Inter-Bold.ttf";
10
  import { base } from "$app/paths";
11
  import { models } from "$lib/server/models";
12
  import { render } from "svelte/server";
 
13
 
14
  export const GET: RequestHandler = (async ({ params }) => {
15
  const model = models.find(({ id }) => id === params.model);
@@ -20,7 +21,7 @@ export const GET: RequestHandler = (async ({ params }) => {
20
  const renderedComponent = render(ModelThumbnail, {
21
  props: {
22
  name: model.name,
23
- logoUrl: model.logoUrl,
24
  },
25
  });
26
 
 
10
  import { base } from "$app/paths";
11
  import { models } from "$lib/server/models";
12
  import { render } from "svelte/server";
13
+ import { config } from "$lib/server/config";
14
 
15
  export const GET: RequestHandler = (async ({ params }) => {
16
  const model = models.find(({ id }) => id === params.model);
 
21
  const renderedComponent = render(ModelThumbnail, {
22
  props: {
23
  name: model.name,
24
+ isHuggingChat: config.isHuggingChat,
25
  },
26
  });
27
 
src/routes/models/[...model]/thumbnail.png/ModelThumbnail.svelte CHANGED
@@ -1,43 +1,28 @@
1
  <script lang="ts">
2
- import logo from "../../../../../static/huggingchat/logo.svg?raw";
3
- import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
4
- const publicConfig = usePublicConfig();
5
 
6
  interface Props {
7
  name: string;
8
- logoUrl: string | undefined;
 
9
  }
10
 
11
- let { name, logoUrl }: Props = $props();
12
  </script>
13
 
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>
23
 
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>
43
  </div>
 
1
  <script lang="ts">
2
+ import logo from "../../../../../static/huggingchat/fulltext-logo.svg?raw";
 
 
3
 
4
  interface Props {
5
  name: string;
6
+ isHuggingChat?: boolean;
7
+ backgroundImage?: string;
8
  }
9
 
10
+ let { name, isHuggingChat = false }: Props = $props();
11
  </script>
12
 
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>
 
 
20
 
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}
 
 
 
 
 
 
 
 
 
 
 
 
28
  </div>
static/huggingchat/fulltext-logo.svg ADDED
static/huggingchat/thumbnail.png CHANGED

Git LFS Details

  • SHA256: 7df3570943d07ab30c4d5e54008809452e5032d29612135015fa662fb23805c7
  • Pointer size: 130 Bytes
  • Size of remote file: 13.4 kB

Git LFS Details

  • SHA256: e32a757b31f664b89a088d483b8a6fb73df17832c99642dd3a864d99d06690d1
  • Pointer size: 130 Bytes
  • Size of remote file: 11.8 kB