1
0

add: keyboard shortcut for navigation in labelling page

This commit is contained in:
alikia2x (寒寒) 2025-12-01 23:30:32 +08:00
parent 50a1102ae9
commit 0b4893b5c4
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 56209E0CCD8420C6
3 changed files with 7 additions and 2 deletions

View File

@ -59,6 +59,7 @@ export function VideoInfo({ video }: VideoInfoProps) {
<span> {formatDateTime(new Date(video.published_at!))}</span>
<br />
<span>{(video.views ?? 0).toLocaleString()}</span>
&nbsp;&nbsp;
<span>{formatDuration(video.duration || 0)}</span>
</p>
<p>

View File

@ -136,12 +136,15 @@ export default function Home() {
}
const key = e.key.toUpperCase();
console.log(key);
if (leftKeys.includes(key)) {
handleLabel(false);
} else if (rightKeys.includes(key)) {
handleLabel(true);
} else if (key === "ARROWLEFT") {
navigateTo(currentIndex - 1);
} else if (key === "ARROWRIGHT") {
navigateTo(currentIndex + 1);
}
};

View File

@ -8,7 +8,8 @@
"start": "react-router-serve ./build/server/index.js",
"typecheck": "react-router typegen && tsc",
"format": "prettier --write .",
"deploy": "wrangler deploy"
"deploy": "wrangler deploy",
"go": "bun run build && bun run deploy"
},
"dependencies": {
"@alikia/dark-theme-hook": "^1.0.2",