Skip to content

Commit 5e95cd3

Browse files
Merge pull request #59 from The-Infinitys/dev
Dev
2 parents da3a40f + 2ae2627 commit 5e95cd3

File tree

6 files changed

+98
-33
lines changed

6 files changed

+98
-33
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"puppeteer": "^24.10.1",
2929
"react": "^19.1.0",
3030
"react-dom": "^19.1.0",
31-
"react-i18next": "^15.5.2",
31+
"react-i18next": "^15.5.3",
3232
"rehype-format": "^5.0.1",
3333
"rehype-highlight": "^7.0.2",
3434
"rehype-parse": "^9.0.1",
@@ -45,7 +45,7 @@
4545
},
4646
"devDependencies": {
4747
"@eslint/eslintrc": "^3",
48-
"@next/bundle-analyzer": "^15.4.0-canary.81",
48+
"@next/bundle-analyzer": "^15.4.0-canary.83",
4949
"@tailwindcss/postcss": "^4",
5050
"@types/node": "^24",
5151
"@types/react": "^19",

src/app/music/[music_id]/components/player.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export function Player({ music, musicList }: PlayerProps) {
5252
const [isCircular, setIsCircular] = useState(false);
5353
const [eqGains, setEqGains] = useState<number[]>(equalizerPresets.Flat); // 初期値はFlat
5454
const [selectedPreset, setSelectedPreset] = useState<string>("Flat");
55+
const [volume, setVolume] = useState(1); // 音量の初期値を1(最大)に設定
5556

5657
const audioRef = useRef<HTMLAudioElement>(null);
5758
const audioCtxRef = useRef<AudioContext | null>(null);
@@ -383,6 +384,19 @@ export function Player({ music, musicList }: PlayerProps) {
383384
setEqGains(equalizerPresets[presetName]);
384385
};
385386

387+
const handleVolumeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
388+
if (!audioRef.current) return;
389+
const newVolume = parseFloat(e.target.value);
390+
audioRef.current.volume = newVolume;
391+
setVolume(newVolume);
392+
};
393+
394+
useEffect(() => {
395+
if (audioRef.current) {
396+
audioRef.current.volume = volume;
397+
}
398+
}, [volume]);
399+
386400
return (
387401
<div className={styles["music-player-container"]}>
388402
{music.jacketUrl && (
@@ -499,6 +513,19 @@ export function Player({ music, musicList }: PlayerProps) {
499513
<span>{formatTime(duration)}</span>
500514
</div>
501515

516+
<div className={styles["volume-control"]}>
517+
<span>{t("volume")}</span>
518+
<input
519+
type="range"
520+
min="0"
521+
max="1"
522+
step="0.01"
523+
value={volume}
524+
onChange={handleVolumeChange}
525+
className={styles["volume-slider"]}
526+
/>
527+
</div>
528+
502529
<details>
503530
<summary>{t("equalizer")}</summary>
504531
<div className={styles["eq-controls"]}>

src/app/music/[music_id]/page.module.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,42 @@
338338
margin-top: 0.2rem;
339339
}
340340

341+
/* ボリュームコントロール */
342+
.volume-control {
343+
display: flex;
344+
align-items: center;
345+
gap: 1rem;
346+
margin: 1rem 0;
347+
}
348+
349+
.volume-slider {
350+
flex: 1;
351+
height: 4px;
352+
-webkit-appearance: none;
353+
appearance: none;
354+
background: rgba(255, 255, 255, 0.2);
355+
border-radius: 2px;
356+
cursor: pointer;
357+
}
358+
359+
.volume-slider::-webkit-slider-thumb {
360+
-webkit-appearance: none;
361+
width: 16px;
362+
height: 16px;
363+
border-radius: 50%;
364+
background: #fff;
365+
cursor: pointer;
366+
}
367+
368+
.volume-slider::-moz-range-thumb {
369+
width: 16px;
370+
height: 16px;
371+
border-radius: 50%;
372+
background: #fff;
373+
cursor: pointer;
374+
border: none;
375+
}
376+
341377
/* レスポンシブ対応 */
342378
@media (max-width: 600px) {
343379
.eq-sliders {

src/i18n/en/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"artist": "Artist",
5656
"duration": "Duration",
5757
"equalizer": "Equalizer",
58+
"volume":"Volume",
5859
"preset": "Preset",
5960
"browserNotSupported": "Your browser does not support audio playback."
6061
}

src/i18n/ja/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"artist": "アーティスト",
5656
"duration": "時間",
5757
"equalizer": "イコライザ",
58+
"volume": "音量",
5859
"preset": "プリセット",
5960
"browserNotSupported": "お使いのブラウザは音声再生に対応していません。"
6061
}

yarn.lock

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz#a7054dcc145a967dd4dc8fee845a57c1316c9df8"
3030
integrity sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==
3131

32-
"@babel/runtime@^7.23.2", "@babel/runtime@^7.25.0", "@babel/runtime@^7.27.1":
32+
"@babel/runtime@^7.23.2", "@babel/runtime@^7.27.1", "@babel/runtime@^7.27.6":
3333
version "7.27.6"
3434
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.6.tgz#ec4070a04d76bae8ddbb10770ba55714a417b7c6"
3535
integrity sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==
@@ -78,10 +78,10 @@
7878
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0"
7979
integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==
8080

81-
"@eslint/config-array@^0.20.0":
82-
version "0.20.0"
83-
resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.20.0.tgz#7a1232e82376712d3340012a2f561a2764d1988f"
84-
integrity sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==
81+
"@eslint/config-array@^0.20.1":
82+
version "0.20.1"
83+
resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.20.1.tgz#454f89be82b0e5b1ae872c154c7e2f3dd42c3979"
84+
integrity sha512-OL0RJzC/CBzli0DrrR31qzj6d6i6Mm3HByuhflhl4LOBiWxN+3i6/t/ZQQNii4tjksXi8r2CRW1wMpWA2ULUEw==
8585
dependencies:
8686
"@eslint/object-schema" "^2.1.6"
8787
debug "^4.3.1"
@@ -114,10 +114,10 @@
114114
minimatch "^3.1.2"
115115
strip-json-comments "^3.1.1"
116116

117-
"@eslint/js@9.28.0":
118-
version "9.28.0"
119-
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.28.0.tgz#7822ccc2f8cae7c3cd4f902377d520e9ae03f844"
120-
integrity sha512-fnqSjGWd/CoIp4EXIxWVK/sHA6DOHN4+8Ix2cX5ycOY7LG0UY8nHCU5pIp2eaE1Mc7Qd8kHspYNzYXT2ojPLzg==
117+
"@eslint/js@9.29.0":
118+
version "9.29.0"
119+
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.29.0.tgz#dc6fd117c19825f8430867a662531da36320fe56"
120+
integrity sha512-3PIF4cBw/y+1u2EazflInpV+lYsSG0aByVIQzAgb1m1MhHFSbqTyNqtBKHgWf/9Ykud+DhILS9EGkmekVhbKoQ==
121121

122122
"@eslint/object-schema@^2.1.6":
123123
version "2.1.6"
@@ -396,10 +396,10 @@
396396
"@emnapi/runtime" "^1.4.3"
397397
"@tybys/wasm-util" "^0.9.0"
398398

399-
"@next/bundle-analyzer@^15.4.0-canary.81":
400-
version "15.4.0-canary.81"
401-
resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-15.4.0-canary.81.tgz#731688001ff4b19fd695a2172c2e545767516433"
402-
integrity sha512-r5Mip5ItgedmF+KKUdikP4yaKLwJEq04ZUl6Nx96NaaVYpWn3Zj9lYhsFFCYPpKvNIT6cDC4YoP9XpiEN8lIBw==
399+
"@next/bundle-analyzer@^15.4.0-canary.83":
400+
version "15.4.0-canary.83"
401+
resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-15.4.0-canary.83.tgz#362d9a47cc8e2dfa8fe96d1f6b8abfc2db6d2dd7"
402+
integrity sha512-JMeQ+BIv9qwqpyCmJCLjNL9OdwVjub+SePE6b4/h6PltMcEJYDcOu9YtVUBPzKrvY3vIKeP9MQyUQ7kHAiBYQw==
403403
dependencies:
404404
webpack-bundle-analyzer "4.10.1"
405405

@@ -1042,9 +1042,9 @@
10421042
integrity sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==
10431043

10441044
"@types/node@*", "@types/node@^24":
1045-
version "24.0.0"
1046-
resolved "https://registry.yarnpkg.com/@types/node/-/node-24.0.0.tgz#14a278ce74dd33993f2c4e5dd614760728c0fba8"
1047-
integrity sha512-yZQa2zm87aRVcqDyH5+4Hv9KYgSdgwX1rFnGvpbzMaC7YAljmhBET93TPiTd3ObwTL+gSpIzPKg5BqVxdCvxKg==
1045+
version "24.0.3"
1046+
resolved "https://registry.yarnpkg.com/@types/node/-/node-24.0.3.tgz#f935910f3eece3a3a2f8be86b96ba833dc286cab"
1047+
integrity sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg==
10481048
dependencies:
10491049
undici-types "~7.8.0"
10501050

@@ -2470,7 +2470,7 @@ eslint-plugin-react@^7.37.0:
24702470
string.prototype.matchall "^4.0.12"
24712471
string.prototype.repeat "^1.0.0"
24722472

2473-
eslint-scope@^8.3.0:
2473+
eslint-scope@^8.4.0:
24742474
version "8.4.0"
24752475
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82"
24762476
integrity sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==
@@ -2489,17 +2489,17 @@ eslint-visitor-keys@^4.2.0, eslint-visitor-keys@^4.2.1:
24892489
integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==
24902490

24912491
eslint@^9:
2492-
version "9.28.0"
2493-
resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.28.0.tgz#b0bcbe82a16945a40906924bea75e8b4980ced7d"
2494-
integrity sha512-ocgh41VhRlf9+fVpe7QKzwLj9c92fDiqOj8Y3Sd4/ZmVA4Btx4PlUYPq4pp9JDyupkf1upbEXecxL2mwNV7jPQ==
2492+
version "9.29.0"
2493+
resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.29.0.tgz#65e3db3b7e5a5b04a8af541741a0f3648d0a81a6"
2494+
integrity sha512-GsGizj2Y1rCWDu6XoEekL3RLilp0voSePurjZIkxL3wlm5o5EC9VpgaP7lrCvjnkuLvzFBQWB3vWB3K5KQTveQ==
24952495
dependencies:
24962496
"@eslint-community/eslint-utils" "^4.2.0"
24972497
"@eslint-community/regexpp" "^4.12.1"
2498-
"@eslint/config-array" "^0.20.0"
2498+
"@eslint/config-array" "^0.20.1"
24992499
"@eslint/config-helpers" "^0.2.1"
25002500
"@eslint/core" "^0.14.0"
25012501
"@eslint/eslintrc" "^3.3.1"
2502-
"@eslint/js" "9.28.0"
2502+
"@eslint/js" "9.29.0"
25032503
"@eslint/plugin-kit" "^0.3.1"
25042504
"@humanfs/node" "^0.16.6"
25052505
"@humanwhocodes/module-importer" "^1.0.1"
@@ -2511,9 +2511,9 @@ eslint@^9:
25112511
cross-spawn "^7.0.6"
25122512
debug "^4.3.2"
25132513
escape-string-regexp "^4.0.0"
2514-
eslint-scope "^8.3.0"
2515-
eslint-visitor-keys "^4.2.0"
2516-
espree "^10.3.0"
2514+
eslint-scope "^8.4.0"
2515+
eslint-visitor-keys "^4.2.1"
2516+
espree "^10.4.0"
25172517
esquery "^1.5.0"
25182518
esutils "^2.0.2"
25192519
fast-deep-equal "^3.1.3"
@@ -2529,7 +2529,7 @@ eslint@^9:
25292529
natural-compare "^1.4.0"
25302530
optionator "^0.9.3"
25312531

2532-
espree@^10.0.1, espree@^10.3.0:
2532+
espree@^10.0.1, espree@^10.4.0:
25332533
version "10.4.0"
25342534
resolved "https://registry.yarnpkg.com/espree/-/espree-10.4.0.tgz#d54f4949d4629005a1fa168d937c3ff1f7e2a837"
25352535
integrity sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==
@@ -5423,12 +5423,12 @@ react-dom@^19.1.0:
54235423
dependencies:
54245424
scheduler "^0.26.0"
54255425

5426-
react-i18next@^15.5.2:
5427-
version "15.5.2"
5428-
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-15.5.2.tgz#2cfbd8e055efea077a7cbd7fbd9528c76d31925e"
5429-
integrity sha512-ePODyXgmZQAOYTbZXQn5rRsSBu3Gszo69jxW6aKmlSgxKAI1fOhDwSu6bT4EKHciWPKQ7v7lPrjeiadR6Gi+1A==
5426+
react-i18next@^15.5.3:
5427+
version "15.5.3"
5428+
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-15.5.3.tgz#63cae235d540d1b6bde5495b5ebe0c1d5c76de0f"
5429+
integrity sha512-ypYmOKOnjqPEJZO4m1BI0kS8kWqkBNsKYyhVUfij0gvjy9xJNoG/VcGkxq5dRlVwzmrmY1BQMAmpbbUBLwC4Kw==
54305430
dependencies:
5431-
"@babel/runtime" "^7.25.0"
5431+
"@babel/runtime" "^7.27.6"
54325432
html-parse-stringify "^3.0.1"
54335433

54345434
react-is@^16.13.1:

0 commit comments

Comments
 (0)