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

Standardization of the accordion element #2208

Merged
merged 6 commits into from
Sep 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 _data/internal/credits/care.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ provider-link: https://thenounproject.com/
image-url: /assets/images/join-us/help-us-icon.svg
alt: 'Image of Care'
type: icon
---
---
21 changes: 1 addition & 20 deletions _guide-pages/2FA.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,4 @@ <h3>Member Analytics</h3>
</div>
</div>
</div>
-->

<!-- //script for FAQ dropdown -->
<script>
let showAnswer = document.getElementsByClassName('accordion');

for (let i = 0; i < showAnswer.length; i++) {
showAnswer[i].addEventListener("click", function () {

this.classList.toggle("active");
let panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none"
} else {
panel.style.display = "block"
}
})

}
</script>
<script src ="/assets/js/elements/accordion.js"></script>
64 changes: 0 additions & 64 deletions _sass/components/_getting-started-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -363,70 +363,6 @@
margin: 30px auto;
}

.github-sign-up-text {
font-size: 13px;
padding-top: 10px;
}

.getting-started-step-title-faq {
font-size: 1.5rem;
font-weight: 700;
margin-left: 2px;

@media #{$bp-below-mobile} {
font-size: 1.25rem;
text-align: center;
font-weight: bold;
}
}

.accordion {
color: black;
cursor: pointer;
transition: 0.4s;
font-size: 1.25rem;
text-align: left;
border-bottom: 0.5px solid gray;
margin-top: 45px;

@media #{$bp-below-mobile} {
margin-top: 20px;
min-width: 255px;
font-size: 1.125rem;
}
}

.getting-started-guide-content-section p {
padding-bottom: 1.2rem;
}

.accordion:after {
content: "\221F";
float: right;
transform: rotate(-45deg);
transition: transform 0.25s ease-in;
font-weight: bolder;
font-size: 20px;
margin-top: -.1em;
color: rgb(250, 17, 79);

@media #{$bp-below-mobile} {
color: rgb(250, 17, 79);
}
}

.active::after {
content: "\221F";
transform: rotate(135deg);
transition: transform 0.25s ease-in;
}

.panel {
display: none;
text-align: left;
margin-top: 40px;
}

.ordered-list-steps {
display: flex;
flex-direction: row;
Expand Down
8 changes: 0 additions & 8 deletions _sass/components/guide-pages/2FA.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.accordion {
padding: 0.2rem;

}

#myCanvas {
justify-content: center;
Expand Down Expand Up @@ -80,10 +76,6 @@
}

@media #{$bp-below-desktop} {
.accordion {
min-width: 150px;
}

.screenshot-2FA img {
min-width: 200px;
width: 100%;
Expand Down
63 changes: 63 additions & 0 deletions _sass/elements/_accordion.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.accordion {
color: black;
cursor: pointer;
transition: 0.4s;
font-size: 1.25rem;
text-align: left;
border-bottom: 0.5px solid gray;
max-width: 1000px;
margin-top: 45px;

@media #{$bp-below-mobile} {
margin-top: 20px;
min-width: 255px;
font-size: 1.125rem;
}
}


.svg-accordion {
float: right;
}

.svg-accordion:hover {
opacity: 0.5;
}

.accordion:after {
content: "\221F";
float: right;
transform: rotate(-45deg);
transition: transform 0.25s ease-in;
color: $color-red;
font-weight: bolder;
font-size: 24px;
}

.accordion {
padding: 0.2rem;

}

.active::after {
content: "\221F";
transform: rotate(135deg);
transition: transform 0.25s ease-in;
}

.panel {
display: none;
overflow: hidden;
text-align: left;
margin-top: 40px;
}

.show {
display: block;
}

@media #{$bp-below-desktop} {
.accordion {
min-width: 150px;
}
}
1 change: 1 addition & 0 deletions _sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// /**
// * Elements
// */
@import 'elements/accordion';
@import 'elements/buttons';
@import 'elements/forms';
@import 'elements/icons';
Expand Down
12 changes: 12 additions & 0 deletions assets/js/elements/accordion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

var showAnswer = document.getElementsByClassName('accordion');

for (var i = 0; i < showAnswer.length; i++) {
showAnswer[i].addEventListener("click", function () {

this.classList.toggle("active");
var panel = this.nextElementSibling;
panel.classList.toggle("show");
})

}
21 changes: 1 addition & 20 deletions pages/getting-started.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,23 +281,4 @@ <h1 class="header-h1">Getting Started</h1>
</div>
</div>
</div>

<!-- //script for FAQ dropdown -->

<script>
var showAnswer = document.getElementsByClassName('accordion');

for (var i = 0; i < showAnswer.length; i++) {
showAnswer[i].addEventListener("click", function () {

this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none"
} else {
panel.style.display = "block"
}
})

}
</script>
<script src="/assets/js/elements/accordion.js"></script>