Skip to content

Commit 9eecad0

Browse files
committed
feat: add logos, labels, and loading indicators to home page
1 parent d748eee commit 9eecad0

File tree

7 files changed

+364
-128
lines changed

7 files changed

+364
-128
lines changed

src/lib/api/runtimeAppData.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,8 @@ export function createOverlayURLQuery() {
9090
});
9191
}
9292

93-
/**
94-
* Create a query to load the twitch URL
95-
*/
96-
export function createTwitchOAuthURLQuery() {
97-
return createQuery({
98-
queryKey: ["twitch-oauth-url"],
99-
queryFn: () => invoke<string>("get_twitch_oauth_uri"),
100-
});
93+
export function getTwitchOAuthURI() {
94+
return invoke<string>("get_twitch_oauth_uri");
10195
}
10296

10397
/**
@@ -117,6 +111,8 @@ export function createDeriveModelCalibrated(
117111
return derived(
118112
[modelData, runtimeAppData],
119113
([$modelData, $runtimeAppData]) => {
114+
console.log($runtimeAppData.model_id, $modelData);
115+
120116
// No model active
121117
if ($runtimeAppData.model_id === null) {
122118
return false;

src/lib/components/Card.svelte

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script lang="ts">
2+
import type { Snippet } from "svelte";
3+
import type { HTMLAttributes } from "svelte/elements";
4+
5+
type Props = {
6+
children?: Snippet;
7+
} & HTMLAttributes<HTMLDivElement>;
8+
9+
const { children, ...props }: Props = $props();
10+
</script>
11+
12+
<div {...props} class="card">
13+
{@render children?.()}
14+
</div>
15+
16+
<style>
17+
.card {
18+
background-color: #1a1a1a;
19+
border: 1px solid #2f2f2f;
20+
padding: 1rem;
21+
border-radius: 0.5rem;
22+
}
23+
</style>
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<script lang="ts">
2+
import type { HTMLAttributes } from "svelte/elements";
3+
4+
import Card from "./Card.svelte";
5+
6+
type Props = {} & HTMLAttributes<HTMLDivElement>;
7+
8+
const props: Props = $props();
9+
</script>
10+
11+
<Card {...props}>
12+
<div class="row">
13+
<div class="skeleton circle"></div>
14+
15+
<div class="column">
16+
<div class="skeleton" style="width: 25%; height: 1.25rem"></div>
17+
<div class="skeleton" style="width: 60%; height: 1.25rem"></div>
18+
</div>
19+
</div>
20+
</Card>
21+
22+
<style>
23+
.row {
24+
display: flex;
25+
gap: 1rem;
26+
flex-flow: row;
27+
align-items: center;
28+
}
29+
30+
.circle {
31+
width: 4rem;
32+
height: 4rem;
33+
34+
border-radius: 100%;
35+
}
36+
37+
.column {
38+
flex: auto;
39+
display: flex;
40+
gap: 1rem;
41+
flex-flow: column;
42+
}
43+
</style>

src/lib/components/Label.svelte

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<script lang="ts">
2+
import type { Snippet } from "svelte";
3+
4+
type Props = {
5+
color?: "red" | "green" | "blue" | "yellow" | "purple";
6+
size?: "small" | "medium" | "large";
7+
children?: Snippet;
8+
};
9+
10+
const { color = "green", size = "small", children }: Props = $props();
11+
</script>
12+
13+
<span class="label" data-color={color} data-size={size}>
14+
{@render children?.()}
15+
</span>
16+
17+
<style>
18+
.label {
19+
display: inline-block;
20+
margin: 0 0.2rem;
21+
background-color: #222;
22+
border: 1px solid #111;
23+
color: #ccc;
24+
font-size: 0.9rem;
25+
font-weight: normal;
26+
27+
border-radius: 0.25rem;
28+
padding: 0.25rem 0.75rem;
29+
30+
vertical-align: middle;
31+
}
32+
33+
.label[data-size="small"] {
34+
font-size: 0.8rem;
35+
padding: 0.15rem 0.5rem;
36+
}
37+
38+
.label[data-color="purple"] {
39+
border-color: #dd82f0;
40+
background-color: #3c1b42;
41+
color: #dd82f0;
42+
}
43+
44+
.label[data-color="red"] {
45+
border-color: #f08282;
46+
background-color: #421b1b;
47+
color: #f08282;
48+
}
49+
50+
.label[data-color="yellow"] {
51+
border-color: #eef082;
52+
background-color: #423f1b;
53+
color: #f0ee82;
54+
}
55+
56+
.label[data-color="green"] {
57+
border-color: #a1f082;
58+
background-color: #1b421b;
59+
color: #a1f082;
60+
}
61+
62+
.label[data-color="blue"] {
63+
border-color: #82bbf0;
64+
background-color: #1b2f42;
65+
color: #82bbf0;
66+
}
67+
</style>

src/lib/styles/global.scss

+16
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ body {
66
font-family: "Roboto", sans-serif;
77
}
88

9+
.skeleton {
10+
border-radius: 1rem;
11+
background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
12+
background-size: 200% 100%;
13+
animation: shimmer 1.5s infinite;
14+
}
15+
16+
@keyframes shimmer {
17+
0% {
18+
background-position: -200% 0;
19+
}
20+
100% {
21+
background-position: 200% 0;
22+
}
23+
}
24+
925
.text-stack {
1026
display: flex;
1127
flex-flow: column;

0 commit comments

Comments
 (0)