beatrun-courses-server-docker/components/navbar.html
2024-08-29 09:48:27 +05:00

84 lines
No EOL
3.5 KiB
HTML

<nav class="navbar p-0 min-h-0 px-4 justify-between bg-base-300 font-mono">
<a class="btn px-0 hover:bg-transparent hover:text-red-700 btn-ghost text-lg" href="/">
beatrun.ru | Courses Database
</a>
<!-- Menu for mobile -->
<div class="dropdown dropdown-end sm:hidden">
<button class="btn btn-ghost">
<i class="fa-solid fa-bars text-lg"></i>
</button>
<ul tabindex="0" class="dropdown-content menu z-[1] bg-base-200 p-6 rounded-box shadow w-56 gap-2">
<li>
<a target="_blank" href="https://beatrun.jonnybro.ru">
<i class="fa-solid fa-house"></i>
Main page
</a>
</li>
<li>
<a target="_blank" href="https://discord.com/invite/93Psubbgsg">
<i class="fa-brands fa-discord"></i>
Our Discord
</a>
</li>
<% if (user) { %>
<a class="btn btn-sm btn-primary hover:bg-red-700" href="/key"><%= user.personaname %></a>
<a class="btn btn-sm btn-primary hover:bg-red-700" href="/upload">Upload</a>
<% } else { %>
<a class="btn btn-sm btn-primary hover:bg-red-700" href="/key">Login</a>
<% } %>
<% if (user && locals.admins[user.steamid]) { %>
<a class="btn btn-sm btn-primary hover:bg-red-700" href="/admin">Admin</a>
<% } %>
</ul>
</div>
<!-- Menu for desktop -->
<ul class="hidden menu sm:menu-horizontal gap-2">
<li>
<a class="px-2" target="_blank" href="https://github.com/JonnyBro/beatrun">
<i class="fa-brands fa-github"></i>
My fork
</a>
</li>
<li>
<a class="px-2" target="_blank" href="https://discord.com/invite/93Psubbgsg">
<i class="fa-brands fa-discord"></i>
Our Discord
</a>
</li>
<!-- <label class="cursor-pointer grid place-items-center">
<input id="themeSelector" type="checkbox" class="toggle bg-base-content row-start-1 col-start-1 col-span-2"/>
<svg class="col-start-2 row-start-1 stroke-base-100 fill-base-100" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
<svg class="col-start-1 row-start-1 stroke-base-100 fill-base-100" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4"/></svg>
</label> -->
<% if (user) { %>
<a class="btn btn-sm btn-primary hover:bg-red-700" href="/key"><%= user.personaname %></a>
<a class="btn btn-sm btn-primary hover:bg-red-700" href="/upload">Upload</a>
<% } else { %>
<a class="btn btn-sm btn-primary hover:bg-red-700" href="/key">Login</a>
<% } %>
<% if (user && locals.admins[user.steamid]) { %>
<a class="btn btn-sm btn-primary hover:bg-red-700" href="/admin">Admin</a>
<% } %>
</ul>
<!-- <script>
const e = document.getElementById("themeSelector");
e.addEventListener("change", () => {
event.preventDefault();
const theme = localStorage.getItem("theme")
theme === "nord" ? localStorage.setItem("theme", "black") : localStorage.setItem("theme", "nord");
document.documentElement.setAttribute("data-theme", localStorage.getItem("theme"));
})
if (localStorage.getItem("theme") === "black")
document.getElementById("themeSelector").checked = "checked"
else
document.getElementById("themeSelector").checked = null
</script> -->
</nav>