1. Project Overview & Features
The Glassmorphic Floating Settings & Sidebar is an essential frontend project designed to help you bridge the gap between learning JavaScript syntax and building interactive, responsive web applications.
Key Features Implemented:
- Compact vertical icon navigation pill with smooth glowing hover states
- Expandable frosted glass Settings card with blur and glowing purple ambient background
- Interactive instant search bar for settings items
- Live functional toggle switches for Wi-Fi, Dark Mode, Notifications, Battery
- Smooth slide-in drawer and active tab indicators
2. Step-by-Step Code Walkthrough
A Step 1: Semantic HTML Structure
We structure the interface using clean, semantic HTML elements. This ensures maximum accessibility and provides intuitive hooks for CSS classes and JavaScript query selectors.
<div class="glass-viewport">
<div class="ambient-glow glow-1"></div>
<div class="ambient-glow glow-2"></div>
<div class="glass-app-layout">
<!-- Expandable Settings Panel Card -->
<div class="settings-glass-card" id="settings-card">
<div class="card-header">
<h2>Settings</h2>
<button id="close-drawer-btn" class="icon-btn-close" title="Close Panel"><i class="fas fa-times"></i></button>
</div>
<!-- Search Input -->
<div class="settings-search">
<i class="fas fa-search"></i>
<input type="text" id="settings-search-input" placeholder="Search settings (e.g., wifi, battery)..." autocomplete="off">
</div>
<!-- Settings Items List -->
<div class="settings-list" id="settings-list">
<div class="setting-row" data-name="network internet wifi">
<div class="row-left">
<i class="fas fa-wifi"></i>
<span>Network & Internet</span>
</div>
<label class="switch">
<input type="checkbox" checked>
<span class="slider"></span>
</label>
</div>
<div class="setting-row" data-name="connected devices bluetooth">
<div class="row-left">
<i class="fas fa-desktop"></i>
<span>Connected Devices</span>
</div>
<i class="fas fa-chevron-right arrow-icon"></i>
</div>
<div class="setting-row" data-name="display dark mode brightness">
<div class="row-left">
<i class="fas fa-adjust"></i>
<span>Display & Dark Mode</span>
</div>
<label class="switch">
<input type="checkbox" checked id="darkmode-toggle">
<span class="slider"></span>
</label>
</div>
<div class="setting-row" data-name="notifications alerts">
<div class="row-left">
<i class="fas fa-bell"></i>
<span>Notifications</span>
</div>
<label class="switch">
<input type="checkbox" checked>
<span class="slider"></span>
</label>
</div>
<div class="setting-row" data-name="battery power saver">
<div class="row-left">
<i class="fas fa-battery-three-quarters"></i>
<span>Battery (84%)</span>
</div>
<span class="badge-status">Normal</span>
</div>
<div class="setting-row" data-name="storage memory disk">
<div class="row-left">
<i class="fas fa-hdd"></i>
<span>Storage (128 GB)</span>
</div>
<i class="fas fa-chevron-right arrow-icon"></i>
</div>
<div class="setting-row" data-name="location privacy gps">
<div class="row-left">
<i class="fas fa-map-marker-alt"></i>
<span>Location Services</span>
</div>
<label class="switch">
<input type="checkbox">
<span class="slider"></span>
</label>
</div>
<div class="setting-row" data-name="sound vibration volume">
<div class="row-left">
<i class="fas fa-volume-up"></i>
<span>Sound & Vibration</span>
</div>
<i class="fas fa-chevron-right arrow-icon"></i>
</div>
</div>
</div>
<!-- Compact Floating Icon Navigation Pill -->
<div class="sidebar-pill">
<button class="nav-icon-btn active" data-target="settings" title="Settings Menu"><i class="fas fa-bars"></i></button>
<button class="nav-icon-btn" title="Search"><i class="fas fa-search"></i></button>
<button class="nav-icon-btn" title="Wi-Fi"><i class="fas fa-wifi"></i></button>
<button class="nav-icon-btn" title="Devices"><i class="fas fa-desktop"></i></button>
<button class="nav-icon-btn" title="Display"><i class="fas fa-adjust"></i></button>
<button class="nav-icon-btn" title="Notifications"><i class="fas fa-bell"></i></button>
<button class="nav-icon-btn" title="Battery"><i class="fas fa-battery-half"></i></button>
<button class="nav-icon-btn" title="Storage"><i class="fas fa-hdd"></i></button>
<button class="nav-icon-btn" title="Volume"><i class="fas fa-volume-up"></i></button>
</div>
</div>
</div>B Step 2: Styling & Responsive CSS
Modern CSS flexbox and grid layouts are used to make the UI look polished, centered, and responsive across desktop, tablet, and mobile screens.
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body {
background: #090314;
color: #f8fafc;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
overflow-x: hidden;
}
.glass-viewport {
position: relative;
width: 100%;
max-width: 540px;
min-height: 600px;
display: flex;
align-items: center;
justify-content: center;
}
/* Ambient Glowing Background Orbs */
.ambient-glow {
position: absolute;
border-radius: 50%;
filter: blur(80px);
pointer-events: none;
z-index: 1;
}
.glow-1 {
width: 250px;
height: 250px;
background: #7c3aed;
top: 10%;
left: 5%;
opacity: 0.5;
}
.glow-2 {
width: 220px;
height: 220px;
background: #ec4899;
bottom: 10%;
right: 10%;
opacity: 0.4;
}
.glass-app-layout {
display: flex;
gap: 16px;
align-items: flex-start;
position: relative;
z-index: 5;
width: 100%;
}
/* Frosted Glass Settings Card */
.settings-glass-card {
flex: 1;
background: rgba(255, 255, 255, 0.07);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 28px;
padding: 24px;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.settings-glass-card.collapsed {
opacity: 0;
transform: translateX(-20px) scale(0.95);
pointer-events: none;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 18px;
}
.card-header h2 {
font-size: 1.5rem;
font-weight: 800;
color: #ffffff;
}
.icon-btn-close {
background: transparent;
border: none;
color: #94a3b8;
font-size: 1rem;
cursor: pointer;
}
.settings-search {
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 14px;
padding: 10px 14px;
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 18px;
}
.settings-search i { color: #94a3b8; font-size: 0.9rem; }
.settings-search input {
flex: 1;
background: transparent;
border: none;
color: #f8fafc;
font-size: 0.9rem;
outline: none;
}
.settings-list {
display: flex;
flex-direction: column;
gap: 6px;
max-height: 380px;
overflow-y: auto;
}
.setting-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 14px;
border-radius: 14px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid transparent;
transition: all 0.2s;
}
.setting-row:hover {
background: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.1);
}
.row-left {
display: flex;
align-items: center;
gap: 12px;
font-size: 0.92rem;
font-weight: 500;
}
.row-left i {
width: 20px;
color: #c084fc;
}
.arrow-icon { color: #64748b; font-size: 0.8rem; }
.badge-status {
background: rgba(192, 132, 252, 0.18);
color: #c084fc;
font-size: 0.75rem;
font-weight: 700;
padding: 3px 8px;
border-radius: 6px;
}
/* Compact Floating Sidebar Pill */
.sidebar-pill {
background: rgba(255, 255, 255, 0.08);
backdrop-filter: blur(24px);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 40px;
padding: 12px 6px;
display: flex;
flex-direction: column;
gap: 10px;
box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}
.nav-icon-btn {
width: 40px;
height: 40px;
border-radius: 50%;
border: none;
background: transparent;
color: #94a3b8;
font-size: 1rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.nav-icon-btn:hover {
color: #ffffff;
background: rgba(255, 255, 255, 0.1);
}
.nav-icon-btn.active {
background: rgba(192, 132, 252, 0.3);
color: #ffffff;
box-shadow: 0 0 15px rgba(192, 132, 252, 0.5);
}
/* Glass Toggle Switch */
.switch {
position: relative;
display: inline-block;
width: 40px;
height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
position: absolute;
cursor: pointer;
inset: 0;
background-color: rgba(255, 255, 255, 0.15);
transition: .3s;
border-radius: 22px;
}
.slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 3px;
bottom: 3px;
background-color: white;
transition: .3s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #a855f7;
}
input:checked + .slider:before {
transform: translateX(18px);
}C Step 3: JavaScript Logic & Event Handling
Here is the complete JavaScript code handling the state, event listeners, mathematical logic, and dynamic DOM rendering:
const searchInput = document.getElementById('settings-search-input');
const settingRows = document.querySelectorAll('.setting-row');
const settingsCard = document.getElementById('settings-card');
const closeBtn = document.getElementById('close-drawer-btn');
const navBtns = document.querySelectorAll('.nav-icon-btn');
// Live Real-Time Search Filter
searchInput.addEventListener('input', (e) => {
const query = e.target.value.trim().toLowerCase();
settingRows.forEach(row => {
const name = row.getAttribute('data-name');
if (!query || name.includes(query)) {
row.style.display = 'flex';
} else {
row.style.display = 'none';
}
});
});
// Toggle Drawer from compact sidebar
navBtns.forEach(btn => {
btn.addEventListener('click', () => {
navBtns.forEach(b => b.classList.remove('active'));
btn.classList.add('active');
settingsCard.classList.remove('collapsed');
});
});
closeBtn.addEventListener('click', () => {
settingsCard.classList.add('collapsed');
});3. Core JavaScript Concepts You Learned
Crucial concept utilized to power the dynamic state, user interactions, and styling of this project.
Crucial concept utilized to power the dynamic state, user interactions, and styling of this project.
Crucial concept utilized to power the dynamic state, user interactions, and styling of this project.
Crucial concept utilized to power the dynamic state, user interactions, and styling of this project.
Crucial concept utilized to power the dynamic state, user interactions, and styling of this project.
4. How to Run Locally on Your Computer
- Download the project ZIP: Click the Download Project (.ZIP) button at the top or in the live runner to save
glassmorphic-settings-nav-project.zip. - Extract the archive: Unzip the downloaded file. Inside you will find separate
index.html,style.css,script.js,index-standalone.html, and a comprehensiveREADME.md. - Open in any browser: Simply double-click
index.html(orindex-standalone.html) to open and test immediately in Chrome, Firefox, Safari, or Edge. - Edit in Visual Studio Code: Open the extracted folder in VS Code. Right-click
index.htmland select "Open with Live Server" to enjoy instant live reloading as you modify HTML, CSS, or JS!
Bonus Challenges for Learners
Ready to level up? Try adding these extra features on your own:
- Add sound effects or audio feedback for user button clicks.
- Add custom theme color customizer with CSS variables.
- Export the results to PDF or copy as a formatted text summary.