Skip to content

Commit

Permalink
Revert "Wins page modal a11y (#1679)" (#1738)
Browse files Browse the repository at this point in the history
This reverts commit c122699.
  • Loading branch information
akibrhast authored Jun 15, 2021
1 parent c122699 commit c492445
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 60 deletions.
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

0 comments on commit c492445

Please sign in to comment.