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
25 changes: 21 additions & 4 deletions static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,16 +689,33 @@ updateProfileWidgets();
var errorMsg = document.getElementById("github-modal-error");

function closeGithubModal() {
modal.classList.remove("active");
githubInput.value = "";
errorMsg.textContent = "";
}
modal.classList.remove("active");
githubInput.value = "";
errorMsg.textContent = "";
openModalBtn.focus(); // add this line
}

if (modal && openModalBtn && closeModalBtn && fetchBtn && githubInput && errorMsg) {
openModalBtn.addEventListener("click", function () {
modal.classList.add("active");
githubInput.focus();
});
modal.addEventListener("keydown", function (event) {
if (!modal.classList.contains("active")) return;
var focusable = modal.querySelectorAll("button, input");
var first = focusable[0];
var last = focusable[focusable.length - 1];
if (event.key === "Tab") {
if (event.shiftKey && document.activeElement === first) {
event.preventDefault();
last.focus();
} else if (!event.shiftKey && document.activeElement === last) {
event.preventDefault();
first.focus();
}
}
if (event.key === "Escape") closeGithubModal();
});
closeModalBtn.addEventListener("click", closeGithubModal);
modal.addEventListener("click", function (event) {
if (event.target === modal) closeGithubModal();
Expand Down
4 changes: 3 additions & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,9 @@ <h2 class="section-title">Find Your Next Project</h2>
<label for="skills-input">
Your Skills
<button type="button" class="tooltip" aria-label="Skills help" aria-describedby="skills-tooltip">
<span aria-hidden="true">ⓘ</span>
</button>

<span id="skills-tooltip" class="tooltip-text" role="tooltip">
Add technologies, programming languages, or tools you know like Python, React, Git, SQL, etc.
</span>
Expand Down
Loading