- {/* cover */}
-
-
-
-
- {/* title & author */}
-
-
-
-
{'Ferrum Aeternumaaaaaaaaaaa'}
-
{'Ensiferum/mmmmsa'}
-
-
-
-
- {/* progress bar */}
-
- {/* bar */}
-
- {/* black */}
-
- {/* gery */}
-
- {/* point */}
-
-
- {/* time */}
-
- {curTime}
- {` / ${totalTime}`}
-
-
-
- {/* control */}
-
-
- {/* 上一首 */}
-
- {/* 播放/暂停 */}
-
- {/* 下一首 */}
-
-
+
);
}
diff --git a/src/components/AudioPlayer/PlayerControl.tsx b/src/components/AudioPlayer/PlayerControl.tsx
new file mode 100644
index 0000000..6982f9a
--- /dev/null
+++ b/src/components/AudioPlayer/PlayerControl.tsx
@@ -0,0 +1,114 @@
+'use client';
+
+import Image from 'next/image';
+
+import { secondToDate } from '@/utils/timeFormat';
+
+import { AutoScrollContainer } from '@/components';
+
+interface Props {
+ audio: SongInfo | null;
+ playStatus: boolean;
+ onPlay: () => void;
+ onPrev: () => void;
+ onNext: () => void;
+ onChangeProgress: (value: string) => void;
+ trackProgress: number;
+ duration: number;
+ className?: string;
+}
+
+export default function AudioPlayer({
+ audio,
+ playStatus,
+ onPlay,
+ onPrev,
+ onNext,
+ onChangeProgress,
+ trackProgress,
+ duration,
+ className,
+}: Props) {
+ const currentPercentage = duration ? `${(trackProgress / duration) * 100}%` : '0%';
+ const trackStyling: string = `
+ -webkit-gradient(linear, 0% 0%, 100% 0%, color-stop(${currentPercentage}, rgb(24,24,24)), color-stop(${currentPercentage}, rgba(0,0,0,0.1)))
+ `; // 进度条样式
+
+ return (
+
+ {/* 专辑封面 */}
+
+ {audio?.pic && (
+
+ )}
+
+
+ {/* title & author */}
+
+
+
+
{audio?.title}
+
{`${audio?.artist}/${audio?.album}`}
+
+
+
+
+ {/* progress bar */}
+
+ {/* bar */}
+
+ onChangeProgress(e.target.value)}
+ style={{ background: trackStyling }}
+ />
+
+ {/* time */}
+
+ {`${secondToDate(trackProgress)}`}
+ {` /${secondToDate(duration)}`}
+
+
+
+ {/* control */}
+
+
+ {/* 上一首 */}
+
+ {/* 播放/暂停 */}
+
+ {/* 下一首 */}
+
+
+
+ );
+}
diff --git a/src/components/Login/LoginForm.tsx b/src/components/Login/LoginForm.tsx
index c6ecad2..c850035 100644
--- a/src/components/Login/LoginForm.tsx
+++ b/src/components/Login/LoginForm.tsx
@@ -76,7 +76,7 @@ export default function LoginForm() {