|
| 1 | +html { |
| 2 | + box-sizing: border-box; |
| 3 | + background:#ffc600; |
| 4 | + font-family:'helvetica neue'; |
| 5 | + font-size: 20px; |
| 6 | + font-weight: 200; |
| 7 | +} |
| 8 | +body { |
| 9 | + margin: 0; |
| 10 | +} |
| 11 | +*, *:before, *:after { |
| 12 | + box-sizing: inherit; |
| 13 | +} |
| 14 | + |
| 15 | +.panels { |
| 16 | + min-height:100vh; |
| 17 | + overflow: hidden; |
| 18 | + display: flex; |
| 19 | +} |
| 20 | + |
| 21 | +.panel { |
| 22 | + background:#6B0F9C; |
| 23 | + box-shadow:inset 0 0 0 5px rgba(255,255,255,0.1); |
| 24 | + color:white; |
| 25 | + text-align: center; |
| 26 | + align-items:center; |
| 27 | + /* Safari transitionend event.propertyName === flex */ |
| 28 | + /* Chrome + FF transitionend event.propertyName === flex-grow */ |
| 29 | + transition: |
| 30 | + font-size 0.7s cubic-bezier(0.61,-0.19, 0.7,-0.11), |
| 31 | + flex 0.7s cubic-bezier(0.61,-0.19, 0.7,-0.11), |
| 32 | + background 0.2s; |
| 33 | + font-size: 20px; |
| 34 | + background-size:cover; |
| 35 | + background-position:center; |
| 36 | + flex: 1; |
| 37 | + justify-content: center; |
| 38 | + align-items: center; |
| 39 | + display: flex; |
| 40 | + flex-direction: column; |
| 41 | +} |
| 42 | + |
| 43 | + |
| 44 | +.panel1 { background-image:url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500); } |
| 45 | +.panel2 { background-image:url(https://source.unsplash.com/1CD3fd8kHnE/1500x1500); } |
| 46 | +.panel3 { background-image:url(https://images.unsplash.com/photo-1465188162913-8fb5709d6d57?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&cs=tinysrgb&w=1500&h=1500&fit=crop&s=967e8a713a4e395260793fc8c802901d); } |
| 47 | +.panel4 { background-image:url(https://source.unsplash.com/ITjiVXcwVng/1500x1500); } |
| 48 | +.panel5 { background-image:url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500); } |
| 49 | + |
| 50 | +/* Flex items */ |
| 51 | +.panel > * { |
| 52 | + margin:0; |
| 53 | + width: 100%; |
| 54 | + transition:transform 0.5s; |
| 55 | + flex: 1 0 auto; |
| 56 | + display: flex; |
| 57 | + justify-content: center; |
| 58 | + align-items: center; |
| 59 | +} |
| 60 | + |
| 61 | +.panel > *:first-child { |
| 62 | + transform: translateY(-100%); |
| 63 | +} |
| 64 | + |
| 65 | +.panel.open-active > *:first-child { |
| 66 | + transform: translateY(0); |
| 67 | +} |
| 68 | + |
| 69 | +.panel > *:last-child { |
| 70 | + transform: translateY(100%); |
| 71 | +} |
| 72 | + |
| 73 | +.panel.open-active > *:last-child { |
| 74 | + transform: translateY(0); |
| 75 | +} |
| 76 | + |
| 77 | +.panel p { |
| 78 | + text-transform: uppercase; |
| 79 | + font-family: 'Amatic SC', cursive; |
| 80 | + text-shadow:0 0 4px rgba(0, 0, 0, 0.72), 0 0 14px rgba(0, 0, 0, 0.45); |
| 81 | + font-size: 2em; |
| 82 | +} |
| 83 | +.panel p:nth-child(2) { |
| 84 | + font-size: 4em; |
| 85 | +} |
| 86 | + |
| 87 | +.panel.open { |
| 88 | + font-size:40px; |
| 89 | + flex: 5; |
| 90 | +} |
| 91 | + |
| 92 | +.cta { |
| 93 | + color:white; |
| 94 | + text-decoration: none; |
| 95 | +} |
0 commit comments