LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

Scroll Down

A glorious nature shot.

Wow. What a wonderful image. And look! there are even more images on the right side. Amazing. If you click below, I bet you'll get teleported to a magical land.

Learn more

Check out this guy.

What an interesting looking person! I wonder if they've ever climbed Mount Everest, or seen the Egyptian Pyramids. If not, I hope that one day they get to. You go random stock image person! Follow your dreams!

That is one pretty building.

I once thought about becoming an architect. I wanted to create a house fit for a king. But then I failed maths. So I became a frontend developer instead.

The future is now.

Check out that technology! Imagine if we went back in time and put one of those in the hands of a neanderthal. Do you think they'd be impressed, or just try to club us to death?

CSS
@import url(https://fonts.googleapis.com/css?family=Roboto:300,900);
body {
  font-family: 'Roboto', sans-serif;
}

.header, .footer {
  background: #2e2e2e;
  color: #fff;
  padding: 30px;
  text-align: center;
}
.header a, .footer a {
  color: #fff;
}
@media (min-width: 768px) {
  .header, .footer {
    padding: 100px 30px;
  }
}
.header h1, .footer h1 {
  font-size: 4em;
  font-weight: 300;
}
.header i.fa, .footer i.fa {
  font-size: 4em;
}
.header .bounce, .footer .bounce {
  -webkit-animation-name: bounce;
  animation-name: bounce;
  -webkit-transform-origin: center bottom;
  transform-origin: center bottom;
  animation-iteration-count: infinite;
  -webkit-animation-iteration-count: infinite;
}
.header .animated, .footer .animated {
  -webkit-animation-duration: 2s;
  animation-duration: 2s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

.section {
  width: 100%;
  position: relative;
}
.section .left, .section .middle, .section .right {
  width: 100%;
  display: block;
  color: #fff;
  box-sizing: border-box;
  left: 0;
  padding: 30px;
  text-align: center;
  overflow: hidden;
  -moz-transition: 0.3s ease-in-out all;
  -o-transition: 0.3s ease-in-out all;
  -webkit-transition: 0.3s ease-in-out all;
  transition: 0.3s ease-in-out all;
}
@media (min-width: 480px) {
  .section .left .content, .section .middle .content, .section .right .content {
    position: relative;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
  }
}
@media (min-width: 480px) {
  .section .left, .section .middle, .section .right {
    width: 50%;
    font-size: 0.9em;
    padding: 10px;
    left: 0;
    float: left;
    position: absolute;
  }
}
@media (min-width: 768px) {
  .section .left, .section .middle, .section .right {
    width: 33.33333%;
    left: 33.33%;
    padding: 10px;
  }
}
@media (min-width: 992px) {
  .section .left, .section .middle, .section .right {
    padding: 30px;
    font-size: 1em;
  }
}
.section.animate .left {
  left: 0;
}
@media (min-width: 480px) {
  .section.animate .left {
    left: 50%;
  }
}
@media (min-width: 768px) {
  .section.animate .left {
    left: 0;
  }
}
.section.animate .right {
  left: 0;
}
@media (min-width: 480px) {
  .section.animate .right {
    left: 50%;
  }
}
@media (min-width: 768px) {
  .section.animate .right {
    left: 66.66%;
  }
}
.section .title {
  background: tomato;
}
.section .title h2 {
  margin-top: 0;
}
.section .title p {
  line-height: 1.55em;
  margin-bottom: 0.75em;
}
.section .title .btn-primary {
  color: #fff;
  background: #ff3814;
  padding: 10px;
  text-decoration: none;
  border-radius: 3px;
  display: inline-block;
  -moz-transition: 0.3s ease-in-out all;
  -o-transition: 0.3s ease-in-out all;
  -webkit-transition: 0.3s ease-in-out all;
  transition: 0.3s ease-in-out all;
}
.section .title .btn-primary:hover {
  background: #fa2600;
}
.section .tiles {
  padding: 0;
  background: #fff;
  clear: both;
  display: none;
  float: none;
}
.section .tiles img {
  width: 50%;
  float: left;
  height: auto;
  opacity: 0.7;
  -moz-transition: 0.3s ease-in-out all;
  -o-transition: 0.3s ease-in-out all;
  -webkit-transition: 0.3s ease-in-out all;
  transition: 0.3s ease-in-out all;
  -webkit-filter: grayscale(100%);
  -moz-filter: grayscale(100%);
  -o-filter: grayscale(100%);
}
.section .tiles img:hover {
  opacity: 1;
  -webkit-filter: grayscale(0%);
  -moz-filter: grayscale(0%);
  -o-filter: grayscale(0%);
}
@media (min-width: 768px) {
  .section .tiles {
    display: block;
  }
}
.section .middle {
  background: slategray;
  z-index: 2;
  padding: 0;
}
.section .middle img {
  width: 100%;
  height: auto;
  display: block;
}

@-webkit-keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    -webkit-transform: translateY(0);
  }
  40% {
    -webkit-transform: translateY(-20px);
  }
  60% {
    -webkit-transform: translateY(-10px);
  }
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}
JS
$(document).ready(function(){

   var $sm = 480;
   var $md = 768;

   function resizeThis() {
      $imgH = $('.middle img').width();
      if ($(window).width() >= $sm) {
         $('.left,.right,.section').css('height', $imgH);
      } else {
         $('.left,.right,.section').css('height', 'auto');
      }
   }

   resizeThis();

   $(window).resize(function(){
      resizeThis();
   });

   $(window).scroll(function() {
      $('.section').each(function(){
         var $elementPos = $(this).offset().top;
         var $scrollPos = $(window).scrollTop();

         var $sectionH = $(this).height();
         var $h = $(window).height();
         var $sectionVert = (($h/2)-($sectionH/4));


         if (($elementPos - $sectionVert) <= $scrollPos && ($elementPos - $sectionVert) + $sectionH > $scrollPos) {
            $(this).addClass('animate');
         } else {
            $(this).removeClass('animate');
         }
      });
   });

   $('.btn-primary').click(function(){
      alert('I lied');
   });
});

$(function() {
  $('a[href*="#"]:not([href="#"])').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html, body').animate({
          scrollTop: target.offset().top
        }, 1000);
        return false;
      }
    }
  });
});

Description

A gallery that reveals three panels as the user scrolls.
Term
Mon, 11/27/2017 - 21:28

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv