mirror of
https://github.com/PR0M3TH3AN/Archivox.git
synced 2025-09-07 14:48:40 +00:00
Add base templates, theme, and dark mode
This commit is contained in:
51
assets/theme.css
Normal file
51
assets/theme.css
Normal file
@@ -0,0 +1,51 @@
|
||||
:root {
|
||||
--bg-color: #ffffff;
|
||||
--text-color: #333333;
|
||||
--sidebar-bg: #f3f3f3;
|
||||
--sidebar-width: 240px;
|
||||
}
|
||||
[data-theme="dark"] {
|
||||
--bg-color: #222222;
|
||||
--text-color: #eeeeee;
|
||||
--sidebar-bg: #333333;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg-color);
|
||||
color: var(--text-color);
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.5rem 1rem;
|
||||
background: var(--sidebar-bg);
|
||||
}
|
||||
.logo { text-decoration: none; color: var(--text-color); font-weight: bold; }
|
||||
.sidebar-toggle,
|
||||
.theme-toggle { background: none; border: none; font-size: 1.2rem; margin-right: 1rem; cursor: pointer; }
|
||||
.container { display: flex; }
|
||||
.sidebar {
|
||||
width: var(--sidebar-width);
|
||||
background: var(--sidebar-bg);
|
||||
padding: 1rem;
|
||||
}
|
||||
.sidebar ul { list-style: none; padding: 0; }
|
||||
.sidebar a { text-decoration: none; color: var(--text-color); }
|
||||
main {
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
}
|
||||
.breadcrumbs a { color: var(--text-color); text-decoration: none; }
|
||||
@media (max-width: 768px) {
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
left: -100%;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
transition: left 0.3s ease;
|
||||
z-index: 1000;
|
||||
}
|
||||
body.sidebar-open .sidebar { left: 0; }
|
||||
}
|
33
assets/theme.js
Normal file
33
assets/theme.js
Normal file
@@ -0,0 +1,33 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const sidebarToggle = document.getElementById('sidebar-toggle');
|
||||
const themeToggle = document.getElementById('theme-toggle');
|
||||
const root = document.documentElement;
|
||||
|
||||
function setTheme(theme) {
|
||||
root.dataset.theme = theme;
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
const stored = localStorage.getItem('theme');
|
||||
if (stored) setTheme(stored);
|
||||
|
||||
sidebarToggle?.addEventListener('click', () => {
|
||||
document.body.classList.toggle('sidebar-open');
|
||||
});
|
||||
|
||||
themeToggle?.addEventListener('click', () => {
|
||||
const next = root.dataset.theme === 'dark' ? 'light' : 'dark';
|
||||
setTheme(next);
|
||||
});
|
||||
|
||||
// breadcrumbs
|
||||
const bc = document.getElementById('breadcrumbs');
|
||||
if (bc) {
|
||||
const parts = location.pathname.split('/').filter(Boolean);
|
||||
let path = '';
|
||||
bc.innerHTML = '<a href="/">Home</a>';
|
||||
parts.forEach((p) => {
|
||||
path += '/' + p;
|
||||
bc.innerHTML += ' / <a href="' + path + '">' + p.replace(/-/g, ' ') + '</a>';
|
||||
});
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user