Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Wins page modal a11y" #1738

Merged
merged 1 commit into from
Jun 15, 2021
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
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% include head.html %}
<body>
<div id="app">
<a id="skip-link" class="sr-only-focusable" href="#content">
<a id="skip-link" className="sr-only-focusable" href="#content">
<!-- PLEASE DO NOT REMOVE, THIS A TAG EXISTS FOR ACCESIBILITY REASONS -->
Skip to main content.
</a>
Expand Down
2 changes: 0 additions & 2 deletions assets/js/inert.min.js

This file was deleted.

7 changes: 3 additions & 4 deletions pages/wins/wins-card-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
<div class="project-inner wins-see-more-div">
<span
id="0"
role="button"
onclick="seeMore(id)"
onkeypress="seeMore(id)"
expandable
class="see-more-div"
tabindex="0"
>...see more</span>
>...see more</span
>
</div>
</div>
</div>
Expand Down
60 changes: 7 additions & 53 deletions pages/wins/wins.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@
</div>
</section>


<script src="/assets/js/inert.min.js"></script>

<script>



//assigning the google form questions to variables for readability
//these variables correspond with a question on the google form
//these variables can be used as a key to access the data
Expand Down Expand Up @@ -390,39 +385,7 @@
let iconImg = makeElement('img', icon, className);
iconImg.setAttribute("src", src);
}

function updateOverlay(i) {

window.addEventListener('keydown', (e) => {
if (e.key == 'Escape') {
hideOverlay(e.key)
}
});

document.querySelector(".main-header").inert = true;
document.querySelector(".content-section.projects").inert = true;
document.querySelector(".main-footer").inert = true;
document.querySelector(".home-getting-started-container.content-section.section-hack-nights.wins-hero").inert = true;
document.querySelector(".sr-only-focusable").inert = true;

window.addEventListener('resize', (e) => {
widthOutput = window.innerWidth;
if (widthOutput < 960) {
document.querySelector(".main-header").inert = false;
document.querySelector(".content-section.projects").inert = false;
document.querySelector(".main-footer").inert = false;
document.querySelector(".home-getting-started-container.content-section.section-hack-nights.wins-hero").inert = false;
document.querySelector(".sr-only-focusable").inert = false;
}
else {
document.querySelector(".main-header").inert = true;
document.querySelector(".content-section.projects").inert = true;
document.querySelector(".main-footer").inert = true;
document.querySelector(".home-getting-started-container.content-section.section-hack-nights.wins-hero").inert = true;
document.querySelector(".sr-only-focusable").inert = true;
}
});

let stringData = window.localStorage.getItem("data");
let data = JSON.parse(stringData).reverse();

Expand Down Expand Up @@ -456,23 +419,14 @@
const overlayProjectCard = document.querySelector('#overlay-project-card');
overlayProjectCard.parentNode.classList.add("display-initial");
}
function hideOverlay(e) {
e = e || window.event;
if (e.target !== e.currentTarget)
return;


function hideOverlay(e) {
e = e || window.event || e.key == 'Escape';

if (e.target !== e.currentTarget)
return;

const overlayProjectCard = document.querySelector('#overlay-project-card');
overlayProjectCard.parentNode.classList.remove("display-initial");

document.querySelector(".main-header").inert = false;
document.querySelector(".content-section.projects").inert = false;
document.querySelector(".main-footer").inert = false;
document.querySelector(".home-getting-started-container.content-section.section-hack-nights.wins-hero").inert = false;
document.querySelector(".sr-only-focusable").inert = false;
}
const overlayProjectCard = document.querySelector('#overlay-project-card');
overlayProjectCard.parentNode.classList.remove("display-initial");
}

main();

Expand Down