166 lines
4.7 KiB
PHP
166 lines
4.7 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{{ config('app.name', 'Perpus') }}</title>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
@vite(['resources/scss/app.scss', 'resources/js/app.js'])
|
|
|
|
<!-- Flatpickr CSS & JS untuk calendar picker -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/themes/material_blue.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
|
<script src="https://npmcdn.com/flatpickr/dist/l10n/id.js"></script>
|
|
|
|
<style>
|
|
.sidebar {
|
|
width: 250px;
|
|
position: fixed;
|
|
top: 0;
|
|
bottom: 0;
|
|
z-index: 1050;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.main-wrapper {
|
|
transition: margin-left 0.3s ease;
|
|
}
|
|
|
|
.overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
z-index: 1049;
|
|
display: none;
|
|
}
|
|
|
|
.overlay.active {
|
|
display: block;
|
|
}
|
|
|
|
@media (min-width: 992px) {
|
|
.sidebar {
|
|
left: 0;
|
|
}
|
|
|
|
.main-wrapper {
|
|
margin-left: 250px;
|
|
}
|
|
|
|
.sidebar.minimized {
|
|
width: 70px;
|
|
}
|
|
|
|
.sidebar.minimized .nav-text,
|
|
.sidebar.minimized .sidebar-title {
|
|
display: none;
|
|
}
|
|
|
|
.sidebar.minimized .nav-link {
|
|
justify-content: center;
|
|
}
|
|
|
|
.main-wrapper.sidebar-minimized {
|
|
margin-left: 80px;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 991.98px) {
|
|
.sidebar {
|
|
left: -250px;
|
|
}
|
|
|
|
.sidebar.active {
|
|
left: 0;
|
|
}
|
|
}
|
|
|
|
.sidebar .nav-link {
|
|
font-weight: 500;
|
|
color: #555;
|
|
margin: .3rem 0;
|
|
border-radius: .5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.sidebar .nav-link.active {
|
|
background: rgba(67, 94, 190, .1);
|
|
color: #435ebe;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.sidebar .nav-link:hover:not(.active) {
|
|
background: #f8f9fa;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="d-flex">
|
|
@include('layouts.sidebar')
|
|
<div id="overlay" class="overlay"></div>
|
|
|
|
<div class="main-wrapper flex-grow-1">
|
|
@include('layouts.navigation')
|
|
<main class="container-fluid py-4">
|
|
{{ $slot }}
|
|
</main>
|
|
<footer class="footer text-center py-3">
|
|
<span class="text-muted small">Copyright © {{ date('Y') }}
|
|
{{ config('app.name', 'Perpus') }}.</span>
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const sidebar = document.getElementById('sidebar');
|
|
const mainWrapper = document.querySelector('.main-wrapper');
|
|
const overlay = document.getElementById('overlay');
|
|
const sidebarToggle = document.getElementById('sidebarToggle');
|
|
const closeSidebarMobile = document.getElementById('closeSidebarMobile');
|
|
const isDesktop = () => window.innerWidth >= 992;
|
|
|
|
function toggleMobileSidebar() {
|
|
sidebar.classList.toggle('active');
|
|
overlay.classList.toggle('active');
|
|
}
|
|
|
|
function toggleDesktopSidebar() {
|
|
sidebar.classList.toggle('minimized');
|
|
mainWrapper.classList.toggle('sidebar-minimized');
|
|
}
|
|
|
|
sidebarToggle.addEventListener('click', function() {
|
|
if (isDesktop()) {
|
|
toggleDesktopSidebar();
|
|
} else {
|
|
toggleMobileSidebar();
|
|
}
|
|
});
|
|
|
|
const closeButtons = [overlay, closeSidebarMobile];
|
|
closeButtons.forEach(el => {
|
|
if (el) {
|
|
el.addEventListener('click', function() {
|
|
if (!isDesktop()) {
|
|
toggleMobileSidebar();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
@stack('scripts')
|
|
</body>
|
|
|
|
</html>
|