refactor: remove tjaf dependency; add local TJA parser

This commit is contained in:
2025-11-22 21:29:13 +08:00
commit 66d8ed5c6f
299 changed files with 29006 additions and 0 deletions

25
public/upload/index.html Normal file
View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>太鼓ウェブあっぷろーだー</title>
<link rel="stylesheet" href="style.css">
<script src="upload.js"></script>
</head>
<body>
<h1>太鼓ウェブあっぷろーだー</h1>
<form id="upload-form" enctype="multipart/form-data">
<label for="file_tja">TJA ファイル:</label>
<input type="file" name="file_tja" accept=".tja" required>
<label for="file_music">音楽ファイル:</label>
<input type="file" name="file_music" accept=".ogg,.mp3,.wav" required>
</form>
<button type="button" onclick="uploadFiles()">今すぐ投稿! (1分ほどかかる場合があります)</button>
<div id="error-view"></div>
</body>
</html>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

23
public/upload/style.css Normal file
View File

@@ -0,0 +1,23 @@
@font-face {
font-family: "Roboto";
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(roboto/Roboto-Regular.ttf) format("truetype");
}
body * {
margin: 0;
font-family: "Roboto", sans-serif;
white-space: pre-line;
word-break: break-word;
}
body {
margin: 0;
padding: 2rem;
}
body > :not(:last-child) {
margin-bottom: 2rem;
}

27
public/upload/upload.js Normal file
View File

@@ -0,0 +1,27 @@
function uploadFiles() {
const form = document.querySelector("#upload-form");
const formData = new FormData(form);
fetch("/api/upload", {
method: "POST",
body: formData,
})
.then((res) => {
if (res.ok) {
return res.json();
} else {
throw new Error(res.url + " で " + res.status.toString() + " が発生しました。");
}
})
.then((data) => {
if (data.success) {
alert("おめでとう!ファイルの投稿に成功しました!");
} else {
throw new Error(data.error);
}
})
.catch((error) => {
console.error("エラー:", error);
document.querySelector("#error-view").textContent = error;
});
}