716 lines
24 KiB
HTML
716 lines
24 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Vista Glass UI Components</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 25%, #4a90e2 50%, #7bb3f0 75%, #a8d0f0 100%);
|
|
min-height: 100vh;
|
|
padding: 80px 20px 40px 20px;
|
|
position: relative;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
body::before {
|
|
content: '';
|
|
position: fixed;
|
|
top: -50%;
|
|
left: -50%;
|
|
width: 200%;
|
|
height: 200%;
|
|
background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
|
|
radial-gradient(circle at 70% 80%, rgba(173,216,230,0.2) 0%, transparent 50%),
|
|
radial-gradient(circle at 20% 70%, rgba(135,206,235,0.15) 0%, transparent 50%);
|
|
animation: aurora 20s ease-in-out infinite;
|
|
pointer-events: none;
|
|
z-index: -1;
|
|
}
|
|
|
|
@keyframes aurora {
|
|
0%, 100% { transform: rotate(0deg) scale(1); }
|
|
33% { transform: rotate(120deg) scale(1.1); }
|
|
66% { transform: rotate(240deg) scale(0.9); }
|
|
}
|
|
|
|
.container {
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
|
gap: 30px;
|
|
padding: 20px;
|
|
}
|
|
|
|
.glass-panel {
|
|
background: rgba(255, 255, 255, 0.15);
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
border-radius: 8px;
|
|
padding: 25px;
|
|
box-shadow:
|
|
0 8px 32px rgba(0, 0, 0, 0.3),
|
|
inset 0 1px 0 rgba(255, 255, 255, 0.3);
|
|
position: relative;
|
|
overflow: visible;
|
|
}
|
|
|
|
.glass-panel::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 1px;
|
|
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
|
|
}
|
|
|
|
.glass-panel h3 {
|
|
color: #fff;
|
|
margin-bottom: 20px;
|
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
|
font-weight: 300;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.top-bar {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
background: rgba(255, 255, 255, 0.15);
|
|
backdrop-filter: blur(10px);
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
|
z-index: 1000;
|
|
padding: 0 20px;
|
|
height: 60px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.top-bar::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 1px;
|
|
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
|
|
}
|
|
|
|
.top-bar-logo {
|
|
color: #fff;
|
|
font-size: 18px;
|
|
font-weight: 300;
|
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.chart-container {
|
|
position: relative;
|
|
height: 280px;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.chart-svg {
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: visible;
|
|
}
|
|
|
|
.chart-bar {
|
|
fill: url(#barGradient);
|
|
stroke: rgba(255, 255, 255, 0.3);
|
|
stroke-width: 1;
|
|
opacity: 0.8;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.chart-bar:hover {
|
|
opacity: 1;
|
|
filter: brightness(1.1);
|
|
}
|
|
|
|
.chart-line {
|
|
fill: none;
|
|
stroke: #fff;
|
|
stroke-width: 2;
|
|
stroke-linecap: round;
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.chart-point {
|
|
fill: #fff;
|
|
stroke: #4a90e2;
|
|
stroke-width: 2;
|
|
r: 4;
|
|
opacity: 0.8;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.chart-point:hover {
|
|
r: 6;
|
|
opacity: 1;
|
|
}
|
|
|
|
.chart-axis {
|
|
stroke: rgba(255, 255, 255, 0.3);
|
|
stroke-width: 1;
|
|
}
|
|
|
|
.chart-label {
|
|
fill: rgba(255, 255, 255, 0.8);
|
|
font-size: 11px;
|
|
text-anchor: middle;
|
|
font-family: 'Segoe UI', sans-serif;
|
|
}
|
|
|
|
.loading-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 25px;
|
|
align-items: center;
|
|
}
|
|
|
|
.loading-spinner {
|
|
width: 40px;
|
|
height: 40px;
|
|
border: 3px solid rgba(255, 255, 255, 0.3);
|
|
border-top: 3px solid #fff;
|
|
border-radius: 50%;
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
|
|
.loading-dots {
|
|
display: flex;
|
|
gap: 8px;
|
|
}
|
|
|
|
.loading-dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: #fff;
|
|
animation: bounce 1.4s ease-in-out infinite both;
|
|
}
|
|
|
|
.loading-dot:nth-child(1) { animation-delay: -0.32s; }
|
|
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
|
|
.loading-dot:nth-child(3) { animation-delay: 0s; }
|
|
|
|
@keyframes bounce {
|
|
0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
|
|
40% { transform: scale(1.2); opacity: 1; }
|
|
}
|
|
|
|
.loading-bar {
|
|
width: 200px;
|
|
height: 6px;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
border-radius: 3px;
|
|
overflow: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
.loading-bar-fill {
|
|
height: 100%;
|
|
background: linear-gradient(90deg, #4a90e2, #7bb3f0);
|
|
border-radius: 3px;
|
|
position: absolute;
|
|
left: -100%;
|
|
animation: progress 2s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes progress {
|
|
0% { left: -100%; width: 0%; }
|
|
50% { left: 0%; width: 100%; }
|
|
100% { left: 100%; width: 0%; }
|
|
}
|
|
|
|
.loading-pulse {
|
|
width: 60px;
|
|
height: 60px;
|
|
border-radius: 50%;
|
|
background: rgba(255, 255, 255, 0.3);
|
|
animation: pulse 1.5s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes pulse {
|
|
0% { transform: scale(0.8); opacity: 1; }
|
|
50% { transform: scale(1.2); opacity: 0.3; }
|
|
100% { transform: scale(0.8); opacity: 1; }
|
|
}
|
|
|
|
.slider-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 20px;
|
|
}
|
|
|
|
.slider-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
|
|
.slider-label {
|
|
color: rgba(255, 255, 255, 0.9);
|
|
font-size: 13px;
|
|
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.slider {
|
|
appearance: none;
|
|
width: 100%;
|
|
height: 6px;
|
|
border-radius: 3px;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
outline: none;
|
|
position: relative;
|
|
border: none;
|
|
}
|
|
|
|
.slider::-webkit-slider-thumb {
|
|
appearance: none;
|
|
width: 18px;
|
|
height: 18px;
|
|
border-radius: 50%;
|
|
background: linear-gradient(180deg, #fff 0%, #e0e0e0 100%);
|
|
cursor: pointer;
|
|
border: 2px solid rgba(255, 255, 255, 0.8);
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.slider::-webkit-slider-thumb:hover {
|
|
transform: scale(1.1);
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
|
|
}
|
|
|
|
.slider::-moz-range-thumb {
|
|
width: 18px;
|
|
height: 18px;
|
|
border-radius: 50%;
|
|
background: linear-gradient(180deg, #fff 0%, #e0e0e0 100%);
|
|
cursor: pointer;
|
|
border: 2px solid rgba(255, 255, 255, 0.8);
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.slider::-moz-range-thumb:hover {
|
|
transform: scale(1.1);
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
|
|
}
|
|
|
|
.slider::-moz-range-track {
|
|
height: 6px;
|
|
border-radius: 3px;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
border: none;
|
|
}
|
|
|
|
.slider-value {
|
|
color: #fff;
|
|
font-size: 12px;
|
|
text-align: right;
|
|
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.toggle-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 20px;
|
|
}
|
|
|
|
.toggle-group {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.toggle-label {
|
|
color: rgba(255, 255, 255, 0.9);
|
|
font-size: 13px;
|
|
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.toggle-switch {
|
|
position: relative;
|
|
width: 50px;
|
|
height: 24px;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
border-radius: 12px;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
}
|
|
|
|
.toggle-switch.active {
|
|
background: linear-gradient(180deg, #4a90e2 0%, #2a5298 100%);
|
|
border-color: #4a90e2;
|
|
}
|
|
|
|
.toggle-knob {
|
|
position: absolute;
|
|
top: 2px;
|
|
left: 2px;
|
|
width: 18px;
|
|
height: 18px;
|
|
background: linear-gradient(180deg, #fff 0%, #e0e0e0 100%);
|
|
border-radius: 50%;
|
|
transition: all 0.3s ease;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
.toggle-switch.active .toggle-knob {
|
|
transform: translateX(26px);
|
|
}
|
|
|
|
.search-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 20px;
|
|
}
|
|
|
|
.search-box {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.search-input {
|
|
width: 100%;
|
|
padding: 12px 16px 12px 40px;
|
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
border-radius: 6px;
|
|
background: rgba(255, 255, 255, 0.9);
|
|
font-size: 14px;
|
|
transition: all 0.3s ease;
|
|
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.search-input:focus {
|
|
outline: none;
|
|
border-color: #4a90e2;
|
|
box-shadow:
|
|
inset 0 1px 3px rgba(0, 0, 0, 0.1),
|
|
0 0 8px rgba(74, 144, 226, 0.6);
|
|
}
|
|
|
|
.search-icon {
|
|
position: absolute;
|
|
left: 12px;
|
|
width: 16px;
|
|
height: 16px;
|
|
opacity: 0.6;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.search-results {
|
|
background: rgba(255, 255, 255, 0.9);
|
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
border-radius: 6px;
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
display: none;
|
|
}
|
|
|
|
.search-results.show {
|
|
display: block;
|
|
}
|
|
|
|
.search-result-item {
|
|
padding: 12px 16px;
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
cursor: pointer;
|
|
transition: background 0.2s ease;
|
|
color: #333;
|
|
}
|
|
|
|
.search-result-item:hover {
|
|
background: rgba(74, 144, 226, 0.1);
|
|
}
|
|
|
|
.search-result-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.search-filters {
|
|
display: flex;
|
|
gap: 10px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.filter-btn {
|
|
background: rgba(255, 255, 255, 0.2);
|
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
border-radius: 4px;
|
|
padding: 6px 12px;
|
|
color: #fff;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.filter-btn:hover {
|
|
background: rgba(255, 255, 255, 0.3);
|
|
}
|
|
|
|
.filter-btn.active {
|
|
background: linear-gradient(180deg, #4a90e2 0%, #2a5298 100%);
|
|
border-color: #4a90e2;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.container {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.chart-container {
|
|
height: 200px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="top-bar">
|
|
<div class="top-bar-logo">More stuff</div>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<div class="glass-panel">
|
|
<h3>Charts & Graphs</h3>
|
|
<div class="chart-container">
|
|
<svg class="chart-svg" viewBox="0 0 400 200">
|
|
<defs>
|
|
<linearGradient id="barGradient" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
<stop offset="0%" style="stop-color:#7bb3f0;stop-opacity:1" />
|
|
<stop offset="100%" style="stop-color:#4a90e2;stop-opacity:1" />
|
|
</linearGradient>
|
|
</defs>
|
|
|
|
<g id="barChart">
|
|
<rect class="chart-bar" x="40" y="120" width="30" height="60" />
|
|
<rect class="chart-bar" x="80" y="100" width="30" height="80" />
|
|
<rect class="chart-bar" x="120" y="80" width="30" height="100" />
|
|
<rect class="chart-bar" x="160" y="90" width="30" height="90" />
|
|
<rect class="chart-bar" x="200" y="70" width="30" height="110" />
|
|
|
|
<text class="chart-label" x="55" y="195">Jan</text>
|
|
<text class="chart-label" x="95" y="195">Feb</text>
|
|
<text class="chart-label" x="135" y="195">Mar</text>
|
|
<text class="chart-label" x="175" y="195">Apr</text>
|
|
<text class="chart-label" x="215" y="195">May</text>
|
|
</g>
|
|
|
|
<g id="lineChart" style="display:none;">
|
|
<polyline class="chart-line" points="50,150 90,120 130,90 170,110 210,80 250,100"/>
|
|
<circle class="chart-point" cx="50" cy="150" />
|
|
<circle class="chart-point" cx="90" cy="120" />
|
|
<circle class="chart-point" cx="130" cy="90" />
|
|
<circle class="chart-point" cx="170" cy="110" />
|
|
<circle class="chart-point" cx="210" cy="80" />
|
|
<circle class="chart-point" cx="250" cy="100" />
|
|
</g>
|
|
|
|
<line class="chart-axis" x1="30" y1="20" x2="30" y2="180" />
|
|
<line class="chart-axis" x1="30" y1="180" x2="370" y2="180" />
|
|
</svg>
|
|
</div>
|
|
<div style="display: flex; gap: 10px; justify-content: center;">
|
|
<button class="filter-btn active" onclick="toggleChart('bar')">Bar Chart</button>
|
|
<button class="filter-btn" onclick="toggleChart('line')">Line Chart</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="glass-panel">
|
|
<h3>Loading Animations</h3>
|
|
<div class="loading-container">
|
|
<div class="loading-spinner"></div>
|
|
<div class="loading-dots">
|
|
<div class="loading-dot"></div>
|
|
<div class="loading-dot"></div>
|
|
<div class="loading-dot"></div>
|
|
</div>
|
|
<div class="loading-bar">
|
|
<div class="loading-bar-fill"></div>
|
|
</div>
|
|
<div class="loading-pulse"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="glass-panel">
|
|
<h3>Slider Controls</h3>
|
|
<div class="slider-container">
|
|
<div class="slider-group">
|
|
<div style="display: flex; justify-content: space-between;">
|
|
<span class="slider-label">Volume</span>
|
|
<span class="slider-value" id="volumeValue">50</span>
|
|
</div>
|
|
<input type="range" min="0" max="100" value="50" class="slider" id="volumeSlider">
|
|
</div>
|
|
<div class="slider-group">
|
|
<div style="display: flex; justify-content: space-between;">
|
|
<span class="slider-label">Brightness</span>
|
|
<span class="slider-value" id="brightnessValue">75</span>
|
|
</div>
|
|
<input type="range" min="0" max="100" value="75" class="slider" id="brightnessSlider">
|
|
</div>
|
|
<div class="slider-group">
|
|
<div style="display: flex; justify-content: space-between;">
|
|
<span class="slider-label">Transparency</span>
|
|
<span class="slider-value" id="transparencyValue">25</span>
|
|
</div>
|
|
<input type="range" min="0" max="100" value="25" class="slider" id="transparencySlider">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="glass-panel">
|
|
<h3>Toggle Switches</h3>
|
|
<div class="toggle-container">
|
|
<div class="toggle-group">
|
|
<span class="toggle-label">Toggle</span>
|
|
<div class="toggle-switch active" onclick="toggleSwitch(this)">
|
|
<div class="toggle-knob"></div>
|
|
</div>
|
|
</div>
|
|
<div class="toggle-group">
|
|
<span class="toggle-label">Toggle</span>
|
|
<div class="toggle-switch" onclick="toggleSwitch(this)">
|
|
<div class="toggle-knob"></div>
|
|
</div>
|
|
</div>
|
|
<div class="toggle-group">
|
|
<span class="toggle-label">Toggle</span>
|
|
<div class="toggle-switch active" onclick="toggleSwitch(this)">
|
|
<div class="toggle-knob"></div>
|
|
</div>
|
|
</div>
|
|
<div class="toggle-group">
|
|
<span class="toggle-label">Toggle</span>
|
|
<div class="toggle-switch" onclick="toggleSwitch(this)">
|
|
<div class="toggle-knob"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="glass-panel">
|
|
<h3>Search Interface</h3>
|
|
<div class="search-container">
|
|
<div class="search-box">
|
|
<svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor">
|
|
<circle cx="11" cy="11" r="8"></circle>
|
|
<path d="m21 21-4.35-4.35"></path>
|
|
</svg>
|
|
<input type="text" class="search-input" placeholder="Search..." id="searchInput">
|
|
</div>
|
|
<div class="search-results" id="searchResults">
|
|
<div class="search-result-item">Placeholder</div>
|
|
<div class="search-result-item">Placeholder</div>
|
|
<div class="search-result-item">Placeholder</div>
|
|
<div class="search-result-item">Placeholder</div>
|
|
<div class="search-result-item">Placeholder</div>
|
|
</div>
|
|
<div class="search-filters">
|
|
<button class="filter-btn active" onclick="toggleFilter(this)">All</button>
|
|
<button class="filter-btn" onclick="toggleFilter(this)">temp</button>
|
|
<button class="filter-btn" onclick="toggleFilter(this)">temp</button>
|
|
<button class="filter-btn" onclick="toggleFilter(this)">temp</button>
|
|
<button class="filter-btn" onclick="toggleFilter(this)">temp</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function toggleChart(type) {
|
|
const barChart = document.getElementById('barChart');
|
|
const lineChart = document.getElementById('lineChart');
|
|
const buttons = document.querySelectorAll('.filter-btn');
|
|
|
|
buttons.forEach(btn => btn.classList.remove('active'));
|
|
|
|
if (type === 'bar') {
|
|
barChart.style.display = 'block';
|
|
lineChart.style.display = 'none';
|
|
event.target.classList.add('active');
|
|
} else {
|
|
barChart.style.display = 'none';
|
|
lineChart.style.display = 'block';
|
|
event.target.classList.add('active');
|
|
}
|
|
}
|
|
|
|
function updateSlider(sliderId, valueId) {
|
|
const slider = document.getElementById(sliderId);
|
|
const value = document.getElementById(valueId);
|
|
|
|
slider.addEventListener('input', function() {
|
|
value.textContent = this.value;
|
|
});
|
|
}
|
|
|
|
updateSlider('volumeSlider', 'volumeValue');
|
|
updateSlider('brightnessSlider', 'brightnessValue');
|
|
updateSlider('transparencySlider', 'transparencyValue');
|
|
|
|
function toggleSwitch(element) {
|
|
element.classList.toggle('active');
|
|
}
|
|
|
|
const searchInput = document.getElementById('searchInput');
|
|
const searchResults = document.getElementById('searchResults');
|
|
|
|
searchInput.addEventListener('focus', function() {
|
|
searchResults.classList.add('show');
|
|
});
|
|
|
|
searchInput.addEventListener('input', function() {
|
|
if (this.value.trim() === '') {
|
|
searchResults.classList.remove('show');
|
|
} else {
|
|
searchResults.classList.add('show');
|
|
}
|
|
});
|
|
|
|
document.addEventListener('click', function(event) {
|
|
if (!event.target.closest('.search-box') && !event.target.closest('.search-results')) {
|
|
searchResults.classList.remove('show');
|
|
}
|
|
});
|
|
|
|
function toggleFilter(element) {
|
|
document.querySelectorAll('.search-filters .filter-btn').forEach(btn => {
|
|
btn.classList.remove('active');
|
|
});
|
|
element.classList.add('active');
|
|
}
|
|
|
|
document.querySelectorAll('.search-result-item').forEach(item => {
|
|
item.addEventListener('click', function() {
|
|
searchInput.value = this.textContent;
|
|
searchResults.classList.remove('show');
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |