Skip to content

Commit 113d75f

Browse files
author
Kyle Bradshaw
committed
flex panel gallery v1 KB flava
1 parent 6736d58 commit 113d75f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

05 - Flex Panel Gallery/index-START.html renamed to 05 - Flex Panel Gallery/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
.panels {
2525
min-height:100vh;
2626
overflow: hidden;
27+
display: flex;
28+
flex-direction: horizontal;
2729
}
2830

2931
.panel {
32+
flex: 1;
3033
background:#6B0F9C;
3134
box-shadow:inset 0 0 0 5px rgba(255,255,255,0.1);
3235
color:white;
@@ -68,6 +71,8 @@
6871

6972
.panel.open {
7073
font-size:40px;
74+
flex: 3;
75+
transition: 0.2s ease-in flex;
7176
}
7277

7378
.cta {
@@ -107,7 +112,13 @@
107112
</div>
108113

109114
<script>
110-
115+
var panels = Array.from(document.querySelectorAll('.panel'));
116+
panels.forEach(function(panel){
117+
panel.addEventListener('click', togglePanel);
118+
})
119+
function togglePanel(event) {
120+
this.classList.toggle('open');
121+
}
111122
</script>
112123

113124

0 commit comments

Comments
 (0)