Skip to content

Commit 9c49d0e

Browse files
committed
feat: executed lints
1 parent c62a238 commit 9c49d0e

File tree

11 files changed

+134
-95
lines changed

11 files changed

+134
-95
lines changed

public/app/WebDevelopperTool/Source/script.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function openDevelopper() {
2020
}
2121
openDevelopper();
2222
HTMLSource.value = getHTMLSource();
23-
document.querySelector("#VisibleSwitch").addEventListener("click", (e) => {
23+
document.querySelector("#VisibleSwitch").addEventListener("click", (_e) => {
2424
if (document.getElementById("DevelopperToolBox").style.visibility === "visible") {
2525
document.getElementById("DevelopperToolBox").style.visibility = "hidden";
2626
document.getElementById("MaximiseSwitch").style.visibility = "hidden";
@@ -32,32 +32,32 @@ document.querySelector("#VisibleSwitch").addEventListener("click", (e) => {
3232
openDevelopper();
3333
}
3434
});
35-
document.querySelector("#MaximiseSwitch").addEventListener("click", (e) => {
35+
document.querySelector("#MaximiseSwitch").addEventListener("click", (_e) => {
3636
if (document.getElementById("DevelopperToolBox").style.width == "100%") {
3737
document.getElementById("DevelopperToolBox").style.width = "20%";
3838
} else {
3939
document.getElementById("DevelopperToolBox").style.width = "100%";
4040
}
4141
});
42-
document.querySelector("#HTML").addEventListener("click", (e) => {
42+
document.querySelector("#HTML").addEventListener("click", (_e) => {
4343
CSSEditor.style.visibility = "hidden";
4444
JSEditor.style.visibility = "hidden";
4545
HTMLEditor.style.visibility = "visible";
4646
});
47-
document.querySelector("#CSS").addEventListener("click", (e) => {
47+
document.querySelector("#CSS").addEventListener("click", (_e) => {
4848
HTMLEditor.style.visibility = "hidden";
4949
JSEditor.style.visibility = "hidden";
5050
CSSEditor.style.visibility = "visible";
5151
});
52-
document.querySelector("#JS").addEventListener("click", (e) => {
52+
document.querySelector("#JS").addEventListener("click", (_e) => {
5353
CSSEditor.style.visibility = "hidden";
5454
HTMLEditor.style.visibility = "hidden";
5555
JSEditor.style.visibility = "visible";
5656
});
57-
document.querySelector("#RestoreHTML").addEventListener("click", (e) => {
57+
document.querySelector("#RestoreHTML").addEventListener("click", (_e) => {
5858
HTMLSource.value = getHTMLSource();
5959
});
60-
document.querySelector("#UpdateHTML").addEventListener("click", (e) => {
60+
document.querySelector("#UpdateHTML").addEventListener("click", (_e) => {
6161
console.log(HTMLSource.value);
6262
document.open();
6363
document.write(HTMLSource.value);
@@ -80,15 +80,15 @@ console.error = ((logTextAreaArgument) => {
8080
return (text) => (logTextArea.innerHTML += "[×]>" + text + "<br>");
8181
})(document.getElementById("JSRunnerConsole"));
8282

83-
document.querySelector("#JSRunnerButton").addEventListener("click", (e) => {
83+
document.querySelector("#JSRunnerButton").addEventListener("click", (_e) => {
8484
let before = document.getElementById("JSRunner");
8585
before.remove();
8686
let after = document.createElement("script");
8787
after.id = "JSRunner";
8888
after.innerHTML = document.getElementById("JSSource").value;
8989
document.getElementById("JSEditor").appendChild(after);
9090
});
91-
document.querySelector("#UpdateCSS").addEventListener("click", (e) => {
91+
document.querySelector("#UpdateCSS").addEventListener("click", (_e) => {
9292
let before = document.getElementById("CSSAdder");
9393
before.remove();
9494
let after = document.createElement("style");

public/app/audio-player/script.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ const get_audio_url = () => {
77
return param_audio == null ? default_audio : param_audio;
88
};
99
audio.src = get_audio_url();
10+
11+
const get_image_url = () => {
12+
const default_img = "https://develop.the-infinitys.f5.si/image/The-Infinitys.webp";
13+
const param_img = new URLSearchParams(document.location.search).get("img");
14+
return param_img == null ? default_img : param_img;
15+
};
16+
1017
const add_bg = () => {
11-
const get_image_url = () => {
12-
const default_img = "https://develop.the-infinitys.f5.si/image/The-Infinitys.webp";
13-
const param_img = new URLSearchParams(document.location.search).get("img");
14-
return param_img == null ? default_img : param_img;
15-
};
1618
const jacket = document.createElement("img");
1719
jacket.src = get_image_url();
1820
jacket.className = "jacket";

src/app/[article_year]/[month]/[aid]/components/client.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ async function generateSha256Hex(input: string): Promise<string> {
2929
return hashHex;
3030
}
3131

32+
// シードに基づいた疑似乱数生成器 (Mulberry32)
33+
const mulberry32 = (seed: number) => {
34+
return () => {
35+
let t = (seed += 0x6d2b79f5);
36+
t = Math.imul(t ^ (t >>> 15), t | 1);
37+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
38+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
39+
};
40+
};
41+
3242
export default function ClientComponent({
3343
articles,
3444
slug,
@@ -42,15 +52,6 @@ export default function ClientComponent({
4252
const toc = tocs.find((t) => t.lang === locale)?.toc || [];
4353
const [sha256Seed, setSha256Seed] = useState<number | null>(null);
4454
const max_show_others = 2;
45-
// シードに基づいた疑似乱数生成器 (Mulberry32)
46-
const mulberry32 = (seed: number) => {
47-
return () => {
48-
let t = (seed += 0x6d2b79f5);
49-
t = Math.imul(t ^ (t >>> 15), t | 1);
50-
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
51-
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
52-
};
53-
};
5455

5556
useEffect(() => {
5657
const seedString = `${slug}-${locale}`;

src/app/[article_year]/[month]/[aid]/components/server.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { getArticleIndexes, toHTML } from "../../../../article/article";
2-
import articleStyles from "../../../../article/article.module.css";
32
import crypto from "crypto";
43
import ClientComponent from "./client";
54
import { AvailableLocales } from "@/i18n/request";

src/app/[article_year]/[month]/[aid]/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import ArticleServer from "./components/server";
22
import { getArticleIndexes } from "@/app/article/article";
33
import { toHTML } from "@/app/article/article";
4-
import styles from "./page.module.css";
54
import { Metadata } from "next";
65
import Loading from "@/app/loading";
76
import { Suspense } from "react";

src/app/[article_year]/[month]/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import articleStyles from "../../article/article.module.css"; // CSSファイルをインポート
2-
import pageStyles from "../../article/page.module.css";
31
import Explains from "./components/explains";
42
import ArticlePage from "./components/articlepage"; // クライアントコンポーネントをインポート
53
import { getArticleIndexes } from "@/app/article/article";

src/app/[article_year]/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import articleStyles from "../article/article.module.css"; // CSSファイルをインポート
2-
import pageStyles from "../article/page.module.css";
31
import Explains from "./components/explains";
42
import ArticlePage from "./components/articlepage"; // クライアントコンポーネントをインポート
53
import { getArticleIndexes } from "@/app/article/article";

src/app/article/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import articleStyles from "./article.module.css"; // CSSファイルをインポート
2-
import pageStyles from "./page.module.css";
31
import Explains from "./components/explains";
42
import ArticlePage from "./components/articlepage"; // クライアントコンポーネントをインポート
53
import { Metadata } from "next";

src/app/layout/back2top.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
import { useState, useEffect } from "react";
44

5+
const scrollToTop = () => {
6+
window.scrollTo({ top: 0, behavior: "smooth" });
7+
};
8+
59
export default function BackToTopButton() {
610
const [isVisible, setIsVisible] = useState(false);
711

@@ -14,10 +18,6 @@ export default function BackToTopButton() {
1418
return () => window.removeEventListener("scroll", handleScroll);
1519
}, []);
1620

17-
const scrollToTop = () => {
18-
window.scrollTo({ top: 0, behavior: "smooth" });
19-
};
20-
2121
return (
2222
<button
2323
onClick={scrollToTop}

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ interface PlayerProps {
1818
musicList: Music[];
1919
}
2020

21+
// 時間をフォーマットするヘルパー関数
22+
const formatTime = (time: number) => {
23+
if (isNaN(time)) return "0:00";
24+
const minutes = Math.floor(time / 60);
25+
const seconds = Math.floor(time % 60);
26+
return `${minutes}:${seconds.toString().padStart(2, "0")}`;
27+
};
28+
2129
// イコライザのプリセットを定義
2230
const equalizerPresets: { [key: string]: number[] } = {
2331
Flat: [0, 0, 0, 0, 0],
@@ -268,13 +276,6 @@ export function Player({ music, musicList }: PlayerProps) {
268276
audioRef.current.currentTime = position;
269277
};
270278

271-
const formatTime = (time: number) => {
272-
if (isNaN(time)) return "0:00";
273-
const minutes = Math.floor(time / 60);
274-
const seconds = Math.floor(time % 60);
275-
return `${minutes}:${seconds.toString().padStart(2, "0")}`;
276-
};
277-
278279
const handleSkipForward = () => {
279280
if (!audioRef.current) return;
280281
audioRef.current.currentTime = Math.min(audioRef.current.currentTime + 10, duration);
@@ -439,7 +440,7 @@ export function Player({ music, musicList }: PlayerProps) {
439440
<button
440441
type="button"
441442
onClick={handleToggleArrangement}
442-
className={`${styles["rate-button"]} ${isCircular ? styles["active"] : ""}`}
443+
className={`${styles["rate-button"]} ${isCircular ? "active" : ""}`}
443444
>
444445
{isCircular ? "Linear" : "Circular"}
445446
</button>

0 commit comments

Comments
 (0)