*, *:before, *:after { box-sizing: border-box; margin: 0; padding: 0; } html, body { font-size: 62.5%; height: 100%; overflow: hidden; } $openSans: 'Open Sans', Helvetica, Arial, sans-serif; $bg1: 'http://i.imgur.com/653n5b8.jpg'; $bg2: 'http://i.imgur.com/sgd4qub.jpg'; $bg3: 'http://i.imgur.com/j9u7AY4.jpg'; $bg4: 'http://i.imgur.com/KruZmzA.jpg'; $bg5: 'http://i.imgur.com/3pu2X8D.jpg'; $elN: 4; $timeoutDelay: 2s; $timeoutTime: 6s; .instant { transition: 0 0 !important; } .scene { position: relative; height: 100%; background: #fff; transition: transform 0.5s; will-change: transform; &.menu-visible { .menu__btn { background: #000; color: #000; &:after { transform: scale(1.5) !important; } } .menu__heading { opacity: 1; transition: opacity 0.5s 1.7s; } } } .content { position: relative; height: 100%; transition: transform 0.6s, opacity 0.4s 0.1s; will-change: transform, opacity; &.inactive { opacity: 0; transform: scale(0.9); } } .back, .front { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transition: transform 0.5s 0.5s; will-change: transform; &__bg { position: absolute; left: 0; width: 100%; height: 100%; background-size: cover; transition: transform 0.5s; will-change: transform; &-1 { background-image: url(#{$bg1}); } &-2 { background-image: url(#{$bg2}); } &-3 { background-image: url(#{$bg3}); } &-4 { background-image: url(#{$bg4}); } } } .back__bg { &.hidden { display: none; } &:after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); } @for $i from 1 through $elN { &-#{$i} { top: ($i - 1) * 100%; } } } .front__bg { transform: scale(0.8); &.active { transform: scale(1); } &:after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.25); } @for $i from 0 through $elN { &-#{$i} { top: ($i - 1) * -100%; } } } .nav { position: absolute; left: 0; bottom: 20%; width: 100%; text-align: center; &__el { display: inline-block; position: relative; font-size: 2.5rem; height: 3.5rem; text-transform: uppercase; color: rgba(255,255,255,.5); font-family: $openSans; margin: 1rem 2rem; padding-left: 1.5rem; cursor: pointer; overflow: hidden; &-clone { position: absolute; top: 0; left: 0; overflow: hidden; transition: transform 0.5s; will-change: transform; transform: translateX(-100%); > div { margin: 0; color: #fff; transition: transform 0.5s; will-change: transform; transform: translateX(100%); } } &.active { &:after { transform: scale(1); } .nav__el-clone { transform: scale(1); transition: transform $timeoutTime $timeoutDelay; .nav__el { transform: scale(1); transition: transform $timeoutTime $timeoutDelay; } } } &:before { position: absolute; top: 50%; margin-top: -1rem; left: -0.3rem; font-size: 1.5rem; transform: rotate(-90deg); } &:after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: #fff; transition: transform 1.5s; transform: scale(0); } @for $i from 1 through $elN { &-#{$i}:before { content: "0" + $i; } } } } .menu { &__btn { z-index: 5; position: absolute; top: 5%; right: 5%; width: 5.2rem; height: 5.2rem; border: 2px solid; color: #fff; overflow: hidden; cursor: pointer; transition: background-color 0.5s; &:hover { &:after { transform: scale(1); } .menu__btn-line { @for $i from 1 through 3 { &:nth-child(#{$i}) { animation: animateMenuBtn 0.7s ($i - 1)*0.2s; } } } } &:after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0.5rem solid #fff; transition: transform 0.6s; will-change: transform; transform: scale(1.5); } &-inner { position: absolute; top: 1.6rem; left: 1.2rem; width: 2.4rem; height: 1.6rem; overflow: hidden; } &-line { position: absolute; left: 0; width: 100%; height: 2px; background: #fff; &:nth-child(1) { top: 0; } &:nth-child(2) { top: 0.7rem; } &:nth-child(3) { top: 1.4rem; } } } &__block { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; text-align: center; &.visible { display: block; } &-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-image: url(#{$bg5}); } &-svg { overflow: visible; display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; &Path { fill: #fff; } } } &__heading { position: absolute; max-width: 60rem; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); font-size: 4rem; color: #000; text-transform: uppercase; opacity: 0; transition: opacity 0.3s; text-align: center; } } @keyframes animateMenuBtn { 49.9% { transform: translateX(100%); } 50% { transform: translateX(-100%); } 100% { transform: translateX(0); } }