Add sidebar menu with toggle functionality
This commit is contained in:
1 parent
64657054e1
commit
bed9811a77
1 file changed
+30
-4
+30
-4
@@ -24,6 +24,28 @@
|
||||
color: var(--text-color);
|
||||
transition: background-color 0.3s, color 0.3s;
|
||||
}
|
||||
.side-bar-menu {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: -250px;
|
||||
width: 250px;
|
||||
height: 100%;
|
||||
background-color: var(--card-background-color);
|
||||
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
|
||||
overflow-y: auto;
|
||||
transition: left 0.3s ease;
|
||||
z-index: 1000;
|
||||
}
|
||||
.side-bar-menu.open {
|
||||
left: 0;
|
||||
}
|
||||
.side-bar-close-button {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
margin: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -47,10 +69,8 @@
|
||||
<a class="nav-item" href="/Contact.html">Bug Report</a>
|
||||
<a class="nav-item" href="/Contact.html">Suggesting</a>
|
||||
<a class="nav-item" href="/setting.html">⚙️Settings</a>
|
||||
<a class="nav-item" href=""></a>
|
||||
<a class="nav-item" href=""></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main-content" style="overflow-y:scroll;">
|
||||
</div>
|
||||
@@ -58,7 +78,7 @@
|
||||
<div class="non-sidebar-content">
|
||||
<h2>Additional Content</h2>
|
||||
<p>This area is for content that won't be in the sidebar.</p>
|
||||
<a href="/WebGames-master/WebGames-master/index.html">Games</a>>
|
||||
<a href="/WebGames-master/WebGames-master/index.html">Games</a>
|
||||
<img src="/images1.png" alt="deez nuts" width="150" height="150"></a>
|
||||
</div>
|
||||
<!-- empty main page -->
|
||||
@@ -108,6 +128,12 @@
|
||||
// Apply saved dark mode preference on load
|
||||
const darkModeEnabled = getCookie('darkMode') === 'true';
|
||||
applyDarkMode(darkModeEnabled);
|
||||
|
||||
// Toggle sidebar
|
||||
function toggleSideBar() {
|
||||
const sideBarMenu = document.getElementById('side-bar-menu');
|
||||
sideBarMenu.classList.toggle('open');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in new issue
Block a user