style(artist): add floating text animation to radio loading

Step 2 of radio button animation:
- Add wrapper for positioning context
- Floating messages appear above button and fade upward
- Uses Svelte #key directive to re-trigger animation on message change
- Absolute positioning ensures no layout shift
This commit is contained in:
vicrodh committed 2026-01-23 18:13:00 -06:00
1 parent a1d5f8a137
commit 87e4b7c356
1 file changed
+39 -12
@@ -855,6 +855,7 @@
<Heart size={24} /> <Heart size={24} />
{/if} {/if}
</button> </button>
<div class="radio-btn-wrapper">
<button <button
class="radio-btn" class="radio-btn"
class:loading={isRadioLoading} class:loading={isRadioLoading}
@@ -863,12 +864,14 @@
disabled={isRadioLoading} disabled={isRadioLoading}
title="Start Artist Radio" title="Start Artist Radio"
> >
{#if isRadioLoading}
<span class="loading-message">{radioLoadingMessage}</span>
{:else}
<Radio size={24} /> <Radio size={24} />
{/if}
</button> </button>
{#if isRadioLoading && radioLoadingMessage}
{#key radioLoadingMessage}
<span class="floating-message">{radioLoadingMessage}</span>
{/key}
{/if}
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -1607,18 +1610,42 @@
cursor: not-allowed; cursor: not-allowed;
} }
.loading-message { .radio-btn-wrapper {
display: none; position: relative;
} }
@keyframes fadeIn { .floating-message {
from { position: absolute;
opacity: 0; left: 50%;
transform: translateY(-2px); bottom: 100%;
transform: translateX(-50%);
white-space: nowrap;
font-size: 11px;
font-weight: 500;
color: var(--text-muted);
padding: 4px 10px;
background: var(--bg-tertiary);
border-radius: 12px;
pointer-events: none;
animation: floatUp 2s ease-out forwards;
} }
to {
@keyframes floatUp {
0% {
opacity: 0;
transform: translateX(-50%) translateY(8px);
}
15% {
opacity: 1; opacity: 1;
transform: translateY(0); transform: translateX(-50%) translateY(0);
}
70% {
opacity: 1;
transform: translateX(-50%) translateY(-10px);
}
100% {
opacity: 0;
transform: translateX(-50%) translateY(-20px);
} }
} }