feat: Convert Figma React UI to Svelte 5
- Add lucide-svelte for icons - Create app.css with theme CSS variables (Dark, Light, OLED, Warm) - Convert all React components to Svelte 5 using runes ($state, $derived, $effect, $props) - Implement core components: Sidebar, NowPlayingBar, NavigationItem, UserCard, AlbumCard, HorizontalScrollRow, HeroSection, TrackRow, Toggle, Dropdown, Tooltip, VolumeSlider - Implement view components: HomeView, SettingsView, AlbumDetailView - Implement overlay components: QueuePanel, FullScreenNowPlaying, FocusMode, Toast - Create main +page.svelte with routing, state management and keyboard shortcuts - All components use Svelte 5 snippets for component children patterns
This commit is contained in:
1 parent
ef92897d43
commit
cdfd3263de
23 files changed
+4512
-141
No files matched your search
@@ -0,0 +1,50 @@
|
||||
<script lang="ts">
|
||||
interface Props {
|
||||
enabled: boolean;
|
||||
onchange: (enabled: boolean) => void;
|
||||
}
|
||||
|
||||
let { enabled, onchange }: Props = $props();
|
||||
</script>
|
||||
|
||||
<button
|
||||
class="toggle"
|
||||
class:enabled
|
||||
onclick={() => onchange(!enabled)}
|
||||
role="switch"
|
||||
aria-checked={enabled}
|
||||
>
|
||||
<div class="thumb"></div>
|
||||
</button>
|
||||
|
||||
<style>
|
||||
.toggle {
|
||||
position: relative;
|
||||
width: 44px;
|
||||
height: 24px;
|
||||
border-radius: 9999px;
|
||||
border: none;
|
||||
background-color: #333333;
|
||||
cursor: pointer;
|
||||
transition: background-color 150ms ease;
|
||||
}
|
||||
|
||||
.toggle.enabled {
|
||||
background-color: var(--accent-primary);
|
||||
}
|
||||
|
||||
.thumb {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background-color: white;
|
||||
transition: transform 150ms ease;
|
||||
}
|
||||
|
||||
.toggle.enabled .thumb {
|
||||
transform: translateX(20px);
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user