Skip to content

Commit a10eb96

Browse files
committed
🚧 Fix some resizing issues
1 parent dfd2026 commit a10eb96

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

‎src/components/VideoCarousel.svelte

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,16 @@
3838
</script>
3939

4040
<div class="container" bind:this={container}>
41-
{#key $index}
42-
<Youtube id={VIDEOS[$index]} animations={false} />
43-
{/key}
41+
<Youtube id={VIDEOS[$index]} animations={false} />
42+
{#await getYoutubeVideoTitle(VIDEOS[$index])}
43+
<p class="main-title loading">Loading Title...</p>
44+
{:then title}
45+
<p class="main-title">{title}</p>
46+
{:catch error}
47+
<!-- -->
48+
{/await}
49+
<!-- {#key $index}
50+
{/key} -->
4451
<div class="grid">
4552
{#each VIDEOS as id}
4653
<!-- svelte-ignore a11y-click-events-have-key-events -->
@@ -57,7 +64,7 @@
5764
style={`background-image: url(https://img.youtube.com/vi/${id}/0.jpg);`}
5865
></div>
5966
{#await getYoutubeVideoTitle(id)}
60-
<p>Loading...</p>
67+
<p class="loading">Loading Title...</p>
6168
{:then title}
6269
<p>{title}</p>
6370
{:catch error}
@@ -110,13 +117,21 @@
110117
box-shadow: 2px 2px 8px -4px black;
111118
}
112119
:global(.v__title) {
120+
display: none;
113121
text-align: left;
114122
font-size: 1.5rem;
115123
backdrop-filter: blur(4px);
116124
background: rgba(var(--kd-color-elevate) / 0.5) !important;
117125
padding-bottom: 0.25rem;
118126
text-transform: capitalize;
119127
}
128+
.main-title {
129+
font-size: 1.5rem;
130+
text-align: center;
131+
}
132+
.loading {
133+
color: rgb(139, 139, 139);
134+
}
120135
121136
@media (max-width: 768px) {
122137
.grid {
@@ -126,7 +141,7 @@
126141
width: 128px;
127142
height: 72px;
128143
}
129-
p {
144+
.thumbnail-container p {
130145
text-align: center;
131146
text-transform: capitalize;
132147
max-width: 128px;

‎src/routes/+page.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@
9898
{/each}
9999
</div>
100100

101-
<div class="center-container">
102-
<div class="made-with-aj">
103-
<h2 class="section-title">Made with Animated Java!</h2>
104-
<hr />
101+
<div class="made-with-aj">
102+
<h2 class="section-title">Made with Animated Java!</h2>
103+
<hr />
104+
<div class="center-container">
105105
<Carousel></Carousel>
106106
</div>
107107
</div>

0 commit comments

Comments
 (0)