File tree Expand file tree Collapse file tree 4 files changed +63
-1
lines changed Expand file tree Collapse file tree 4 files changed +63
-1
lines changed Original file line number Diff line number Diff line change
1
+ < div class ="collapsible collapsible--expanded ">
2
+ < header class ="collapsible__header ">
3
+ < h2 class ="collapsible__heading "> Item 1</ h2 >
4
+ < svg class ="icon icon--primary collapsible__chevron ">
5
+ < use xlink:href ="images/sprite.svg#chevron "> </ use >
6
+ </ svg >
7
+ </ header >
8
+ < div class ="collapsible__content ">
9
+ Lorem ipsum dolor sit amet consectetur, adipisicing elit. Eaque, quos.
10
+ </ div >
11
+ </ div >
12
+ < script src ="js/main.js "> </ script >
Original file line number Diff line number Diff line change 549
549
margin : 0 2rem ;
550
550
}
551
551
552
+ }
553
+
554
+ /*Collapsibles*/
555
+ .collapsible__header {
556
+ display : flex;
557
+ justify-content : space-between;
558
+ }
559
+
560
+ .collapsible__heading {
561
+ margin-top : 0 ;
562
+ font-size : 3rem ;
563
+ }
564
+
565
+ .collapsible__chevron {
566
+ transform : rotate (-90deg );
567
+ transition : transform 0.3s ;
568
+ }
569
+
570
+ .collapsible__content {
571
+ max-height : 0 ;
572
+ overflow : hidden;
573
+ opacity : 0 ;
574
+ transition : all 0.3s ;
575
+ }
576
+
577
+ .collapsible--expanded .collapsible__chevron {
578
+ transform : rotate (0 );
579
+ }
580
+
581
+ .collapsible--expanded .collapsible__content {
582
+ max-height : 100vh ;
583
+ opacity : 1 ;
552
584
}
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ <h3 class="media_title quote__author">John Lumeo</h3>
105
105
< div class ="card testimonial ">
106
106
< div class ="grid grid--1x2 ">
107
107
< div class ="testimonial__image ">
108
- < img src ="images/testimonial.jpg " alt ="A happy, smiling customer " />
108
+ < img src ="images/ " alt ="A happy, smiling customer " />
109
109
< span class ="icon-container icon-container--accent ">
110
110
< svg class ="icon icon--white icon--small ">
111
111
< use xlink:href ="images/sprite.svg#quotes "> </ use >
@@ -150,5 +150,17 @@ <h2 class="callout__heading">Ready to Get Started</h2>
150
150
>
151
151
</ div >
152
152
</ div >
153
+ < div class ="collapsible collapsible--expanded ">
154
+ < header class ="collapsible__header ">
155
+ < h2 class ="collapsible__heading "> Item 1</ h2 >
156
+ < svg class ="icon icon--primary collapsible__chevron ">
157
+ < use xlink:href ="images/sprite.svg#chevron "> </ use >
158
+ </ svg >
159
+ </ header >
160
+ < div class ="collapsible__content ">
161
+ Lorem ipsum dolor sit amet consectetur, adipisicing elit. Eaque, quos.
162
+ </ div >
163
+ </ div >
164
+ < script src ="js/main.js "> </ script >
153
165
</ body >
154
166
</ html >
Original file line number Diff line number Diff line change
1
+ const collapsibles = document . querySelectorAll ( ".collapsible" ) ;
2
+ collapsibles . forEach ( ( item ) =>
3
+ item . addEventListener ( "click" , function ( ) {
4
+ this . classList . toggle ( "collapsible--expanded" ) ;
5
+ } )
6
+ ) ;
You can’t perform that action at this time.
0 commit comments