Skip to content

Commit

Permalink
support accordeon
Browse files Browse the repository at this point in the history
  • Loading branch information
syncall committed Feb 14, 2024
1 parent 54d2410 commit bd4eca9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script src="{{ '/assets/js/codehighlight.js' | relative_url }}"></script>
<script src="{{ '/assets/js/accordeon.js' | relative_url }}"></script>

<footer>
<div class="row">
Expand Down
5 changes: 2 additions & 3 deletions _sass/_style-1.0.0.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5399,7 +5399,7 @@ div.csc-textpic-intext-left-nowrap .csc-textpic-imagewrap {
}

.js .accordion-box--opened .accordion-box__title::after {
background-image: url("../../Images/icon/minus.png")
content: '\2796';
}

.js .accordion-box--opened .accordion-box__content {
Expand Down Expand Up @@ -5432,8 +5432,7 @@ div.csc-textpic-intext-left-nowrap .csc-textpic-imagewrap {
}

.js .accordion-box__title::after {
background: url("../../Images/icon/plus.png") no-repeat center center;
content: '';
content: '\02795';
display: block;
height: 18px;
position: absolute;
Expand Down
10 changes: 10 additions & 0 deletions assets/js/accordeon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var acc = document.getElementsByClassName("accordion-box");
var i;

for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
/* Toggle between adding and removing the "active" class,
to highlight the button that controls the panel */
this.classList.toggle("accordion-box--opened");
});
}
11 changes: 11 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,14 @@ also for your bibliography
```

[return to the github repo](https://github.com/tumi8/tumi8-theme)


<div class="accordion-box">
<div class="accordion-box__title">
Demo
</div>
<div class="accordion-box__content">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo.</p>
<p>Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vu</p>
</div>
</div>

0 comments on commit bd4eca9

Please sign in to comment.