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
github card: fix layout shift
Florian
3 weeks ago
2b956fde
b2e41b67
+30
-28
1 changed file
expand all
collapse all
unified
split
src
lib
cards
GitHubProfileCard
GitHubProfileCard.svelte
+30
-28
src/lib/cards/GitHubProfileCard/GitHubProfileCard.svelte
···
6
import type { GithubProfileLoadedData } from '.';
7
import GithubContributionsGraph from './GithubContributionsGraph.svelte';
8
import { Button } from '@foxui/core';
0
0
9
10
let { item }: ContentComponentProps = $props();
11
···
38
</script>
39
40
<div class="h-full overflow-hidden p-4">
41
-
<div class="flex h-full flex-col justify-between">
42
-
<!-- Header -->
43
-
<div class="flex justify-between">
44
-
<div class="flex items-center gap-3">
45
-
<div class="fill-base-950 size-6 shrink-0 dark:fill-white [&_svg]:size-full">
46
-
{@html siGithub.svg}
47
-
</div>
48
-
<a
49
-
href="https://github.com/{item.cardData.user}"
50
-
target="_blank"
51
-
rel="noopener noreferrer"
52
-
class=" flex truncate text-2xl font-bold transition-colors"
53
-
>
54
-
{item.cardData.user}
55
-
</a>
56
</div>
57
-
58
-
{#if isMobile() ? item.mobileW > 4 : item.w > 2}
59
-
<Button
60
-
href="https://github.com/{item.cardData.user}"
61
-
target="_blank"
62
-
rel="noopener noreferrer"
63
-
class="z-50">Follow</Button
64
-
>
65
-
{/if}
66
</div>
67
68
-
{#if contributionsData}
69
-
<div class="flex">
0
0
0
0
0
0
0
0
0
0
70
<GithubContributionsGraph
71
data={contributionsData}
72
isBig={isMobile() ? item.mobileH > 5 : item.h > 2}
73
/>
74
</div>
75
-
{/if}
76
-
</div>
77
</div>
78
79
{#if item.cardData.href}
···
6
import type { GithubProfileLoadedData } from '.';
7
import GithubContributionsGraph from './GithubContributionsGraph.svelte';
8
import { Button } from '@foxui/core';
9
+
import { browser } from '$app/environment';
10
+
import { fade } from 'svelte/transition';
11
12
let { item }: ContentComponentProps = $props();
13
···
40
</script>
41
42
<div class="h-full overflow-hidden p-4">
43
+
<div class="flex h-full flex-col justify-between">
44
+
<!-- Header -->
45
+
<div class="flex justify-between">
46
+
<div class="flex items-center gap-3">
47
+
<div class="fill-base-950 size-6 shrink-0 dark:fill-white [&_svg]:size-full">
48
+
{@html siGithub.svg}
0
0
0
0
0
0
0
0
0
49
</div>
50
+
<a
51
+
href="https://github.com/{item.cardData.user}"
52
+
target="_blank"
53
+
rel="noopener noreferrer"
54
+
class=" flex truncate text-2xl font-bold transition-colors"
55
+
>
56
+
{item.cardData.user}
57
+
</a>
0
58
</div>
59
60
+
{#if isMobile() ? item.mobileW > 4 : item.w > 2}
61
+
<Button
62
+
href="https://github.com/{item.cardData.user}"
63
+
target="_blank"
64
+
rel="noopener noreferrer"
65
+
class="z-50">Follow</Button
66
+
>
67
+
{/if}
68
+
</div>
69
+
70
+
{#if contributionsData && browser}
71
+
<div class="flex opacity-100 transition-opacity duration-300 starting:opacity-0">
72
<GithubContributionsGraph
73
data={contributionsData}
74
isBig={isMobile() ? item.mobileH > 5 : item.h > 2}
75
/>
76
</div>
77
+
{/if}
78
+
</div>
79
</div>
80
81
{#if item.cardData.href}