Skip to content
Open
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
23 changes: 19 additions & 4 deletions static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
var menu = document.getElementById("nav-mobile-menu");
if (!toggle || !menu) return;

toggle.addEventListener("click", function () {
var isOpen = menu.classList.toggle("open");
toggle.classList.toggle("open", isOpen);
toggle.setAttribute("aria-expanded", isOpen);
});

document.querySelectorAll(".nav-mobile-link").forEach(function (link) {
link.addEventListener("click", function () {
menu.classList.remove("open");
toggle.classList.remove("open");
toggle.setAttribute("aria-expanded", "false");
});
});
})();

function setOpen(isOpen) {
menu.classList.toggle("open", isOpen);
toggle.classList.toggle("open", isOpen);
Expand All @@ -66,7 +81,7 @@
window.addEventListener("resize", function () {
if (window.innerWidth >= 640) setOpen(false);
});
})();


var STORAGE_KEY = "devpathUserProgress";
var progress = {
Expand Down Expand Up @@ -997,7 +1012,7 @@ updateProfileWidgets();
var general = document.getElementById("form-error-general");
if (general) general.textContent = err.message || "An unexpected error occurred. Please try again.";
});
});
})};

var modal = document.getElementById("github-modal-overlay");
var openModalBtn = document.getElementById("btn-show-github");
Expand Down Expand Up @@ -1073,7 +1088,7 @@ updateProfileWidgets();
});
});
}
})();
;

(function initDetailPage() {
if (typeof PROJECT_ID === "undefined") return;
Expand Down Expand Up @@ -1246,4 +1261,4 @@ updateProfileWidgets();
window.scrollTo({ top: atBottom ? 0 : document.body.scrollHeight, behavior: "smooth" });
});
update();
})();
})});
35 changes: 27 additions & 8 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ html[data-entry-anim="true"] .form-card form > .btn-submit { animat
background: rgba(255, 255, 255, 0.11);
box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.25);
}

#topic-search,
#topic-search-mobile {
flex: 1;
Expand All @@ -559,6 +558,7 @@ html[data-entry-anim="true"] .form-card form > .btn-submit { animat
font-size: 0.84rem;
font-family: var(--font-body);
color: #ffffff;
height: 40px !important;
}

#topic-search::placeholder,
Expand Down Expand Up @@ -601,13 +601,6 @@ html[data-entry-anim="true"] .form-card form > .btn-submit { animat
width: 16px;
height: 16px;
}

.navbar-search--mobile {
max-width: none;
margin: 0 0 20px;
width: 100%;
}

.nav-right {
display: flex;
align-items: center;
Expand Down Expand Up @@ -843,6 +836,32 @@ html[data-entry-anim="true"] .form-card form > .btn-submit { animat
margin-left: auto;
}

.navbar-search.navbar-search--mobile {
flex: 0 0 auto;
width: 100%;
max-width: 100%;
margin-left: 0;
align-self: stretch;
flex-direction: row-reverse;
}

.navbar-search--mobile .navbar-search-btn {
width: auto;
height: auto;
margin: 0;
padding: 0;
background: transparent;
border-radius: 0;
border: none;
color: rgba(255, 255, 255, 0.85);
margin-left: 8px;
}

.navbar-search--mobile .navbar-search-btn svg {
width: 18px;
height: 18px;
}

.nav-mobile-menu .theme-toggle {
display: flex;
align-items: center;
Expand Down
4 changes: 2 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@

<div class="nav-mobile-menu" id="nav-mobile-menu" role="menu">
<form id="topic-search-form-mobile" class="navbar-search navbar-search--mobile" role="search">
<input type="search" id="topic-search-mobile" autocomplete="off" aria-label="Search projects"
placeholder="Search projects…" />
<button class="navbar-search-btn" type="submit" aria-label="Search">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"
stroke-width="2" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round"
d="M21 21l-4.35-4.35m1.85-5.15a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</button>
<input type="search" id="topic-search-mobile" autocomplete="off" aria-label="Search projects"
placeholder="Search projects…" />
</form>
<a href="#home" class="nav-mobile-link" role="menuitem">Home</a>
<a href="#how-it-works" class="nav-mobile-link" role="menuitem">How It Works</a>
Expand Down
Loading