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