aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/game')
-rw-r--r--src/app/game/game.utils.ts7
-rw-r--r--src/app/game/page.styles.ts14
2 files changed, 15 insertions, 6 deletions
diff --git a/src/app/game/game.utils.ts b/src/app/game/game.utils.ts
index 73d2884..6177d2c 100644
--- a/src/app/game/game.utils.ts
+++ b/src/app/game/game.utils.ts
@@ -27,7 +27,10 @@ export function parseLrcLines(lrcText: string): GameLine[] {
if (timestamps.length === 0) continue;
- const content = rawLine.slice(lastIndex).trim();
+ const content = rawLine
+ .slice(lastIndex)
+ .replace(/\([^)]*\)/g, "")
+ .trim();
if (!content) continue;
for (const ms of timestamps) {
@@ -42,4 +45,4 @@ export function parseLrcLines(lrcText: string): GameLine[] {
export function formatTime(ms: number): string {
const s = Math.max(0, Math.floor(ms / 1000));
return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
-} \ No newline at end of file
+}
diff --git a/src/app/game/page.styles.ts b/src/app/game/page.styles.ts
index 1ced4cc..e8a2678 100644
--- a/src/app/game/page.styles.ts
+++ b/src/app/game/page.styles.ts
@@ -186,11 +186,14 @@ export const LineTimingBar = styled.div`
overflow: hidden;
`;
-export const LineTimingFill = styled.div<{ $pct: number }>`
+export const LineTimingFill = styled.div.attrs<{ $pct: number }>((props) => ({
+ style: {
+ width: `${props.$pct}%`,
+ },
+}))<{ $pct: number }>`
height: 100%;
border-radius: 2px;
background: #7c3aed;
- width: ${({ $pct }) => $pct}%;
transition: width 0.1s linear;
`;
@@ -313,11 +316,14 @@ export const ProgressWrap = styled.div`
cursor: pointer;
`;
-export const ProgressFill = styled.div<{ $pct: number }>`
+export const ProgressFill = styled.div.attrs<{ $pct: number }>((props) => ({
+ style: {
+ width: `${props.$pct}%`,
+ },
+}))<{ $pct: number }>`
height: 100%;
background: #7c3aed;
border-radius: 3px;
- width: ${({ $pct }) => $pct}%;
transition: width 0.3s linear;
`;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage