Fixes sidebar sliding

main
Yasen Pramatarov 2024-08-05 17:02:35 +03:00
parent ca95f3c27e
commit b6fc4a995d
4 changed files with 10 additions and 8 deletions

View File

@ -121,15 +121,16 @@
border: 1px solid gray;
}
/* collapsing sidebar */
.sidebar-wrapper {
width: 250px; /* Default width of the sidebar */
transition: width 0.3s; /* Smooth transition for collapsing */
overflow-x: hidden; /* Hide horizontal scrollbar */
width: 250px;
transition: width 0.5s ease;
overflow-x: hidden;
}
.sidebar-wrapper.collapsed {
width: 0; /* Collapsed width */
width: 2em;
}
.sidebar-content {
width: 250px; /* Keep content width for centering */
width: 250px;
}

View File

@ -9,9 +9,11 @@
</div>
<script>
// slide the sidebar to the left instead of default up
document.getElementById('toggleSidebarButton').addEventListener('click', function () {
document.getElementById('sidebar').classList.toggle('collapsed');
});
</script>
</body>

View File

@ -5,7 +5,6 @@
<button class="btn btn-primary mb-3" type="button" id="toggleSidebarButton">
sidebar
</button>
<li><a href="index.php">home</a></li>
<?php if ( isset($_SESSION['username']) ) { ?>
<li><a href="?page=config">config</a></li>

View File

@ -13,6 +13,6 @@
<!-- /Sidebar -->
<div class="col-md-9">
<div class="col-md-9" id="main-content">
<!-- Main content -->