<!DOCTYPE html>
<html>
   <head>
      <script></script>
      <title>Lightning Chat</title>
      <link href="/bootstrap-5.1.3-dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" rel="stylesheet">
      <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
      <link rel="shortcut icon" type="image/jpg" href="https://media.discordapp.net/attachments/761286162333171734/904834737888198726/unknown.png"/>
      <script 
      <script src="/bootstrap-5.1.3-dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
      <style>
         body{
         font-weight:300;
         font-size: large;
         }
         .card-title{
         font-size: xx-large;
         }
         li:hover{
         background-color:#86bbd8;
         }
      </style>
            <script defer data-domain="lightningchat.live" src="https://plausible.yeetpc.com/js/plausible.js"></script>
   </head>
   <body>
      <nav class="navbar navbar-expand-lg navbar-dark" style='background-color:#004766;'>
         <div class="container-fluid">
            <a style="color: #ffd166;"class="navbar-brand" href="/">Lightning âš¡</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
               <% if(loggedin == true){ %>
               <h5 class="nav-item dropdown">
               <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" style='color: #b7b7b7;'aria-expanded="false">
               <%=name1%>
               </a>
               <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                  <li><a class="dropdown-item" href="/account">Account</a></li>
                  <% if(item[0].type == 'Mod'){ %>
                  <li><a class="dropdown-item" href="/storage">Storage</a></li>
                  <li><a class="dropdown-item" href="/newarticle">New Article</a></li>
                  <% } %>
                  <li><a class="dropdown-item" href="/logout">Logout</a></li>
               </ul>
               </li>
               <% }else{ %>
               <form class="d-flex">
                  <a class="btn btn-outline-success" style = 'margin-right: 5%;'href='/login'>Login</a>
               </form>
               <% } %>
            </div>
         </div>
      </nav>
      <div class="dropdown">
         <ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
            <li><a class="dropdown-item" href="#">New project...</a></li>
            <li><a class="dropdown-item" href="#">Settings</a></li>
            <li><a class="dropdown-item" href="#">Profile</a></li>
            <li>
               <hr class="dropdown-divider">
            </li>
            <li><a class="dropdown-item" href="#">Sign out</a></li>
         </ul>
      </div>
      </div>
      <%let count = 0%>
      <% item.forEach(function (result) { %>
      <%count++%>
      <%if (count == 1) {%>
      <form id="form_id" method="POST" name="myform" action='editaccount'>
      <div class="card" style="width: 100%;float:right;">
      <div class="card-body" id = <%= result.name%> style = 'text-align:center;'>
         <label for="exampleFormControlInput1" class="form-label">Link</label>
         <h3><a href=/room?name=<%= result.link ||result.name%>>https://www.lightningchat.live/room?name=<%= result.link || result.name%></a></h3>
         <p>        
            <a href= <%='/deleteroom?name='+encodeURIComponent(result.name)%> class="btn btn-primary">Delete</a>
         </p>
      </div>
      <%}%>
      <% }) %>
   </body>
</html>