Spaces:
Sleeping
Sleeping
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 |
-
|
| 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 |
-
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
-
let { name,
|
| 12 |
</script>
|
| 13 |
|
| 14 |
-
<div
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
</h1>
|
| 22 |
-
</div>
|
| 23 |
|
| 24 |
-
|
| 25 |
-
class="flex
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 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
|
|
|
Git LFS Details
|