Skip to content

Commit 30a5e83

Browse files
author
Kyle Bradshaw
committed
kb v2
1 parent 113d75f commit 30a5e83

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

05 - Flex Panel Gallery/index.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030

3131
.panel {
3232
flex: 1;
33+
display: flex;
34+
justify-content: center;
35+
align-items: center;
36+
flex-direction: column;
3337
background:#6B0F9C;
3438
box-shadow:inset 0 0 0 5px rgba(255,255,255,0.1);
3539
color:white;
3640
text-align: center;
37-
align-items:center;
41+
align-items: center;
3842
/* Safari transitionend event.propertyName === flex */
3943
/* Chrome + FF transitionend event.propertyName === flex-grow */
4044
transition:
@@ -54,11 +58,23 @@
5458
.panel5 { background-image:url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500); }
5559

5660
.panel > * {
61+
/*border: 1px solid red;*/
5762
margin:0;
5863
width: 100%;
5964
transition:transform 0.5s;
65+
flex: 1 0 auto;
66+
display: flex;
67+
justify-content: center;
68+
align-items: center;
6069
}
6170

71+
/* hide them */
72+
.panel > *:first-child { transform: translateY(-100%); }
73+
.panel > *:last-child { transform: translateY(100%); }
74+
/* show them */
75+
.panel.open > *:first-child { transform: translateY(0%); }
76+
.panel.open > *:last-child { transform: translateY(0%); }
77+
6278
.panel p {
6379
text-transform: uppercase;
6480
font-family: 'Amatic SC', cursive;

0 commit comments

Comments
 (0)