mirror of
https://github.com/SrIzan10/osu-radio.git
synced 2026-05-01 10:55:12 +00:00
format
This commit is contained in:
@@ -2,22 +2,21 @@
|
|||||||
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
|
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
|
||||||
import { resolve } from "path";
|
import { resolve } from "path";
|
||||||
import solid from "vite-plugin-solid";
|
import solid from "vite-plugin-solid";
|
||||||
|
|
||||||
var electron_vite_config_default = defineConfig({
|
var electron_vite_config_default = defineConfig({
|
||||||
main: {
|
main: {
|
||||||
plugins: [externalizeDepsPlugin()]
|
plugins: [externalizeDepsPlugin()],
|
||||||
},
|
},
|
||||||
preload: {
|
preload: {
|
||||||
plugins: [externalizeDepsPlugin()]
|
plugins: [externalizeDepsPlugin()],
|
||||||
},
|
},
|
||||||
renderer: {
|
renderer: {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@renderer": resolve("src/renderer/src")
|
"@renderer": resolve("src/renderer/src"),
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
plugins: [solid()]
|
plugins: [solid()],
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
export {
|
export { electron_vite_config_default as default };
|
||||||
electron_vite_config_default as default
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ export default {
|
|||||||
tailwindcss: {},
|
tailwindcss: {},
|
||||||
autoprefixer: {},
|
autoprefixer: {},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ export default function SongHint(): HTMLElement {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) as HTMLElement;
|
) as HTMLElement;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ const SongContextMenu: Component<SongContextMenuProps> = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default SongContextMenu;
|
export default SongContextMenu;
|
||||||
|
|
||||||
export function ignoreClickInContextMenu(fn: (evt: MouseEvent) => any): (evt: MouseEvent) => void {
|
export function ignoreClickInContextMenu(fn: (evt: MouseEvent) => any): (evt: MouseEvent) => void {
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ const SongContextMenuItem: Component<SongContextMenuItemProps> = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SongContextMenuItem;
|
export default SongContextMenuItem;
|
||||||
|
|||||||
@@ -26,4 +26,4 @@ const PlayNext: Component<SongPlayNextProps> = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PlayNext;
|
export default PlayNext;
|
||||||
|
|||||||
@@ -99,4 +99,4 @@ const SongControls: Component<SongControlsProps> = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SongControls;
|
export default SongControls;
|
||||||
|
|||||||
@@ -11,7 +11,11 @@ const SongDetail: Component = () => {
|
|||||||
return (
|
return (
|
||||||
<div class="flex flex-col h-full p-8 max-w-2xl w-full">
|
<div class="flex flex-col h-full p-8 max-w-2xl w-full">
|
||||||
<div class="flex-grow mb-8 grid place-items-center">
|
<div class="flex-grow mb-8 grid place-items-center">
|
||||||
<SongImage src={song().bg} instantLoad={true} class="size-80 bg-cover bg-center object-cover rounded-lg shadow-lg" />
|
<SongImage
|
||||||
|
src={song().bg}
|
||||||
|
instantLoad={true}
|
||||||
|
class="size-80 bg-cover bg-center object-cover rounded-lg shadow-lg"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const SongItem: Component<SongItemProps> = ({
|
|||||||
onMount(() => {
|
onMount(() => {
|
||||||
draggable(item, {
|
draggable(item, {
|
||||||
onClick: ignoreClickInContextMenu(() => onSelect(song.path)),
|
onClick: ignoreClickInContextMenu(() => onSelect(song.path)),
|
||||||
onDrop: onDrop ?? (() => { }),
|
onDrop: onDrop ?? (() => {}),
|
||||||
createHint: SongHint,
|
createHint: SongHint,
|
||||||
useOnlyAsOnClickBinder: !isDraggable || selectedSong().path === song.path,
|
useOnlyAsOnClickBinder: !isDraggable || selectedSong().path === song.path,
|
||||||
});
|
});
|
||||||
@@ -54,10 +54,11 @@ const SongItem: Component<SongItemProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
class={`relative isolate my-4 select-none rounded-md ${selectedSong().path === song.path
|
class={`relative isolate my-4 select-none rounded-md ${
|
||||||
? "data-[active=true]:after:bg-black/30 data-[active=true]:outline data-[active=true]:outline-2 data-[active=true]:outline-accent"
|
selectedSong().path === song.path
|
||||||
: ""
|
? "data-[active=true]:after:bg-black/30 data-[active=true]:outline data-[active=true]:outline-2 data-[active=true]:outline-accent"
|
||||||
} hover:after:bg-overlay`}
|
: ""
|
||||||
|
} hover:after:bg-overlay`}
|
||||||
data-active={selectedSong().path === song.path}
|
data-active={selectedSong().path === song.path}
|
||||||
ref={item}
|
ref={item}
|
||||||
data-url={song.bg}
|
data-url={song.bg}
|
||||||
@@ -70,7 +71,9 @@ const SongItem: Component<SongItemProps> = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="flex flex-col justify-center min-h-[72px] p-3 bg-black/50 overflow-hidden rounded-md">
|
<div class="flex flex-col justify-center min-h-[72px] p-3 bg-black/50 overflow-hidden rounded-md">
|
||||||
<h3 class="text-[22px] leading-7 font-extrabold text-shadow shadow-black/60">{song.title}</h3>
|
<h3 class="text-[22px] leading-7 font-extrabold text-shadow shadow-black/60">
|
||||||
|
{song.title}
|
||||||
|
</h3>
|
||||||
<p class="text-base text-subtext">{song.artist}</p>
|
<p class="text-base text-subtext">{song.artist}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ const SongListSearch: Component<SearchProps> = (props) => {
|
|||||||
setSongsSearch(e.target.value);
|
setSongsSearch(e.target.value);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label class="absolute left-3 top-1/2 transform -translate-y-1/2 text-text-600" for="search_input">
|
<label
|
||||||
|
class="absolute left-3 top-1/2 transform -translate-y-1/2 text-text-600"
|
||||||
|
for="search_input"
|
||||||
|
>
|
||||||
<i class="ri-search-2-line" />
|
<i class="ri-search-2-line" />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -83,10 +86,11 @@ const SongListSearch: Component<SearchProps> = (props) => {
|
|||||||
<SongListSearchOrderBy setOrder={props.setOrder} />
|
<SongListSearchOrderBy setOrder={props.setOrder} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
{/* <div class="results row">
|
{
|
||||||
|
/* <div class="results row">
|
||||||
<button
|
<button
|
||||||
title={
|
title={
|
||||||
props.count() === 0 ? "Can not save results as playlist" : "Save results as playlist"
|
props.count() === 0 ? "Can not save results as playlist" : "Save results as playlist"
|
||||||
@@ -99,11 +103,14 @@ const SongListSearch: Component<SearchProps> = (props) => {
|
|||||||
<OrderSelect setOrder={props.setOrder} disabled={props.count() === 0} />
|
<OrderSelect setOrder={props.setOrder} disabled={props.count() === 0} />
|
||||||
<TagSelect tags={props.tags} disabled={props.count() === 0} />
|
<TagSelect tags={props.tags} disabled={props.count() === 0} />
|
||||||
</div>
|
</div>
|
||||||
</div> */}
|
</div> */
|
||||||
|
}
|
||||||
|
|
||||||
{/* <div class="error-container" classList={{ 'display-none': !doShowError() }}>
|
{
|
||||||
|
/* <div class="error-container" classList={{ 'display-none': !doShowError() }}>
|
||||||
<p class="message" ref={errorMessage}></p>
|
<p class="message" ref={errorMessage}></p>
|
||||||
<button class="suggestion" ref={suggestion} classList={{ 'display-none': !doShowSuggestion() }}></button>
|
<button class="suggestion" ref={suggestion} classList={{ 'display-none': !doShowSuggestion() }}></button>
|
||||||
</div> */}
|
</div> */
|
||||||
|
}
|
||||||
|
|
||||||
export default SongListSearch;
|
export default SongListSearch;
|
||||||
|
|||||||
@@ -74,7 +74,9 @@ const SongListSearchOrderBy: Component<OrderSelectProps> = (props) => {
|
|||||||
</Switch>
|
</Switch>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Dropdown isOpen={isOpen} onValueChange={setIsOpen}>
|
<Dropdown isOpen={isOpen} onValueChange={setIsOpen}>
|
||||||
<Dropdown.Trigger class="px-3 py-1 bg-thin-material rounded-md">{optionLabel()}</Dropdown.Trigger>
|
<Dropdown.Trigger class="px-3 py-1 bg-thin-material rounded-md">
|
||||||
|
{optionLabel()}
|
||||||
|
</Dropdown.Trigger>
|
||||||
<Dropdown.List
|
<Dropdown.List
|
||||||
class="bg-surface shadow-lg rounded-md overflow-hidden"
|
class="bg-surface shadow-lg rounded-md overflow-hidden"
|
||||||
onValueChange={(newSelectedOption) => {
|
onValueChange={(newSelectedOption) => {
|
||||||
@@ -85,7 +87,10 @@ const SongListSearchOrderBy: Component<OrderSelectProps> = (props) => {
|
|||||||
value={option}
|
value={option}
|
||||||
>
|
>
|
||||||
{orderOptions.map((option) => (
|
{orderOptions.map((option) => (
|
||||||
<Dropdown.Item class="px-4 py-2 hover:bg-accent/20 transition-colors duration-200" value={option.value}>
|
<Dropdown.Item
|
||||||
|
class="px-4 py-2 hover:bg-accent/20 transition-colors duration-200"
|
||||||
|
value={option.value}
|
||||||
|
>
|
||||||
{option.text}
|
{option.text}
|
||||||
</Dropdown.Item>
|
</Dropdown.Item>
|
||||||
))}
|
))}
|
||||||
@@ -95,4 +100,4 @@ const SongListSearchOrderBy: Component<OrderSelectProps> = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SongListSearchOrderBy;
|
export default SongListSearchOrderBy;
|
||||||
|
|||||||
@@ -118,4 +118,4 @@ const SongQueue: Component = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SongQueue;
|
export default SongQueue;
|
||||||
|
|||||||
@@ -26,7 +26,11 @@ const MainScene: Component = () => {
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="absolute inset-0 z-[-1] pointer-events-none opacity-[0.072]">
|
<div class="absolute inset-0 z-[-1] pointer-events-none opacity-[0.072]">
|
||||||
<SongImage src={song().bg} instantLoad={true} class="w-full h-full bg-cover filter blur-xl" />
|
<SongImage
|
||||||
|
src={song().bg}
|
||||||
|
instantLoad={true}
|
||||||
|
class="w-full h-full bg-cover filter blur-xl"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -41,7 +45,7 @@ const Nav: Component = () => {
|
|||||||
|
|
||||||
<div class="ml-auto">
|
<div class="ml-auto">
|
||||||
<IconButton
|
<IconButton
|
||||||
class={`text-text-700 ${songQueueModalOpen() ? 'text-text-900' : ''}`}
|
class={`text-text-700 ${songQueueModalOpen() ? "text-text-900" : ""}`}
|
||||||
onClick={toggleSongQueueModalOpen}
|
onClick={toggleSongQueueModalOpen}
|
||||||
>
|
>
|
||||||
<i class="ri-stack-fill" />
|
<i class="ri-stack-fill" />
|
||||||
@@ -58,11 +62,13 @@ const NavItem: Component<NavItemProps> = ({ children, value, icon }) => {
|
|||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
class={`flex items-center gap-4 px-4 py-1 rounded-sm hover:bg-surface
|
class={`flex items-center gap-4 px-4 py-1 rounded-sm hover:bg-surface
|
||||||
${mainActiveTab() === value ? 'bg-surface' : ''}`}
|
${mainActiveTab() === value ? "bg-surface" : ""}`}
|
||||||
onclick={() => setMainActiveTab(value)}
|
onclick={() => setMainActiveTab(value)}
|
||||||
>
|
>
|
||||||
<i class={`${icon} ${mainActiveTab() === value ? 'text-text-900' : 'text-text-600'}`} />
|
<i class={`${icon} ${mainActiveTab() === value ? "text-text-900" : "text-text-600"}`} />
|
||||||
<span class={`text-base font-semibold ${mainActiveTab() === value ? 'text-on-background' : 'text-text-600'}`}>
|
<span
|
||||||
|
class={`text-base font-semibold ${mainActiveTab() === value ? "text-on-background" : "text-text-600"}`}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,23 +1,21 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
export default {
|
export default {
|
||||||
content: [
|
content: ["./src/**/*.{js,ts,jsx,tsx}"],
|
||||||
"./src/**/*.{js,ts,jsx,tsx}",
|
|
||||||
],
|
|
||||||
theme: {
|
theme: {
|
||||||
extend: {
|
extend: {
|
||||||
colors: {
|
colors: {
|
||||||
'thick-material': 'var(--color-thick-material)',
|
"thick-material": "var(--color-thick-material)",
|
||||||
'regular-material': 'var(--color-regular-material)',
|
"regular-material": "var(--color-regular-material)",
|
||||||
'text': 'var(--color-text)',
|
text: "var(--color-text)",
|
||||||
'subtext': 'var(--color-subtext)',
|
subtext: "var(--color-subtext)",
|
||||||
'stroke': 'var(--color-stroke)',
|
stroke: "var(--color-stroke)",
|
||||||
'overlay': 'var(--color-overlay)',
|
overlay: "var(--color-overlay)",
|
||||||
'accent': 'var(--color-accent)',
|
accent: "var(--color-accent)",
|
||||||
'surface': 'var(--color-surface)',
|
surface: "var(--color-surface)",
|
||||||
'black': 'var(--color-black)',
|
black: "var(--color-black)",
|
||||||
'red': 'var(--color-red)',
|
red: "var(--color-red)",
|
||||||
'green': 'var(--color-green)',
|
green: "var(--color-green)",
|
||||||
'thin-material': 'var(--color-thin-material)',
|
"thin-material": "var(--color-thin-material)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -25,5 +23,5 @@ export default {
|
|||||||
extend: {},
|
extend: {},
|
||||||
},
|
},
|
||||||
plugins: [],
|
plugins: [],
|
||||||
darkMode: 'media', // or 'class' if you prefer manual dark mode switching
|
darkMode: "media", // or 'class' if you prefer manual dark mode switching
|
||||||
}
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user