revert theme selector

This commit is contained in:
Jonny_Bro (Nikita) 2025-02-24 20:15:25 +05:00
parent 2248123b61
commit 6be5e7a447
No known key found for this signature in database
GPG key ID: A18808B38428F7C4
7 changed files with 16 additions and 41 deletions

View file

@ -1,7 +1,6 @@
<footer class="footer footer-center p-4 bg-base-300 text-base-content font-mono">
<div class="block">
Coperight @ Jonny_Bro & rlx 2023-<%= new Date().getFullYear() %>
<br>
<a class="link link-hover" target="_blank" href="https://git.jonnybro.ru/jonny_bro/beatrun-courses-server-docker">[Full source code available here!]</a>
</div>
</footer>

View file

@ -16,23 +16,21 @@
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>
<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>
<% } %>
@ -47,17 +45,20 @@
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">
<!-- <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>
</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>
@ -70,22 +71,19 @@
<% } %>
</ul>
<script>
const element = document.getElementById("themeSelector");
<!-- <script>
const e = document.getElementById("themeSelector");
element.addEventListener("change", () => {
e.addEventListener("change", () => {
event.preventDefault();
const theme = localStorage.getItem("theme");
if (!theme) localStorage.setItem("theme", "black");
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>
if (localStorage.getItem("theme") === "black") document.getElementById("themeSelector").checked = "checked"
else document.getElementById("themeSelector").checked = null
</script> -->
</nav>

View file

@ -25,9 +25,6 @@
</style>
<script>
// Apply user's theme
document.documentElement.setAttribute("data-theme", localStorage.getItem("theme"));
function sendAction(args) {
const { action } = args;
const responseBox = document.getElementById("responseBox");

View file

@ -26,9 +26,6 @@
</style>
<script>
// Apply user's theme
document.documentElement.setAttribute("data-theme", localStorage.getItem("theme"));
function update() {
const page = document.getElementById("pageSelect");
const sort = document.getElementById("sortValue");

View file

@ -24,11 +24,6 @@
-ms-overflow-style: none;
}
</style>
<script>
// Apply user's theme
document.documentElement.setAttribute("data-theme", localStorage.getItem("theme"));
</script>
</head>
<body class="w-screen font-mono">

View file

@ -24,16 +24,10 @@
-ms-overflow-style: none;
}
</style>
<script>
// Apply user's theme
document.documentElement.setAttribute("data-theme", localStorage.getItem("theme"));
</script>
</head>
<body class="w-screen font-mono">
<% include ../components/navbar.html %>
<div class="hero min-h-screen bg-base-200">
<div class="hero-content text-center">
<div class="text-center align-top w-full">

View file

@ -24,11 +24,6 @@
-ms-overflow-style: none;
}
</style>
<script>
// Apply user's theme
document.documentElement.setAttribute("data-theme", localStorage.getItem("theme"));
</script>
</head>
<body class="w-screen font-mono">