Integrate glassmorphism theme across UI components

- QueuePanel: Glass slide-in panel with blur backdrop
- NowPlayingBar: Glass bottom bar with proper fixed positioning
- PlaylistModal: Glass modal with rounded corners and blur
- AddToPlaylistModal: Glass modal with same styling
- GlassSurface: Updated to Svelte 5 (children snippet, role attr)
  - Removed position:relative to allow fixed positioning override

Glass CSS variables used:
--glass-bg, --glass-blur, --glass-radius, --glass-border, --glass-shadow
This commit is contained in:
vicrodh committed 2026-01-10 11:13:41 -06:00
1 parent 541511bba2
commit afa1a71a4f
5 files changed
+55 -30

No files matched your search

+9 -6
View File
@@ -2,6 +2,7 @@
import { invoke } from '@tauri-apps/api/core';
import { onMount } from 'svelte';
import { X, Plus, ListMusic, Loader2 } from 'lucide-svelte';
import GlassSurface from './glass/GlassSurface.svelte';
interface Playlist {
id: number;
@@ -65,7 +66,7 @@
{#if isOpen}
<div class="overlay" onclick={onClose} onkeydown={(e) => e.key === 'Escape' && onClose()} role="presentation">
<div class="modal" onclick={(e) => e.stopPropagation()} onkeydown={(e) => e.stopPropagation()} role="dialog" tabindex="-1">
<GlassSurface rootClassName="modal" enableRipple={false} onclick={(e) => e.stopPropagation()}>
<div class="header">
<h3>Add to Playlist</h3>
<button class="close-btn" onclick={onClose}>
@@ -121,7 +122,7 @@
</div>
{/if}
</div>
</div>
</GlassSurface>
</div>
{/if}
@@ -136,15 +137,17 @@
justify-content: center;
}
.modal {
:global(.modal) {
width: 400px;
max-height: 500px;
background-color: var(--bg-secondary);
border-radius: 12px;
overflow: hidden;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
display: flex;
flex-direction: column;
--glass-bg: rgba(30, 30, 35, 0.9);
--glass-blur: 24px;
--glass-radius: 16px;
--glass-border: rgba(255, 255, 255, 0.1);
--glass-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.header {
+20 -9
View File
@@ -16,6 +16,7 @@
Mic2
} from 'lucide-svelte';
import QualityBadge from './QualityBadge.svelte';
import GlassSurface from './glass/GlassSurface.svelte';
interface Props {
artwork?: string;
@@ -144,7 +145,7 @@
});
</script>
<div class="now-playing-bar">
<GlassSurface rootClassName="now-playing-bar" enableRipple={false} enableDistortion={false}>
<!-- Left Section - Track Info -->
<div class="track-info">
{#if hasTrack}
@@ -284,21 +285,31 @@
<span class="remaining-time">-{formatTime(Math.max(0, duration - currentTime))}</span>
</div>
</div>
</GlassSurface>
<style>
.now-playing-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
:global(.now-playing-bar) {
position: fixed !important;
bottom: 0 !important;
left: 0 !important;
right: 0 !important;
top: auto !important;
height: 80px;
z-index: 100;
--glass-bg: rgba(25, 25, 30, 0.88);
--glass-blur: 20px;
--glass-radius: 0;
--glass-border: rgba(255, 255, 255, 0.06);
--glass-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}
:global(.now-playing-bar .glass-content) {
display: flex;
align-items: center;
width: 100%;
height: 100%;
padding: 0 16px;
gap: 24px;
background-color: var(--bg-secondary);
border-top: 1px solid var(--bg-tertiary);
}
/* Track Info */
+9 -5
View File
@@ -2,6 +2,7 @@
import { invoke } from '@tauri-apps/api/core';
import { X } from 'lucide-svelte';
import { logPlaylistAdd } from '$lib/services/recoService';
import GlassSurface from './glass/GlassSurface.svelte';
interface Playlist {
id: number;
@@ -202,7 +203,7 @@
aria-modal="true"
tabindex="-1"
>
<div class="modal" onclick={(e) => e.stopPropagation()} role="document">
<GlassSurface rootClassName="modal" enableRipple={false} onclick={(e) => e.stopPropagation()}>
<div class="modal-header">
<h2>
{#if mode === 'create'}
@@ -309,7 +310,7 @@
{/if}
</button>
</div>
</div>
</GlassSurface>
</div>
{/if}
@@ -324,15 +325,18 @@
z-index: 1000;
}
.modal {
background: var(--bg-primary);
border-radius: 12px;
:global(.modal) {
width: 100%;
max-width: 440px;
max-height: 90vh;
overflow: hidden;
display: flex;
flex-direction: column;
--glass-bg: rgba(30, 30, 35, 0.9);
--glass-blur: 24px;
--glass-radius: 16px;
--glass-border: rgba(255, 255, 255, 0.1);
--glass-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.modal-header {
+9 -6
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import { X, GripVertical, Play } from 'lucide-svelte';
import GlassSurface from './glass/GlassSurface.svelte';
interface QueueTrack {
id: string;
@@ -37,7 +38,7 @@
<div class="backdrop" onclick={onClose} role="presentation"></div>
<!-- Queue Panel -->
<div class="queue-panel">
<GlassSurface rootClassName="queue-panel" enableRipple={false} enableDistortion={false}>
<!-- Header -->
<div class="header">
<h2>Queue</h2>
@@ -123,7 +124,7 @@
<button class="save-btn" onclick={onSaveAsPlaylist}>Save as Playlist</button>
</div>
{/if}
</div>
</GlassSurface>
{/if}
<style>
@@ -134,19 +135,21 @@
z-index: 40;
}
.queue-panel {
:global(.queue-panel) {
position: fixed;
top: 0;
right: 0;
bottom: 0;
width: 360px;
background-color: var(--bg-secondary);
border-left: 1px solid var(--bg-tertiary);
z-index: 50;
display: flex;
flex-direction: column;
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
animation: slideInRight 200ms ease-out;
--glass-bg: rgba(30, 30, 35, 0.85);
--glass-blur: 24px;
--glass-radius: 0;
--glass-border: rgba(255, 255, 255, 0.08);
--glass-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}
@keyframes slideInRight {
+8 -4
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { onDestroy } from 'svelte';
import { onDestroy, type Snippet } from 'svelte';
import GlassFilterDefs from './GlassFilterDefs.svelte';
interface Props {
@@ -12,6 +12,7 @@
enableDistortion?: boolean;
includeDefs?: boolean;
onclick?: (event: MouseEvent) => void;
children?: Snippet;
}
let {
@@ -23,7 +24,8 @@
rippleDurationMs = 800,
enableDistortion = true,
includeDefs = true,
onclick
onclick,
children
}: Props = $props();
const filterId = `glass-dist-${Math.random().toString(36).slice(2, 9)}`;
@@ -83,6 +85,7 @@
style={`--glass-ripple-duration: ${rippleDurationMs}ms;`}
bind:this={container}
onclick={handleClick}
role="presentation"
>
<div class="glass-backdrop" style={enableDistortion ? `filter: url(#${filterId})` : undefined}></div>
<div class="glass-sheen"></div>
@@ -91,13 +94,14 @@
<div class="glass-ripple" style={`--ripple-x: ${rippleX}%; --ripple-y: ${rippleY}%`}></div>
{/if}
<div class={`glass-content ${contentClassName}`.trim()}>
<slot />
{#if children}
{@render children()}
{/if}
</div>
</svelte:element>
<style>
.glass-surface {
position: relative;
overflow: hidden;
border-radius: var(--glass-radius, 14px);
background: var(--glass-fallback, rgba(255, 255, 255, 0.06));