Skip to content

Commit b071185

Browse files
committed
Added album shimmer effect on play, fixed info overlap
1 parent 13a0c42 commit b071185

File tree

2 files changed

+65
-16
lines changed

2 files changed

+65
-16
lines changed

public/images/cd-shimmer.png

338 KB
Loading

src/lib/albums/AlbumItem.svelte

Lines changed: 65 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
draggedSongs,
1010
isPlaying,
1111
playlist,
12-
playlistType
12+
playlistType,
1313
} from "../../data/store";
1414
import audioPlayer from "../player/AudioPlayer";
1515
import Icon from "../ui/Icon.svelte";
@@ -117,11 +117,13 @@
117117
</div>
118118
{/if}
119119
{#if isHovered || ($playlistType === "album" && isPlayingCurrentAlbum)}
120-
<div class={$playlistType === "album" &&
120+
<div
121+
class={$playlistType === "album" &&
121122
$isPlaying &&
122123
isPlayingCurrentAlbum
123124
? "play-button-container pause-button"
124-
: "play-button-container play-button"}>
125+
: "play-button-container play-button"}
126+
>
125127
<div class="button" on:click={playPauseToggle}>
126128
<Icon
127129
icon={$playlistType === "album" &&
@@ -145,7 +147,10 @@
145147
<small>{album.year}</small>
146148
<small>•</small>
147149
{/if}
148-
<small>{album?.tracksIds.length} {$LL.albums.item.tracksLabel()}</small>
150+
<small
151+
>{album?.tracksIds.length}
152+
{$LL.albums.item.tracksLabel()}</small
153+
>
149154
</div>
150155
{/if}
151156
</div>
@@ -154,14 +159,42 @@
154159
.playing {
155160
transform: scale(1.1);
156161
z-index: 9;
157-
162+
158163
.cd {
159164
z-index: 8;
160165
/* box-shadow: 2px 2px 30px 20px rgba(39, 0, 178, 0.181) !important; */
161166
box-shadow: 2px 2px 50px 40px
162167
color-mix(in srgb, var(--album-playing-shadow) 50%, transparent) !important;
163168
.hinge {
164-
background-color: rgba(167, 164, 173, 0.078);
169+
background-color: color-mix(
170+
in srgb,
171+
var(--inverse) 10.32%,
172+
transparent
173+
);
174+
backdrop-filter: blur(8px);
175+
border-left: 1px solid
176+
color-mix(in srgb, var(--inverse), transparent 50%);
177+
box-shadow:
178+
inset -0.75px -0.5px rgba(255, 255, 255, 0.1),
179+
inset + 0.75px +0.5px rgba(255, 255, 255, 0.025),
180+
3px 2px 10px rgba(0, 0, 0, 0.25),
181+
inset 0px 0px 10px 5px rgba(255, 255, 255, 0.025),
182+
inset 0px 0px 40px 5px rgba(255, 255, 255, 0.025);
183+
}
184+
.artwork-frame {
185+
&::after {
186+
content: "";
187+
position: absolute;
188+
top: 0;
189+
left: 0;
190+
width: 100%;
191+
height: 100%;
192+
background-image: url("images/cd-shimmer.png");
193+
background-repeat: no-repeat;
194+
z-index: 20;
195+
animation: playing-shimmer 3.5s cubic-bezier(.4,0,.41,.97) 1;
196+
pointer-events: none;
197+
}
165198
}
166199
}
167200
@@ -173,13 +206,25 @@
173206
border-radius: 4px;
174207
color: var(--text);
175208
z-index: 20;
209+
margin-top: 3px !important;
176210
}
177211
.artist,
178212
.info {
179213
z-index: 20;
180214
}
181215
}
182216
217+
@keyframes playing-shimmer {
218+
0% {
219+
background-position: -40% 110%;
220+
background-size: 250%;
221+
}
222+
100% {
223+
background-position: 120% -30%;
224+
background-size: 250%;
225+
}
226+
}
227+
183228
.hovered:not(.playing) {
184229
z-index: 8;
185230
@@ -316,11 +361,11 @@
316361
box-sizing: border-box;
317362
.hinge {
318363
border-left: 1px solid
319-
color-mix(in srgb, var(--inverse) 10.32%, transparent);
364+
color-mix(in srgb, var(--inverse) 20.32%, transparent);
320365
width: 5%;
321366
background-color: color-mix(
322367
in srgb,
323-
var(--inverse) 4.32%,
368+
var(--inverse) 9.32%,
324369
transparent
325370
);
326371
}
@@ -374,7 +419,7 @@
374419
transparent
375420
);
376421
background-color: var(--album-playing-play-bg);
377-
422+
378423
.button {
379424
position: relative;
380425
left: 1px;
@@ -383,10 +428,12 @@
383428
align-self: center;
384429
color: var(--album-playing-play-icon);
385430
}
386-
431+
387432
&:hover {
388-
background-color: var(--album-playing-play-hover-bg);
389-
433+
background-color: var(
434+
--album-playing-play-hover-bg
435+
);
436+
390437
.button {
391438
color: var(--album-playing-play-hover-icon);
392439
}
@@ -401,17 +448,19 @@
401448
transparent
402449
);
403450
background-color: var(--album-playing-pause-bg);
404-
451+
405452
.button {
406453
font-size: 2.2em;
407454
margin: auto;
408455
align-self: center;
409456
color: var(--album-playing-pause-icon);
410457
}
411-
458+
412459
&:hover {
413-
background-color: var(--album-playing-pause-hover-bg);
414-
460+
background-color: var(
461+
--album-playing-pause-hover-bg
462+
);
463+
415464
.button {
416465
color: var(--album-playing-pause-hover-icon);
417466
}

0 commit comments

Comments
 (0)