From 86952130fde4c40725374827c415ad78eb586133 Mon Sep 17 00:00:00 2001 From: Yusaku-KASAI Date: Wed, 17 Jul 2024 14:01:04 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E7=94=BB=E9=9D=A2=E3=81=AE=E5=9E=8B=E3=82=92=E4=BD=9C?= =?UTF-8?q?=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.mjs | 2 +- static/mypage/index.html | 13 +++++++++++++ static/mypage/script.js | 23 +++++++++++++++++++++++ static/mypage/style.css | 3 +++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 static/mypage/index.html create mode 100644 static/mypage/script.js create mode 100644 static/mypage/style.css diff --git a/main.mjs b/main.mjs index 8762ae9..c353447 100644 --- a/main.mjs +++ b/main.mjs @@ -13,7 +13,7 @@ app.get("/", async (request, response) => { const posts = await prisma.post.findMany(); const html = template.replace( "", - posts.map((post) => `
  • ${escapeHTML(post.message)}
  • `).join(""), + posts.map((post) => `
  • ${escapeHTML(post.message)}
  • `).join("") ); response.send(html); }); diff --git a/static/mypage/index.html b/static/mypage/index.html new file mode 100644 index 0000000..fdde8c4 --- /dev/null +++ b/static/mypage/index.html @@ -0,0 +1,13 @@ + + + + + + ユーザー登録 + + + +
    + + + \ No newline at end of file diff --git a/static/mypage/script.js b/static/mypage/script.js new file mode 100644 index 0000000..10913e3 --- /dev/null +++ b/static/mypage/script.js @@ -0,0 +1,23 @@ +const app = document.getElementById("app"); +const title = document.createElement("h1"); +title.textContent = "ユーザー登録"; +const form = document.createElement("form"); +const table = document.createElement("table"); +const info = ["苗字", "名前", "誕生日", "性別"]; +for (tag of info) { + const tr = document.createElement("tr"); + const td1 = document.createElement("td"); + td1.textContent = tag; + const td2 = document.createElement("td"); + const input = document.createElement("input"); + td2.appendChild(input); + tr.appendChild(td1); + tr.appendChild(td2); + table.appendChild(tr); +} +const button = document.createElement("button"); +button.textContent = "登録"; +form.appendChild(table); +form.appendChild(button); +app.appendChild(title); +app.appendChild(form); diff --git a/static/mypage/style.css b/static/mypage/style.css new file mode 100644 index 0000000..1f63b67 --- /dev/null +++ b/static/mypage/style.css @@ -0,0 +1,3 @@ +#app { + background-color: rgb(99, 184, 184); +} \ No newline at end of file