LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

Attention!

Now that i have it, here is a cool message.

Attention!

Now that i have it, here is a cool message.

Attention!

Now that i have it, here is a cool message.

CSS
.c-banner {
  height: 40vw;
  margin-top: 5vw;
  position: relative;
  width: 100vw;
}
.c-banner__bg {
  height: 40vw;
  overflow: hidden;
  position: relative;
}
.c-banner__bg img {
  position: absolute;
  -o-object-fit: cover;
     object-fit: cover;
  width: 100%;
}
.c-banner--layout-one .c-banner__img {
  left: 5vw;
  opacity: 0;
  position: absolute;
  top: 5vw;
  -webkit-transform: translateY(-40vw);
          transform: translateY(-40vw);
  transition: all 0.5s cubic-bezier(0.3, -0.3, 0.25, 0.75) 0.5s;
  width: 30vw;
}
.c-banner--layout-one .c-banner__img img {
  max-width: 100%;
}
.c-banner--layout-one .c-banner__text {
  background-color: rgba(255, 255, 255, 0.75);
  left: 35vw;
  opacity: 0;
  padding: 1em;
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
  transition: all 0.5s cubic-bezier(0.3, -0.3, 0.25, 0.75);
  width: 60vw;
}
.c-banner--layout-one.is-loaded .c-banner__img {
  opacity: 1;
  -webkit-transform: translateY(0);
          transform: translateY(0);
  transition: all 0.5s cubic-bezier(0.2, 0.4, 0.6, 1.2);
}
.c-banner--layout-one.is-loaded .c-banner__text {
  opacity: 1;
  transition-delay: 0.5s;
}
.c-banner--layout-two .c-banner__img {
  left: 0;
  opacity: 0;
  -webkit-perspective: 100vw;
          perspective: 100vw;
  position: absolute;
  top: 0;
  -webkit-transform: translateX(-50vw);
          transform: translateX(-50vw);
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  transition: all 0.5s ease-out 0.5s;
  width: 45vw;
  z-index: 10;
}
.c-banner--layout-two .c-banner__img img {
  max-width: 100%;
  -webkit-transform: rotateY(20deg);
          transform: rotateY(20deg);
}
.c-banner--layout-two .c-banner__text {
  background-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0.5em -0.25em;
  left: 30vw;
  opacity: 0;
  padding: 1em;
  position: absolute;
  text-align: center;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
  transition: all 0.5s ease-out;
  width: 65vw;
}
.c-banner--layout-two.is-loaded .c-banner__img {
  opacity: 1;
  -webkit-transform: translateY(0);
          transform: translateY(0);
  transition-delay: 0;
}
.c-banner--layout-two.is-loaded .c-banner__text {
  opacity: 1;
  transition-delay: 0.5s;
}
.c-banner--layout-three .c-banner__img {
  left: 5vw;
  opacity: 0;
  position: absolute;
  top: 0;
  transition: all 0.5s ease-out;
  width: 40vw;
}
.c-banner--layout-three .c-banner__img img {
  max-width: 100%;
}
.c-banner--layout-three .c-banner__text {
  background-color: rgba(255, 255, 255, 0.75);
  bottom: 5vw;
  box-shadow: 1em 1em 1em -1em;
  left: 20vw;
  opacity: 1;
  padding: 0.5em;
  position: absolute;
  -webkit-transform: translate(100vw, 0);
          transform: translate(100vw, 0);
  transition: all 0.5s ease-out;
  width: 80vw;
}
.c-banner--layout-three.is-loaded .c-banner__img {
  opacity: 1;
}
.c-banner--layout-three.is-loaded .c-banner__text {
  opacity: 1;
  -webkit-transform: translate(0, 0);
          transform: translate(0, 0);
}

.c-button {
  background-color: transparent;
  border: 1px solid;
  color: black;
  padding: 0.25em 0.75em;
  text-decoration: none;
}

h1 {
  margin-top: 0;
}

body {
  min-height: 100vh;
}

*, *:before, *:after {
  box-sizing: border-box;
}
*, *:focus, *:active, *:focus:active, *:before, *:before:focus, *:before:active, *:before:focus:active, *:after, *:after:focus, *:after:active, *:after:focus:active {
  outline: none;
}
JS
const banner = document.querySelectorAll('.js-banner');

setInterval( function() {
  banner.forEach(thing => thing.classList.toggle('is-loaded'));
}, 3000);
Term
Sat, 04/14/2018 - 20:45

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv