base_ui/components/admin/components/AdminSidebar.vue
2025-02-20 09:52:41 +03:30

198 lines
4.2 KiB
Vue

<template>
<div class="wrapper">
<!-- Sidebar -->
<nav id="sidebar" :class="{'expanded active' : isSidebarCollapsed}">
<div class="sidebar-header">
<!-- <h3>Bootstrap Sidebar</h3> -->
<strong>BS</strong>
</div>
<ul class="list-unstyled components">
<li class="active">
<a href="#homeSubmenu" data-bs-toggle="collapse" aria-expanded="false" class="dropdown-toggle">
<i class="fas fa-home"></i>
Home
</a>
<ul class="collapse list-unstyled" id="homeSubmenu">
<li>
<a href="#">Home 1</a>
</li>
<li>
<a href="#">Home 2</a>
</li>
<li>
<a href="#">Home 3</a>
</li>
</ul>
</li>
<li>
<a href="#">
<i class="fas fa-briefcase"></i>
About
</a>
<a href="#pageSubmenu" data-bs-toggle="collapse" aria-expanded="false" class="dropdown-toggle">
<i class="fas fa-copy"></i>
Pages
</a>
<ul class="collapse list-unstyled" id="pageSubmenu">
<li>
<a href="#">Page 1</a>
</li>
<li>
<a href="#">Page 2</a>
</li>
<li>
<a href="#">Page 3</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
</template>
<script>
import { mapState } from "pinia";
export default {
props: ["currentMode", "menu"],
data() {
return {
topico: [],
botico: [],
};
},
computed: {
...mapState(["isSidebarCollapsed"])
},
methods: {
toggleSidebarMenu() {
this.$store.commit('TOGGLE_SIDEBAR_MENU')
}
},
};
</script>
<style scoped lang="scss">
/* Shrinking the sidebar from 250px to 80px and center aligining its content*/
#sidebar.active {
min-width: 80px;
max-width: 80px;
text-align: center;
}
/* Toggling the sidebar header content, hide the big heading [h3] and showing the small heading [strong] and vice versa*/
#sidebar .sidebar-header strong {
display: none;
}
#sidebar.active .sidebar-header h3 {
display: none;
}
#sidebar.active .sidebar-header strong {
display: block;
}
#sidebar ul li a {
text-align: left;
}
#sidebar.active ul li a {
padding: 20px 10px;
text-align: center;
font-size: 0.85em;
}
#sidebar.active ul li a i {
margin-right: 0;
display: block;
font-size: 1.8em;
margin-bottom: 5px;
}
/* Same dropdown links padding*/
#sidebar.active ul ul a {
padding: 10px !important;
}
/* Changing the arrow position to bottom center position,
translateX(50%) works with right: 50%
to accurately center the arrow */
#sidebar.active .dropdown-toggle::after {
top: auto;
bottom: 10px;
right: 50%;
-webkit-transform: translateX(50%);
-ms-transform: translateX(50%);
transform: translateX(50%);
}
@media (max-width: 768px) {
/* 80px and its content aligned to centre. Pushing it off the screen with the
negative left margin
*/
#sidebar.active {
min-width: 80px;
max-width: 80px;
text-align: center;
margin-left: -80px !important;
}
/* Reappearing the sidebar on toggle button click */
#sidebar {
margin-left: 0;
}
/* Toggling the sidebar header content,
hide the big heading [h3] and showing the small heading [strong] and vice versa
*/
#sidebar .sidebar-header strong {
display: none;
}
#sidebar.active .sidebar-header h3 {
display: none;
}
#sidebar.active .sidebar-header strong {
display: block;
}
/* Downsize the navigation links font size */
#sidebar.active ul li a {
padding: 20px 10px;
font-size: 0.85em;
}
#sidebar.active ul li a i {
margin-right: 0;
display: block;
font-size: 1.8em;
margin-bottom: 5px;
}
/* Adjust the dropdown links padding*/
#sidebar.active ul ul a {
padding: 10px !important;
}
/* Changing the arrow position to bottom center position,
translateX(50%) works with right: 50%
to accurately center the arrow */
.dropdown-toggle::after {
top: auto;
bottom: 10px;
right: 50%;
-webkit-transform: translateX(50%);
-ms-transform: translateX(50%);
transform: translateX(50%);
}
}
</style>