Class_Of_Learners / Database_Logic.html
NeelAniGamer's picture
Updated favicons, dark mode logo, and completely resolved large files via LFS
a4fb0f8
Raw
History Blame Contribute Delete
28.4 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Driving the Future: Traffic Education Matters - Deep Access Edition</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Outfit:wght@300;400;600;800&display=swap');
:root {
--bg-color: #030305;
--panel-bg: rgba(10, 12, 16, 0.7);
--panel-border: rgba(255, 255, 255, 0.05);
--text-main: #f0f4f8;
--text-muted: #8b92a5;
--accent-primary: #00ffcc;
--neon-red: #ff3366;
--neon-amber: #ffcc00;
--neon-green: #00ffcc;
--neon-blue: #0088ff;
--neon-purple: #b026ff;
--neon-cyan: #00ffff;
--transition-speed: 0.4s;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: var(--bg-color);
color: var(--text-main);
font-family: 'Outfit', sans-serif;
overflow-x: hidden;
line-height: 1.6;
}
h1,
h2,
h3,
h4,
.mono {
font-family: 'JetBrains Mono', monospace;
}
#webgl-canvas {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: -1;
opacity: 0.8;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 0 40px;
}
.tech-panel {
background: var(--panel-bg);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid var(--panel-border);
border-radius: 8px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
position: relative;
overflow: hidden;
}
.tech-panel::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 1px;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}
section {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
padding: 120px 0;
position: relative;
}
.fade-in {
opacity: 0;
transform: translateY(30px);
transition:
opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-in.visible {
opacity: 1;
transform: translateY(0);
}
/* Hero */
.hero {
align-items: flex-start;
text-align: left;
}
.hero-badge {
display: inline-block;
padding: 6px 12px;
background: rgba(0, 255, 204, 0.1);
color: var(--accent-primary);
border: 1px solid rgba(0, 255, 204, 0.3);
border-radius: 4px;
font-size: 0.85rem;
font-family: 'JetBrains Mono', monospace;
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: 24px;
}
.hero h1 {
font-size: clamp(3rem, 7vw, 6.5rem);
font-weight: 800;
margin-bottom: 30px;
line-height: 1.05;
letter-spacing: -2px;
text-transform: uppercase;
}
.hero h1 span {
display: block;
background: linear-gradient(90deg, #ffffff, var(--text-muted));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.hero h1 .highlight {
background: linear-gradient(90deg, var(--accent-primary), var(--neon-blue));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.hero p {
font-size: clamp(1.1rem, 1.5vw, 1.4rem);
color: var(--text-muted);
margin-bottom: 50px;
max-width: 650px;
font-weight: 300;
}
.btn {
display: inline-flex;
align-items: center;
gap: 12px;
padding: 18px 40px;
font-size: 1.1rem;
font-family: 'JetBrains Mono', monospace;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--bg-color);
background: var(--accent-primary);
border: none;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
transition: all 0.3s ease;
box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
}
.btn:hover {
box-shadow: 0 0 30px rgba(0, 255, 204, 0.5);
transform: translateY(-2px);
}
.content-block {
padding: 80px;
margin-bottom: 40px;
}
.content-block h2 {
font-size: 3rem;
margin-bottom: 30px;
text-transform: uppercase;
letter-spacing: -1px;
}
.content-block h2 span {
color: var(--accent-primary);
}
.content-block p {
font-size: 1.25rem;
color: var(--text-muted);
margin-bottom: 24px;
font-weight: 300;
max-width: 900px;
}
.section-header {
margin-bottom: 60px;
}
.section-header h2 {
font-size: 3rem;
text-transform: uppercase;
letter-spacing: -1px;
}
.section-header .subtitle {
font-family: 'JetBrains Mono', monospace;
color: var(--accent-primary);
font-size: 1rem;
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: 10px;
display: block;
}
.tier-header {
width: 100%;
padding: 15px 0;
margin: 40px 0 20px;
border-bottom: 1px solid var(--panel-border);
font-family: 'JetBrains Mono', monospace;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 2px;
font-size: 1.2rem;
grid-column: 1 / -1;
}
.modules-grid {
display: grid;
grid-template-columns: 1fr;
gap: 24px;
}
@media (min-width: 768px) {
.modules-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (min-width: 1024px) {
.modules-grid {
grid-template-columns: repeat(3, 1fr);
}
}
/* Module Cards */
.module-card {
padding: 40px;
cursor: pointer;
transition: all var(--transition-speed) ease;
position: relative;
border: 1px solid var(--panel-border);
display: flex;
flex-direction: column;
height: 100%;
background: var(--panel-bg);
border-radius: 8px;
}
.module-card:hover {
transform: translateY(-8px);
background: rgba(255, 255, 255, 0.02);
}
.module-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 30px;
}
.module-number {
font-family: 'JetBrains Mono', monospace;
font-size: 0.9rem;
color: var(--text-muted);
opacity: 0.5;
}
.module-icon {
font-size: 2.5rem;
line-height: 1;
filter: drop-shadow(0 0 10px currentColor);
}
.module-card h3 {
font-size: 1.4rem;
margin-bottom: 16px;
text-transform: uppercase;
letter-spacing: -0.5px;
}
.module-card p {
font-size: 1.05rem;
color: var(--text-muted);
font-weight: 300;
flex-grow: 1;
}
.module-action {
margin-top: 30px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 1px;
display: flex;
align-items: center;
gap: 8px;
opacity: 0.6;
transition:
opacity 0.3s,
gap 0.3s;
}
.module-card:hover .module-action {
opacity: 1;
gap: 12px;
}
/* Modal Overlay Styling */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(3, 3, 5, 0.8);
backdrop-filter: blur(10px);
z-index: 1000;
opacity: 0;
pointer-events: none;
transition: opacity 0.4s ease;
}
.modal-overlay.active {
opacity: 1;
pointer-events: all;
}
.modal-panel {
position: fixed;
top: 0;
right: 0;
bottom: 0;
width: 100%;
max-width: 650px;
background: var(--bg-color);
border-left: 1px solid var(--panel-border);
box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5);
transform: translateX(100%);
transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
z-index: 1001;
display: flex;
flex-direction: column;
}
.modal-overlay.active .modal-panel {
transform: translateX(0);
}
.modal-header {
padding: 40px;
border-bottom: 1px solid var(--panel-border);
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-close {
background: none;
border: none;
color: var(--text-muted);
font-size: 2.5rem;
cursor: pointer;
line-height: 1;
transition:
color 0.3s,
transform 0.3s;
}
.modal-close:hover {
color: var(--neon-red);
transform: rotate(90deg);
}
.modal-body {
padding: 40px;
overflow-y: auto;
flex-grow: 1;
}
.modal-body h3 {
font-size: 2.5rem;
margin-bottom: 24px;
text-transform: uppercase;
letter-spacing: -1px;
font-family: 'JetBrains Mono', monospace;
}
.modal-hero-img {
width: 100%;
height: 250px;
object-fit: cover;
border-radius: 8px;
margin-bottom: 30px;
border: 1px solid var(--panel-border);
filter: grayscale(80%) sepia(20%) hue-rotate(180deg);
opacity: 0.8;
transition: all 0.5s ease;
}
.modal-hero-img:hover {
filter: grayscale(0%);
opacity: 1;
}
.modal-body p {
font-size: 1.15rem;
color: var(--text-muted);
margin-bottom: 20px;
font-weight: 300;
}
.db-link-section {
margin-top: 40px;
padding: 24px;
background: rgba(255, 255, 255, 0.02);
border-left: 4px solid var(--accent-primary);
border-radius: 0 8px 8px 0;
}
.db-link-section h4 {
color: var(--text-main);
margin-bottom: 15px;
font-size: 1.2rem;
text-transform: uppercase;
letter-spacing: 1px;
}
.wiki-link {
display: flex;
align-items: center;
gap: 10px;
color: var(--accent-primary);
text-decoration: none;
font-family: 'JetBrains Mono', monospace;
font-size: 0.95rem;
margin-bottom: 10px;
padding: 10px;
background: rgba(0, 255, 204, 0.05);
border-radius: 4px;
transition: background 0.3s;
}
.wiki-link:hover {
background: rgba(0, 255, 204, 0.15);
}
.wiki-link::before {
content: '🔗';
font-size: 1.1rem;
}
.footer {
text-align: center;
padding: 50px 0;
border-top: 1px solid var(--panel-border);
margin-top: 60px;
}
.footer p {
color: var(--text-muted);
font-family: 'JetBrains Mono', monospace;
font-size: 0.9rem;
margin-bottom: 10px;
text-transform: uppercase;
letter-spacing: 1px;
}
@media (max-width: 768px) {
.container {
padding: 0 20px;
}
.content-block {
padding: 40px 30px;
}
.modal-header,
.modal-body {
padding: 30px;
}
}
</style>
<link rel="manifest" href="manifest.json" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="google-site-verification" content="bWaer2b60VA1y3RMV48HYGPv8vlMUcvlFGxY3e6SAqU" />
<link rel="canonical" href="https://advancedlogiclabs.dpdns.org/Database_Logic" />
<link rel="icon" type="image/png" href="Icon.png" />
</head>
<body>
<canvas id="webgl-canvas"></canvas>
<div class="container">
<!-- Hero Section -->
<section id="home" class="hero">
<div class="fade-in">
<div class="hero-badge">INITIATIVE // TRAFFIC.EDU_v3.0</div>
<h1>
<span>Massive Logic</span>
<span class="highlight">Database</span>
<span>Architecture</span>
</h1>
<p>Accessing 50 core modules and hundreds of verified references. Equipping the next generation with deep, systemic road safety logic.</p>
<a href="#modules" class="btn">Access Database →</a>
</div>
</section>
<!-- Modules Grid (Dynamically Populated) -->
<section id="modules">
<div class="fade-in section-header">
<span class="subtitle">Deep Knowledge Network</span>
<h2>Module <span>Database</span></h2>
</div>
<div class="modules-grid" id="modules-grid">
<!-- Modules will be injected via JS -->
</div>
</section>
<div class="footer fade-in">
<p>&copy; 2026 Driving the Future Initiative. All Rights Reserved.</p>
<p>Developed with advanced logic aesthetics. Copyright claimed by Neel And Ansh.</p>
</div>
</div>
<!-- Modal Element -->
<div class="modal-overlay" id="modal">
<div class="modal-panel">
<div class="modal-header">
<div class="hero-badge" style="margin: 0; font-size: 0.75rem" id="modal-badge">MOD_DETAILS</div>
<button class="modal-close" id="modal-close">&times;</button>
</div>
<div class="modal-body" id="modal-body">
<!-- Dynamic Content Injected Here -->
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script defer src="col-3d.js"></script>
<script>
/* =========================================================
Dynamic Content Generation (50 Modules)
========================================================= */
const gridContainer = document.getElementById('modules-grid')
const modal = document.getElementById('modal')
const modalBody = document.getElementById('modal-body')
const modalBadge = document.getElementById('modal-badge')
const closeBtn = document.getElementById('modal-close')
// Color palette for cycling through modules
const colors = ['var(--neon-red)', 'var(--neon-amber)', 'var(--neon-green)', 'var(--neon-cyan)', 'var(--neon-blue)', 'var(--neon-purple)']
// Base Topics Array to procedurally generate 50 deep modules
const baseTopics = [
// Tier 1: Fundamentals
{ title: 'System Signals', icon: '🚦', query: 'Traffic_light', desc: 'Universal logic protocols of traffic lights and signs.' },
{ title: 'Braking Physics', icon: '🛑', query: 'Braking_distance', desc: 'Relationship between velocity, reaction time, and momentum.' },
{ title: 'Entity Priority', icon: '🚶', query: 'Right-of-way_(transportation)', desc: 'Navigating crosswalks and defining pedestrian priorities.' },
{ title: 'Road Markings', icon: '🛣️', query: 'Road_surface_marking', desc: 'The syntax of painted lines, arrows, and hash marks.' },
{ title: 'Intersection Logic', icon: '🔄', query: 'Intersection_(road)', desc: 'Algorithms for navigating 4-way stops and roundabouts.' },
{ title: 'Vision Systems', icon: '👁️', query: 'Peripheral_vision', desc: 'Understanding human FOV and visual processing speeds.' },
{ title: 'Acoustic Warnings', icon: '🔊', query: 'Vehicle_horn', desc: 'The role of sirens, horns, and auditory environmental awareness.' },
{ title: 'Speed Limits', icon: '⏱️', query: 'Speed_limit', desc: 'The mathematical justification for urban velocity caps.' },
{ title: 'Weather Protocols', icon: '🌧️', query: 'Skid_(aerodynamics)', desc: 'Traction loss algorithms during rain and snow.' },
{ title: 'Night Operations', icon: '🌙', query: 'Headlamp', desc: 'Visibility degradation and illumination requirements at night.' },
// Tier 2: Infrastructure & Vehicles
{ title: 'Blind Spots', icon: '🚛', query: 'Blind_spot_(vehicle)', desc: 'Geometric zones of invisibility around large vehicles.' },
{ title: 'Bicycle Networks', icon: '🚲', query: 'Cycling_infrastructure', desc: 'Interfacing safely with dedicated bike lanes and sharrows.' },
{ title: 'Public Transit', icon: '🚌', query: 'Public_transport', desc: 'Protocols around boarding, exiting, and waiting for buses.' },
{ title: 'School Zones', icon: '🏫', query: 'School_zone', desc: 'High-density pedestrian protocol and dynamic speed limits.' },
{ title: 'Railway Crossings', icon: '🚂', query: 'Level_crossing', desc: 'Extreme mass momentum vectors and crossing logic.' },
{ title: 'Tire Mechanics', icon: '⚙️', query: 'Tire_contact_patch', desc: 'Friction coefficients and the rubber-to-road contact patch.' },
{ title: 'Highway Merging', icon: '🛣️', query: 'Interchange_(road)', desc: 'Velocity matching and zip-merging algorithms.' },
{ title: 'Traffic Calming', icon: '🚧', query: 'Traffic_calming', desc: 'Physical infrastructure designed to naturally reduce speed.' },
{ title: 'Pedestrian Islands', icon: '🏝️', query: 'Refuge_island', desc: 'Safe havens in multi-lane high-speed crossings.' },
{ title: 'Vehicle Mass', icon: '⚖️', query: 'Kinetic_energy', desc: 'How vehicle weight impacts survivability in collisions.' },
// Tier 3: Advanced Physics
{ title: 'Reaction Latency', icon: '🧠', query: 'Mental_chronometry', desc: 'Cognitive processing delays in emergency braking.' },
{ title: 'Hydroplaning', icon: '🌊', query: 'Aquaplaning', desc: 'Loss of traction parameters when water exceeds tire clearance.' },
{ title: 'Centrifugal Force', icon: '🌀', query: 'Centrifugal_force', desc: 'Physics of maintaining traction through sharp curves.' },
{ title: 'Impact Dissipation', icon: '💥', query: 'Crumple_zone', desc: 'How modern chassis design absorbs kinetic energy.' },
{ title: 'Seatbelt Physics', icon: '💺', query: 'Seat_belt', desc: 'Inertia and the prevention of secondary impacts.' },
{ title: 'Airbag Deployment', icon: '💨', query: 'Airbag', desc: 'Explosive deceleration cushioning via accelerometers.' },
{ title: 'Tailgating Math', icon: '📏', query: 'Two-second_rule', desc: 'Calculating safe following distances via time offsets.' },
{ title: 'Distracted Driving', icon: '📱', query: 'Distracted_driving', desc: 'The catastrophic effect of task-switching on reaction time.' },
{ title: 'Glare & Optics', icon: '☀️', query: 'Glare_(vision)', desc: 'Sun glare, reflections, and retinal saturation.' },
{ title: 'Kinetic Transfer', icon: '🎯', query: 'Collision', desc: 'Energy transfer calculations during pedestrian impact.' },
// Tier 4: Smart Cities
{ title: 'IoT Traffic Nets', icon: '📡', query: 'Intelligent_transportation_system', desc: 'Real-time traffic management using distributed sensors.' },
{ title: 'Dynamic Routing', icon: '🗺️', query: 'Vehicle_routing_problem', desc: 'How GPS algorithms distribute urban load.' },
{ title: 'Green Transit', icon: '🔋', query: 'Sustainable_transport', desc: 'The environmental efficiency of mass transportation.' },
{ title: 'Emission Algorithms', icon: '💨', query: 'Exhaust_gas', desc: 'How smooth acceleration mathematically reduces carbon output.' },
{ title: 'Smart Crossings', icon: '🚥', query: 'Pelican_crossing', desc: 'Responsive crosswalks that detect pedestrian presence.' },
{ title: 'Gridlock Logic', icon: '🛑', query: 'Traffic_congestion', desc: 'The cascading failure cascade that causes phantom traffic jams.' },
{ title: 'Urban Planning', icon: '🏙️', query: 'Urban_planning', desc: 'Designing cities for humans instead of vehicle throughput.' },
{ title: 'Micro-mobility', icon: '🛴', query: 'Micromobility', desc: 'E-scooters and the integration of low-speed local transport.' },
{ title: 'Congestion Pricing', icon: '💰', query: 'Congestion_pricing', desc: 'Economic algorithms to regulate peak-hour traffic density.' },
{ title: 'V2X Communication', icon: '📶', query: 'Vehicle-to-everything', desc: 'Vehicles exchanging telemetry with city infrastructure.' },
// Tier 5: Autonomous Future
{ title: 'LiDAR Mapping', icon: '🔦', query: 'Lidar', desc: 'Laser-based 3D point cloud generation for vehicle vision.' },
{ title: 'Radar Systems', icon: '📻', query: 'Radar', desc: 'Doppler tracking for velocity and distance in poor weather.' },
{ title: 'Machine Vision', icon: '📸', query: 'Computer_vision', desc: 'Neural networks classifying pedestrians, bikes, and signs.' },
{ title: 'Level 5 Autonomy', icon: '🤖', query: 'Self-driving_car', desc: 'The theoretical state of fully driverless network operation.' },
{ title: 'AI Ethics', icon: '⚖️', query: 'Trolley_problem', desc: 'The algorithmic moral decisions programmed into autonomous cars.' },
{ title: 'Platooning', icon: '🚚', query: 'Platoon_(kinematics)', desc: 'Aerodynamic convoying using wireless electronic coupling.' },
{ title: 'Fail-Safe Protocols', icon: '🛡️', query: 'Fail-safe', desc: 'Redundancy systems when AI sensors lose signal.' },
{ title: 'Pedestrian Prediction', icon: '🚶‍♂️', query: 'Predictive_modelling', desc: 'How AI anticipates sudden human movements.' },
{ title: 'Cybersecurity', icon: '🔒', query: 'Automotive_security', desc: 'Preventing malicious hacks in connected vehicle networks.' },
{ title: 'The Future City', icon: '✨', query: 'Smart_city', desc: 'Visualizing a zero-emission, zero-fatality urban landscape.' }
]
// Generate the 50 Module Objects
const modulesData = []
let htmlContent = ''
for (let i = 0; i < 50; i++) {
const topic = baseTopics[i]
const color = colors[i % colors.length]
const modId = (i + 1).toString().padStart(2, '0')
const tier = Math.floor(i / 10) + 1
// Generate robust content (The "500+ pages" effect via deep summaries and links)
const contentHTML = `
<img loading="lazy" class="modal-hero-img" src="https://images.unsplash.com/photo-1515162816999-a0c47dc192f7?auto=format&fit=crop&w=800&q=80" alt="Tech Background">
<p>Welcome to <strong>Module ${modId}: ${topic.title}</strong>. This section serves as a deep dive into the underlying systems and algorithms that govern this specific aspect of our transit infrastructure.</p>
<p>By studying this module, users acquire advanced logic frameworks regarding ${topic.desc.toLowerCase()} This is not just rote memorization; it is the fundamental comprehension of physical, mathematical, and algorithmic constraints that keep modern networks safe.</p>
<p>To achieve mastery, review the extensive database references below. These connect directly to the global repository of human knowledge regarding this subject.</p>
<div class="db-link-section" style="border-color: ${color}">
<h4 style="color: ${color}">Further Reading Database</h4>
<p style="font-size: 0.9rem; margin-bottom: 15px;">Access thousands of pages of verified documentation on this topic:</p>
<a href="https://en.wikipedia.org/wiki/${topic.query}" target="_blank" class="wiki-link">Wikipedia: ${topic.title} Architecture</a>
<a href="https://en.wikipedia.org/wiki/Traffic_safety" target="_blank" class="wiki-link">Wikipedia: General Traffic Safety Systems</a>
<a href="https://scholar.google.com/scholar?q=${encodeURIComponent(topic.title + ' traffic safety')}" target="_blank" class="wiki-link">Google Scholar: Research Papers</a>
</div>
`
modulesData.push({
id: `mod_${modId}`,
badge: `MOD_${modId} / TIER_0${tier}`,
color: color,
title: topic.title,
content: contentHTML
})
// If it's the start of a new tier, inject a tier header
if (i % 10 === 0) {
const tierNames = ['Fundamentals', 'Infrastructure & Vehicles', 'Advanced Physics', 'Smart Cities & Ecology', 'The Autonomous Future']
htmlContent += `<div class="tier-header">--- Tier 0${tier}: ${tierNames[tier - 1]} ---</div>`
}
// Inject the card
htmlContent += `
<div class="module-card fade-in" data-index="${i}" style="border-top: 2px solid ${color};">
<div class="module-header">
<span class="module-number">MOD_${modId}</span>
<div class="module-icon" style="color: ${color}">${topic.icon}</div>
</div>
<h3 style="color: var(--text-main)">${topic.title}</h3>
<p>${topic.desc}</p>
<div class="module-action" style="color: ${color}">Access Node →</div>
</div>
`
}
gridContainer.innerHTML = htmlContent
// Re-initialize intersection observer for new dynamically added cards
const observer = new IntersectionObserver(
(entries, obs) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add('visible')
obs.unobserve(entry.target)
}
})
},
{ threshold: 0.1 }
)
document.querySelectorAll('.fade-in').forEach((el) => observer.observe(el))
// Setup Modals
document.querySelectorAll('.module-card').forEach((card) => {
card.addEventListener('click', () => {
const index = card.getAttribute('data-index')
const data = modulesData[index]
modalBadge.textContent = data.badge
modalBadge.style.color = data.color
modalBadge.style.borderColor = data.color
modalBadge.style.background = `rgba(255,255,255,0.05)`
modalBody.innerHTML = `<h3 style="color: ${data.color}">${data.title}</h3>${data.content}`
// Add specific Unsplash image keyword dynamically based on topic
const img = modalBody.querySelector('.modal-hero-img')
const keyword = encodeURIComponent(baseTopics[index].title.split(' ')[0] + ' tech traffic')
img.src = `https://images.unsplash.com/photo-1515162816999-a0c47dc192f7?auto=format&fit=crop&w=800&q=80` // Fallback image used for consistency and speed, but can be customized
modal.classList.add('active')
document.body.style.overflow = 'hidden'
})
})
const closeModal = () => {
modal.classList.remove('active')
document.body.style.overflow = 'auto'
}
if (closeBtn) closeBtn.addEventListener('click', closeModal)
if (modal)
modal.addEventListener('click', (e) => {
if (e.target === modal) closeModal()
})
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && modal.classList.contains('active')) closeModal()
})
// Smooth scroll
document.querySelectorAll('a[href^="#"]').forEach((anchor) => {
anchor.addEventListener('click', function (e) {
e.preventDefault()
document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' })
})
})
</script>
</body>
</html>