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:
1 parent
a1d5f8a137
commit
87e4b7c356
1 file changed
+46
-19
@@ -855,20 +855,23 @@
|
|||||||
<Heart size={24} />
|
<Heart size={24} />
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<div class="radio-btn-wrapper">
|
||||||
class="radio-btn"
|
<button
|
||||||
class:loading={isRadioLoading}
|
class="radio-btn"
|
||||||
class:glow={radioJustCreated}
|
class:loading={isRadioLoading}
|
||||||
onclick={createArtistRadio}
|
class:glow={radioJustCreated}
|
||||||
disabled={isRadioLoading}
|
onclick={createArtistRadio}
|
||||||
title="Start Artist Radio"
|
disabled={isRadioLoading}
|
||||||
>
|
title="Start Artist Radio"
|
||||||
{#if isRadioLoading}
|
>
|
||||||
<span class="loading-message">{radioLoadingMessage}</span>
|
|
||||||
{:else}
|
|
||||||
<Radio size={24} />
|
<Radio size={24} />
|
||||||
|
</button>
|
||||||
|
{#if isRadioLoading && radioLoadingMessage}
|
||||||
|
{#key radioLoadingMessage}
|
||||||
|
<span class="floating-message">{radioLoadingMessage}</span>
|
||||||
|
{/key}
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</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;
|
||||||
|
left: 50%;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes floatUp {
|
||||||
|
0% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(-2px);
|
transform: translateX(-50%) translateY(8px);
|
||||||
}
|
}
|
||||||
to {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user