feat(toast): buffering toast with shimmer effect, persistent until loaded

- Add 'buffering' toast type that doesn't auto-hide
- Add shimmer animation to "Buffering" text
- Add spinning loader icon for buffering state
- Toast shows "Buffering... [track name]" format
- Dismiss buffering toast when track loads or on error
- Remove callback pattern, use toastStore directly in services

fix(artwork): show empty placeholder when no artwork available

- NowPlayingBar shows empty placeholder instead of Play icon
- Miniplayer shows empty placeholder instead of Play icon
- Prevents showing incorrect CD placeholder on session restore
This commit is contained in:
vicrodh committed 2026-01-12 09:06:58 -06:00
1 parent 434f8d8a67
commit e93144e5ef
7 files changed
+131 -62

No files matched your search

+2 -8
View File
@@ -247,9 +247,7 @@
{#if artwork}
<img src={artwork} alt={trackTitle} class="artwork" />
{:else}
<div class="artwork-placeholder">
<Play size={14} />
</div>
<div class="artwork-placeholder"></div>
{/if}
<!-- Artwork Preview on Hover -->
@@ -558,11 +556,7 @@
width: 56px;
height: 56px;
border-radius: 6px;
background: rgba(255, 255, 255, 0.1);
display: flex;
align-items: center;
justify-content: center;
color: rgba(255, 255, 255, 0.4);
background: rgba(255, 255, 255, 0.06);
}
.artwork-preview {
+64 -5
View File
@@ -1,32 +1,46 @@
<script lang="ts">
import { onMount } from 'svelte';
import { CheckCircle, AlertCircle, Info, X } from 'lucide-svelte';
import { CheckCircle, AlertCircle, Info, Loader2, X } from 'lucide-svelte';
interface Props {
message: string;
type?: 'success' | 'error' | 'info';
type?: 'success' | 'error' | 'info' | 'buffering';
persistent?: boolean;
onClose: () => void;
}
let { message, type = 'success', onClose }: Props = $props();
let { message, type = 'success', persistent = false, onClose }: Props = $props();
onMount(() => {
// Don't auto-close persistent toasts (buffering)
if (persistent) return;
const timer = setTimeout(onClose, 4000);
return () => clearTimeout(timer);
});
</script>
<div class="toast" class:success={type === 'success'} class:error={type === 'error'} class:info={type === 'info'}>
<div class="toast" class:success={type === 'success'} class:error={type === 'error'} class:info={type === 'info'} class:buffering={type === 'buffering'}>
<div class="icon">
{#if type === 'success'}
<CheckCircle size={20} />
{:else if type === 'error'}
<AlertCircle size={20} />
{:else if type === 'buffering'}
<Loader2 size={20} class="spinning" />
{:else}
<Info size={20} />
{/if}
</div>
<span class="message">{message}</span>
{#if type === 'buffering'}
<span class="message">
<span class="shimmer-text">Buffering</span>
<span class="dots">...</span>
<span class="track-name">{message}</span>
</span>
{:else}
<span class="message">{message}</span>
{/if}
<button class="close-btn" onclick={onClose}>
<X size={16} />
</button>
@@ -78,11 +92,56 @@
color: var(--accent-primary);
}
.toast.buffering .icon {
color: var(--accent-primary);
}
.toast.buffering .icon :global(.spinning) {
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.message {
font-size: 14px;
color: var(--text-primary);
}
/* Shimmer effect for buffering text */
.shimmer-text {
background: linear-gradient(
90deg,
var(--text-primary) 0%,
var(--accent-primary) 25%,
var(--text-primary) 50%,
var(--accent-primary) 75%,
var(--text-primary) 100%
);
background-size: 200% 100%;
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
animation: shimmer 2s ease-in-out infinite;
font-weight: 500;
}
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
.dots {
color: var(--text-muted);
margin-right: 8px;
}
.track-name {
color: var(--text-secondary);
}
.close-btn {
background: none;
border: none;