File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
packages/components/bolt-with-without Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -4,27 +4,35 @@ import handleBlockTitleMobileAccordionClick from './accordion';
4
4
import handleResize from './handleResize' ;
5
5
import handleActiveRegionChange from './handleActiveRegionChange' ;
6
6
7
+ // Initialize the with/without slide-toggle.
7
8
const toggleInputClass = '#c-pega-wwo__toggle-input' ;
8
9
SimpleSwitch . init ( ) ;
9
10
11
+ // Initialize the swiper for sliding between with and without.
10
12
const wwoSwiper = new Swiper ( '.c-pega-wwo__swiper-container' , {
11
13
speed : 500 ,
12
14
spaceBetween : 0 ,
13
15
} ) ;
14
16
17
+ // Initialize the page.
15
18
handleActiveRegionChange (
16
19
document . querySelector ( toggleInputClass ) . checked ,
17
20
wwoSwiper ,
18
21
true ,
19
22
) ;
23
+
24
+ // Wire up the toggler to the event region switcher.
20
25
document
21
26
. querySelector ( '#c-pega-wwo__toggle-input' )
22
27
. addEventListener ( 'change' , e => {
23
28
handleActiveRegionChange ( e . target . checked , wwoSwiper ) ;
24
29
} ) ;
25
30
31
+ // Initialize the accordion.
26
32
document . querySelectorAll ( '.c-pega-wwo__region-blocks' ) . forEach ( el => {
27
33
el . addEventListener ( 'click' , handleBlockTitleMobileAccordionClick ) ;
28
34
} ) ;
35
+
36
+ // Set up the resize listener which helps with some of the abs. pos. stuff.
29
37
handleResize ( ) ;
30
38
window . addEventListener ( 'resize' , handleResize ) ;
Original file line number Diff line number Diff line change @@ -36,13 +36,21 @@ $pega-wwo--sm-circle-top-margin--mobile: $bolt-medium-icon-half-size - ($pega-ww
36
36
}
37
37
38
38
39
- & __modal-bg {
39
+ & __modal-bg--wrapper {
40
40
position : absolute ;
41
+ height : 3000px ;
42
+ width : 100% ;
41
43
top : 0 ;
42
44
left : 0 ;
43
45
z-index : 33 ;
44
- width : 100vw ;
46
+ }
47
+
48
+ & __modal-bg {
49
+ width : 100% ;
45
50
height : 100% ;
51
+ position : absolute ;
52
+ top : 0 ;
53
+ left : 0 ;
46
54
pointer-events : none ;
47
55
background-color : bolt-color (black );
48
56
}
Original file line number Diff line number Diff line change 1
1
{# wwo stands for "with-without" #}
2
2
<div class =" c-pega-wwo t-bolt-xdark" >
3
3
<div class =" c-pega-wwo__wrapper" >
4
- <bolt -animate group =" initial" out =" fade-out" out-duration =" 6000" >
5
- <div class =" c-pega-wwo__modal-bg" ></div >
6
- </bolt -animate >
7
4
<div class =" c-pega-wwo__inner" >
8
5
<div class =" c-pega-wwo__title-and-toggle--wrapper" >
9
6
<h2 class =" c-pega-wwo__title" >
410
407
</div>
411
408
</div>
412
409
</div>
410
+ <bolt-animate class=" c-pega-wwo __modal-bg--wrapper " group=" initial " out=" fade-out " out-duration=" 2000" >
411
+ <div class=" c-pega-wwo __modal-bg " ></div>
412
+ </bolt-animate>
413
413
</div>
414
414
</div>
You can’t perform that action at this time.
0 commit comments