Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions web-app/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ body.sidebar-active .sidebar-dock {
display: flex;
align-items: center;
justify-content: center;
padding: calc(var(--nav-height) + 40px) 24px 60px;
padding: calc(var(--nav-height) + 12px) 24px 60px;
overflow: hidden;
}

Expand Down Expand Up @@ -1862,7 +1862,7 @@ body.sidebar-active .sidebar-dock {
}

body.sidebar-active:not(.sidebar-collapsed) .projects-section {
padding-left: 312px !important;
padding-left: 296px !important;
}

body.sidebar-collapsed .projects-section {
Expand Down Expand Up @@ -3293,7 +3293,7 @@ body.sidebar-active .sidebar-dock {

@media (min-width: 1100px) {
body.sidebar-active:not(.sidebar-collapsed) .footer {
padding-left: 312px !important;
padding-left: 296px !important;
padding-right: 24px !important;
}

Expand Down Expand Up @@ -5032,7 +5032,7 @@ html[data-theme="dark"] body {
font-size: clamp(3rem, 7vw, 5.6rem);
line-height: 1;
letter-spacing: -0.05em;
margin-top: 0.75rem;
margin-top: 0;
}

.hero-title span {
Expand Down Expand Up @@ -5988,4 +5988,4 @@ html[data-theme="dark"] body {
transition:
transform var(--duration-slow, 500ms) cubic-bezier(0.16, 1, 0.3, 1),
opacity var(--duration-slow, 500ms) cubic-bezier(0.16, 1, 0.3, 1);
}
}
63 changes: 59 additions & 4 deletions web-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
<i class="fas fa-search"></i>
<input aria-label="Search projects" id="navSearchInput" placeholder="Search projects or games..." type="text"/>
</div>
<!-- HAMBURGER TOGGLE (mobile) -->
<button type="button" class="mobile-menu-toggle" id="mobileMenuToggle" aria-label="Toggle navigation menu" aria-expanded="false">
<!-- HAMBURGER — toggles sidebar -->
<button type="button" class="mobile-menu-toggle" id="mobileMenuToggle" aria-label="Toggle sidebar" aria-expanded="true" onclick="(function(b){var open=b.classList.toggle('sidebar-active');document.getElementById('mobileMenuToggle').setAttribute('aria-expanded',String(open));})(document.body)">
<i class="fas fa-bars"></i>
</button>
<!-- RIGHT -->
Expand Down Expand Up @@ -823,7 +823,62 @@ <h3>Legal</h3>
<script src="js/main.js"></script>
<script src="js/hero-canvas.js"></script>
<script>lucide.createIcons();</script>
<script src="js/fix.js"></script>
<script src="js/fix.js"></script>
<script>
/* ── FIX 2: Keep sidebar open when clicking project cards or modal content ──
main.js registers a document-level click listener that removes sidebar-active
for "click outside" — we stop propagation on the project grid and modal so
those clicks never reach that handler. */
(function () {
function guardSidebar() {
/* Elements whose clicks must NOT close the sidebar */
var guards = [
'#projectsSection', /* entire projects grid area */
'#projectsGrid',
'.project-card',
'.btn-play',
'.modal', /* project modal */
'#projectModal',
'.modal-content',
'#modalBody',
'.playground-section',
'.playground-body',
];
guards.forEach(function (sel) {
document.querySelectorAll(sel).forEach(function (el) {
el.addEventListener('click', function (e) {
/* Only block propagation if sidebar is currently open */
if (document.body.classList.contains('sidebar-active')) {
e.stopPropagation();
}
}, true /* capture — runs before main.js bubble handler */);
});
});

/* Also re-guard whenever new cards are injected (dynamic render) */
var observer = new MutationObserver(function () {
guards.forEach(function (sel) {
document.querySelectorAll(sel).forEach(function (el) {
if (el._sidebarGuarded) return;
el._sidebarGuarded = true;
el.addEventListener('click', function (e) {
if (document.body.classList.contains('sidebar-active')) {
e.stopPropagation();
}
}, true);
});
});
});
observer.observe(document.body, { childList: true, subtree: true });
}

if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', guardSidebar, { once: true });
} else {
guardSidebar();
}
})();
</script>
<script>
(function () {
var projectAliases = {
Expand Down Expand Up @@ -890,4 +945,4 @@ <h3 id="infoModalTitle">How to Play</h3>
</div>

</body>
</html>
</html>
Loading