<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
    <link href="https://unpkg.com/nes.css@latest/css/nes.min.css" rel="stylesheet" />
    <title>データベース掲示板</title>

</head>
<body class="bg-pink-50">
    <main class="mt-20">
        <div class="nes-container is-dark with-title">
            <p class="title">Tubuyakisakata</p>
            <div>
                <span class="text-sm font-bold text-center">つぶやきばしょ！</span>
                <div class="p-2 mb-2">
                    <span class="websocket-status nes-text is-primary">null</span>
                  </div>
            </div>
            <section class="my-4">
                <div class="p-2 rounded shadow">
                    <form method="post">
                        <label">名前：<input type="text" name="name"  style="color: #000;"></label><br>
                        <label>コメント：<br>
                        <textarea name="comment" rows="6" cols="60"  style="color: #000;" id="send-message"></textarea></label><br>
                        <input type="submit" value="送信" id="send-botton"  style="color: #000;">
                    </form>
                </div>
                <section class="my-4">
                    <div class="text-sm font-bold text-center">メッセージ一覧</div>
                    <p>
                        <% for (let data of posts) { %>
                            <%= data.id %>. <%= data.name %> - <%= data.date %><br>
                            <pre class="bbs">
                                <%= data.comment %>
                            </pre>
                            <hr>
                        <% } %>
                        <% if (msg) { %>
                        <p><b><%= msg %></b></p>
                        <% } %>
                      </p>
                </section>
              </section>
        </div>
    </main>

</body>
</html>