Skip to content

Commit

Permalink
Jobs are now collapsible in about
Browse files Browse the repository at this point in the history
  • Loading branch information
99TheDark committed Nov 27, 2023
1 parent 8541cc0 commit 06aef84
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ <h6>Skills</h6>
</div>
</div>
<div data-href="../global/tiles/footer.html"></div>

<!-- Main Script -->
<script src="script.js"></script>
</body>

</html>
12 changes: 12 additions & 0 deletions about/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const collapsibles = [...document.getElementsByClassName("type")];
collapsibles.forEach(el => {
toggleCollapsible(el);
el.children[0].addEventListener("click", () => toggleCollapsible(el));
});

function toggleCollapsible(e) {
const children = [...e.children];
children.shift();

children.forEach(c => c.classList.toggle("collapsed"));
}
16 changes: 15 additions & 1 deletion about/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,22 @@
max-width: 900px;
}

.type {
background-color: var(--l);
padding: 1em 2em;
border-radius: 5px;
margin: 1em 0px;
}

.type {
transition: height 1s linear;
}

.type > h4 {
font-family: "Poppins";
font-size: 1.8em;
font-weight: 400;
margin-bottom: 0px;
margin: 0px;
}

.type > p {
Expand All @@ -79,6 +89,10 @@
margin-bottom: 2em;
}

.type > .collapsed {
display: none;
}

.list {
font-family: "Nunito";
margin-bottom: 2em;
Expand Down

0 comments on commit 06aef84

Please sign in to comment.