Initial commit
This commit is contained in:
@@ -6,7 +6,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
|
||||
<style>
|
||||
* { box-sizing: border-box; }
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
@@ -27,97 +29,79 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
header .logo { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
|
||||
|
||||
#menu-btn {
|
||||
header .logo {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
/* Home Button */
|
||||
.home-btn {
|
||||
position: absolute;
|
||||
left: 24px; top: 50%;
|
||||
left: 24px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: #fff; border: none; padding: 6px 10px;
|
||||
border-radius: 8px; cursor: pointer;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
#menu-btn svg { stroke: #4f46e5; }
|
||||
|
||||
/* Sidebar */
|
||||
#sidebar {
|
||||
background: #fff;
|
||||
border-right: 1px solid #e5e7eb;
|
||||
padding: 20px;
|
||||
width: 240px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: -260px;
|
||||
height: 100vh; /* full viewport height */
|
||||
overflow: hidden; /* non-scrollable */
|
||||
transition: left 0.3s ease, box-shadow 0.3s ease;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between; /* keeps logout at bottom */
|
||||
box-shadow: 0 0 20px rgba(0,0,0,0.05);
|
||||
}
|
||||
#sidebar.active { left: 0; }
|
||||
|
||||
#sidebar ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
#sidebar ul li { margin-bottom: 16px; }
|
||||
#sidebar ul li a {
|
||||
text-decoration: none;
|
||||
color: #1f2937;
|
||||
font-weight: 500;
|
||||
display: block;
|
||||
padding: 12px 16px;
|
||||
border-radius: 8px;
|
||||
transition: all 0.25s ease;
|
||||
background: #f9fafb;
|
||||
white-space: nowrap; /* prevent wrapping */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#sidebar ul li a:hover {
|
||||
background: #4f46e5;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 8px rgba(79,70,229,0.3);
|
||||
}
|
||||
|
||||
/* Logout button fixed at bottom */
|
||||
.logout-container {
|
||||
margin-top: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.logout-btn {
|
||||
width: 100%;
|
||||
background: #ef4444;
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border: none;
|
||||
padding: 10px 14px;
|
||||
border-radius: 10px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.25s ease;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
|
||||
transition: all 0.2s ease;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.home-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
transform: translateY(-50%) scale(1.05);
|
||||
}
|
||||
|
||||
.home-btn svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
stroke: #fff;
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
/* Logout Button */
|
||||
.logout-btn {
|
||||
position: absolute;
|
||||
right: 24px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border: none;
|
||||
color: #fff;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
text-decoration: none;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.logout-btn:hover {
|
||||
background: #dc2626;
|
||||
box-shadow: 0 3px 8px rgba(0,0,0,0.15);
|
||||
background: #ef4444;
|
||||
transform: translateY(-50%) scale(1.05);
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
transition: margin-left 0.3s ease;
|
||||
padding: 20px;
|
||||
background: #f4f5f7;
|
||||
min-height: calc(100vh - 64px);
|
||||
}
|
||||
main.shifted { margin-left: 240px; }
|
||||
|
||||
/* Cards */
|
||||
.cards-container {
|
||||
@@ -125,17 +109,34 @@
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 16px 20px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
|
||||
.card-row { margin-bottom: 8px; font-size: 14px; color: #374151; }
|
||||
.card-row strong { color: #111827; }
|
||||
.card-actions { margin-top: 12px; }
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.card-row {
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.card-row strong {
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.card-actions .btn {
|
||||
display: inline-block;
|
||||
padding: 6px 10px;
|
||||
@@ -147,93 +148,97 @@
|
||||
margin-right: 6px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.card-actions .btn.edit { background: #4f46e5; }
|
||||
.card-actions .btn.confirm { background: #10b981; }
|
||||
.card-actions .btn.decline { background: #ef4444; }
|
||||
.card-actions .btn:hover { opacity: 0.85; transform: translateY(-1px); }
|
||||
|
||||
.card-actions .btn.edit {
|
||||
background: #4f46e5;
|
||||
}
|
||||
|
||||
.card-actions .btn.confirm {
|
||||
background: #10b981;
|
||||
}
|
||||
|
||||
.card-actions .btn.decline {
|
||||
background: #ef4444;
|
||||
}
|
||||
|
||||
.card-actions .btn:hover {
|
||||
opacity: 0.85;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 1024px) {
|
||||
#sidebar { width: 220px; }
|
||||
main.shifted { margin-left: 220px; }
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
#sidebar { width: 200px; left: -220px; }
|
||||
#sidebar.active { left: 0; box-shadow: 2px 0 12px rgba(0,0,0,0.2); }
|
||||
main.shifted { margin-left: 0; } /* overlay on small screens */
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.cards-container { grid-template-columns: 1fr; }
|
||||
.card { padding: 14px 16px; }
|
||||
.card-row { font-size: 13px; }
|
||||
.card-actions .btn { font-size: 12px; padding: 5px 8px; margin-bottom: 4px; }
|
||||
.cards-container {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 14px 16px;
|
||||
}
|
||||
|
||||
.card-row {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.card-actions .btn {
|
||||
font-size: 12px;
|
||||
padding: 5px 8px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
header { padding: 12px 16px; }
|
||||
#menu-btn { left: 16px; padding: 4px 8px; }
|
||||
.logo { font-size: 18px; }
|
||||
#sidebar { padding: 16px; }
|
||||
.logout-btn { font-size: 13px; padding: 8px 10px; }
|
||||
header {
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.home-btn {
|
||||
left: 16px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.home-btn svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
right: 16px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<button id="menu-btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M4 5h16"/>
|
||||
<path d="M4 12h16"/>
|
||||
<path d="M4 19h16"/>
|
||||
<a href="{% url 'dashboard' %}" class="home-btn" title="Dashboard">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
|
||||
<polyline points="9 22 9 12 15 12 15 22"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
</a>
|
||||
<div class="logo">Xvatayka</div>
|
||||
<form method="post" action="{% url 'logout' %}" style="margin: 0;">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="logout-btn" title="Chiqish">🚪</button>
|
||||
</form>
|
||||
</header>
|
||||
|
||||
<nav id="sidebar">
|
||||
<ul>
|
||||
<li><a href="{% url 'dashboard' %}">Dashboard</a></li>
|
||||
<li><a href="{% url 'expense_list' %}">Xarajatlar</a></li>
|
||||
<li><a href="{% url 'income_list' %}">Kirimlar</a></li>
|
||||
<li><a href="{% url 'toy_movement_list' %}">Oʻyinchoq harakatlari</a></li>
|
||||
{% if user.role == "manager" or user.role == "businessman" %}
|
||||
<li><a href="{% url 'device_list' %}">Aparatlar</a></li>
|
||||
<li><a href="{% url 'warehouse_list' %}">Omborlar</a></li>
|
||||
<li><a href="{% url 'user_list' %}">Foydalanuvchilar</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div class="logout-container">
|
||||
{% if user.is_authenticated %}
|
||||
<form method="post" action="{% url 'logout' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="logout-btn">Chiqish</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main id="main-content">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<script>
|
||||
const menuBtn = document.getElementById('menu-btn');
|
||||
const sidebar = document.getElementById('sidebar');
|
||||
const mainContent = document.getElementById('main-content');
|
||||
|
||||
menuBtn.addEventListener('click', () => {
|
||||
sidebar.classList.toggle('active');
|
||||
mainContent.classList.toggle('shifted');
|
||||
});
|
||||
|
||||
// Optional: click outside to close
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!sidebar.contains(e.target) && !menuBtn.contains(e.target)) {
|
||||
sidebar.classList.remove('active');
|
||||
mainContent.classList.remove('shifted');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user