UI update

This commit is contained in:
nise.moe 2024-03-03 18:23:35 +01:00
parent 905a9877d7
commit 44f5e7fc68
2 changed files with 7 additions and 13 deletions

View File

@ -14,6 +14,10 @@ export function App() {
let pathReplayId = location.pathname.slice(1, location.pathname.length);
const loadReplay = async () => {
if(document.location.hostname === "localhost") {
await OsuRenderer.loadReplayFromUrl(`http://localhost:8080/score/${pathReplayId}/replay`);
return;
}
await OsuRenderer.loadReplayFromUrl(`https://nise.moe/api/score/${pathReplayId}/replay`);
};

View File

@ -3,7 +3,7 @@ import { Card } from "../components/ui/card";
import { Slider } from "../components/ui/slider";
import { state } from "@/utils";
import { Button } from "../components/ui/button";
import {PauseIcon, PlayIcon, RefreshCcwIcon} from "lucide-react";
import {PauseIcon, PlayIcon} from "lucide-react";
import { Checkbox } from "../components/ui/checkbox"
export function SongSlider() {
@ -51,26 +51,16 @@ export function SongSlider() {
<p className="text-sm opacity-50">Current speed</p>
<p>{speed}x</p>
</div>
<div className="flex items-center w-full">
<div className="flex items-center w-full" style={{minHeight: 36}}>
<Slider
step={0.1}
min={0.1}
min={0}
max={2}
value={[speed]}
onValueChange={(value: any) => {
OsuRenderer.setSpeed(value[0]);
}}
/>
<Button
onClick={() => {
OsuRenderer.setSpeed(1)
}}
variant="secondary"
size="sm"
className="ml-2"
>
{playing ? <RefreshCcwIcon/> : <RefreshCcwIcon/>}
</Button>
</div>
</div>