tangled
alpha
login
or
join now
flo-bit.dev
/
blento
your personal website on atproto - mirror
blento.app
20
fork
atom
overview
issues
pulls
pipelines
refactor pt7
Florian
2 weeks ago
f1dfd27f
d529a5d5
+46
-24
7 changed files
expand all
collapse all
unified
split
.claude
settings.local.json
src
lib
cards
BlueskyPostCard
BlueskyPostCard.svelte
GameCards
DinoGameCard
DinoGameCard.svelte
TetrisCard
TetrisCard.svelte
LivestreamCard
LivestreamCard.svelte
utils
YoutubeVideoPlayer.svelte
components
bluesky-post
index.ts
+13
-12
.claude/settings.local.json
···
1
{
2
-
"permissions": {
3
-
"allow": [
4
-
"Bash(pnpm check:*)",
5
-
"mcp__ide__getDiagnostics",
6
-
"mcp__plugin_svelte_svelte__svelte-autofixer",
7
-
"mcp__plugin_svelte_svelte__list-sections",
8
-
"Bash(pkill:*)",
9
-
"Bash(timeout 8 pnpm dev:*)",
10
-
"Bash(git checkout:*)",
11
-
"Bash(npx svelte-kit:*)"
12
-
]
13
-
}
0
14
}
···
1
{
2
+
"permissions": {
3
+
"allow": [
4
+
"Bash(pnpm check:*)",
5
+
"mcp__ide__getDiagnostics",
6
+
"mcp__plugin_svelte_svelte__svelte-autofixer",
7
+
"mcp__plugin_svelte_svelte__list-sections",
8
+
"Bash(pkill:*)",
9
+
"Bash(timeout 8 pnpm dev:*)",
10
+
"Bash(git checkout:*)",
11
+
"Bash(npx svelte-kit:*)",
12
+
"Bash(ls:*)"
13
+
]
14
+
}
15
}
+1
-2
src/lib/cards/BlueskyPostCard/BlueskyPostCard.svelte
···
19
feed = (
20
(await CardDefinitionsByType[item.cardType]?.loadData?.([], {
21
did,
22
-
handle,
23
-
platform: undefined
24
})) as any
25
).feed;
26
···
19
feed = (
20
(await CardDefinitionsByType[item.cardType]?.loadData?.([], {
21
did,
22
+
handle
0
23
})) as any
24
).feed;
25
+1
src/lib/cards/GameCards/DinoGameCard/DinoGameCard.svelte
···
529
</script>
530
531
<!-- svelte-ignore a11y_no_noninteractive_tabindex a11y_no_noninteractive_element_interactions -->
0
532
<div
533
bind:this={container}
534
class="relative h-full w-full overflow-hidden outline-none"
···
529
</script>
530
531
<!-- svelte-ignore a11y_no_noninteractive_tabindex a11y_no_noninteractive_element_interactions -->
532
+
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
533
<div
534
bind:this={container}
535
class="relative h-full w-full overflow-hidden outline-none"
+1
src/lib/cards/GameCards/TetrisCard/TetrisCard.svelte
···
1007
</script>
1008
1009
<!-- svelte-ignore a11y_no_noninteractive_tabindex a11y_no_noninteractive_element_interactions -->
0
1010
<div
1011
bind:this={container}
1012
class="relative h-full w-full overflow-hidden outline-none"
···
1007
</script>
1008
1009
<!-- svelte-ignore a11y_no_noninteractive_tabindex a11y_no_noninteractive_element_interactions -->
1010
+
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
1011
<div
1012
bind:this={container}
1013
class="relative h-full w-full overflow-hidden outline-none"
+2
-3
src/lib/cards/LivestreamCard/LivestreamCard.svelte
···
40
if (!latestLivestream) {
41
latestLivestream = (await CardDefinitionsByType[item.cardType]?.loadData?.([], {
42
did,
43
-
handle,
44
-
platform: undefined
45
})) as
46
| {
47
createdAt: string;
···
83
{:else if latestLivestream.online === false}
84
<Badge size="sm" class="accent:text-base-900">ended</Badge>
85
{:else}
86
-
<div class="h-[22px]"></div>
87
{/if}
88
</div>
89
···
40
if (!latestLivestream) {
41
latestLivestream = (await CardDefinitionsByType[item.cardType]?.loadData?.([], {
42
did,
43
+
handle
0
44
})) as
45
| {
46
createdAt: string;
···
82
{:else if latestLivestream.online === false}
83
<Badge size="sm" class="accent:text-base-900">ended</Badge>
84
{:else}
85
+
<div class="h-5.5"></div>
86
{/if}
87
</div>
88
+24
-6
src/lib/cards/utils/YoutubeVideoPlayer.svelte
···
21
import { cn } from '@foxui/core';
22
import { onDestroy, onMount } from 'svelte';
23
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
24
const { class: className }: { class?: string } = $props();
25
26
-
let Plyr = $state();
27
28
-
let player = $state();
29
30
onMount(async () => {
31
-
if (!Plyr) Plyr = (await import('plyr')).default;
0
0
0
32
33
-
const player = new Plyr('.js-player', {
34
settings: ['captions', 'quality', 'loop', 'speed'],
35
controls: [
36
'play-large',
···
59
60
// when loaded play the video and go fullscreen
61
player.on('ready', () => {
62
-
player.play();
63
//player.fullscreen.enter();
64
});
65
});
···
87
88
{#key videoPlayer.id}
89
{#if videoPlayer.id}
90
-
<div class="fixed inset-0 z-[100] flex h-screen w-screen items-center justify-center">
91
<button
92
onclick={() => videoPlayer.hide()}
93
class="absolute inset-0 bg-black/70 backdrop-blur-sm"
···
21
import { cn } from '@foxui/core';
22
import { onDestroy, onMount } from 'svelte';
23
24
+
// Minimal Plyr interface for what we use
25
+
interface PlyrInstance {
26
+
source: {
27
+
type: string;
28
+
sources: { src: string; type: string }[];
29
+
};
30
+
on: (event: string, callback: () => void) => void;
31
+
play: () => void;
32
+
destroy: () => void;
33
+
}
34
+
35
+
interface PlyrConstructorType {
36
+
new (selector: string, options: Record<string, unknown>): PlyrInstance;
37
+
}
38
+
39
const { class: className }: { class?: string } = $props();
40
41
+
let PlyrConstructor: PlyrConstructorType | undefined = $state();
42
43
+
let player: PlyrInstance | undefined = $state();
44
45
onMount(async () => {
46
+
if (!PlyrConstructor) {
47
+
const plyrModule = (await import('plyr')) as unknown as { default: PlyrConstructorType };
48
+
PlyrConstructor = plyrModule.default;
49
+
}
50
51
+
player = new PlyrConstructor('.js-player', {
52
settings: ['captions', 'quality', 'loop', 'speed'],
53
controls: [
54
'play-large',
···
77
78
// when loaded play the video and go fullscreen
79
player.on('ready', () => {
80
+
player?.play();
81
//player.fullscreen.enter();
82
});
83
});
···
105
106
{#key videoPlayer.id}
107
{#if videoPlayer.id}
108
+
<div class="fixed inset-0 z-100 flex h-screen w-screen items-center justify-center">
109
<button
110
onclick={() => videoPlayer.hide()}
111
class="absolute inset-0 bg-black/70 backdrop-blur-sm"
+4
-1
src/lib/components/bluesky-post/index.ts
···
127
return '';
128
}
129
130
-
const html = RichText({ text: post.record.text, facets: post.record.facets }, baseUrl);
0
0
0
131
132
return html.replace(/\n/g, '<br>');
133
}
···
127
return '';
128
}
129
130
+
const html = RichText(
131
+
{ text: post.record.text as string, facets: post.record.facets as Facet[] },
132
+
baseUrl
133
+
);
134
135
return html.replace(/\n/g, '<br>');
136
}