Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <section id="tile-wrapper" class="tile-wrapper">
		<div class="tiles" index="1">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="2">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="3">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="4">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="5">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="6">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="7">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="8">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="9">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="10">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="11">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
		<div class="tiles" index="12">
			<h3>some text as an example</h3>
			<img src="https://s18.postimg.org/4c66av5w9/prof.png" alt="prof" />
			<span class="name">john doe</span>
			<span class="desc">new text</span>
		</div>
	</section>
              
            
!

CSS

              
                /* variables */
$color1: #005daf;
$color2: #22a62e;
$num: 1;
$img-list: 'wh8cjfzwz','esglrto5v','83a2bt2tv','96u6nrngz','7t7567dlf','o5h6vxrwz','4c5338ej7','niia6ev0z','41xkjvzwz','437idb1qr','taiedk4ur','pff0azloz';
$hover-i: url("https://s11.postimg.org/7dvvd6ro3/background.jpg");

.tile-wrapper  {
  background-image: url("https://s11.postimg.org/7dvvd6ro3/background.jpg");
  background-size: 100%;
  background-repeat:no-repeat;
  height:100vh;
  width: 100vw;
  background-position: center;
  transition: all 1s ease-in-out;
  /* tile styles*/
  .tiles {
    color: #fff;
    height: percentage(1 / 3);
    width: percentage(1 / 4);
    float: left;
    position: relative;
    h3 {
      font-weight: normal;
      float: right;
      opacity: 0;
    }
    img {
      position: absolute;
      bottom: 0px;
      height: 60px;
      width: 60px;
      border-radius: 50%;
      opacity: 0;
    }
    span {
      position: absolute;
      bottom: 10px;
      right: 15px;
    }
    .desc {
      opacity: 0;
    }
    &:hover {
      *{
        transition: all .75s ease-in-out;
      }
      img,.desc,h3 {
        opacity: 1;
      }
      img {
        transform: translate(15px,-15px);
      }
      h3 {
        transform: translateX(-15px);
      }
      .name {
        transform: translateY(-20px);
      }
    }
  }
}

/* for bit.ly urls */

@each $img in $img-list {
    .hover-#{$num} {
      background-image: url("https://s11.postimg.org/#{$img}/image.jpg");
      background-size: 100%;
      transition: all 1s ease-in-out;
    }
    .tiles[index="#{$num}"] {
      background-color: mix($color1, $color2, percentage($num / ($num + 2)));
      opacity: 0;
      &:hover {
        opacity: 0.8;
      }
    }
    $num: $num + 1;
}

/* for folder based images */

// @for $num from 1 through 12 {
//     .hover-#{$num} {
//       background-image: url("../images/#{$num}.jpg");
//       background-size: 105%;
//       transition: all 1s ease-in-out;
//     }
//     .tiles[index="#{$num}"] {
//       background-color: mix($color1, $color2, percentage($num / ($num + 2)));
//       opacity: 0;
//       &:hover {
//         opacity: 0.8;
//       }
//     }
// }
              
            
!

JS

              
                // jQuery with css example

  var index = 0;
  var hovEnter;
  var hovLeave;
  $( ".tiles" )
  .mouseenter(function() {
    $(".tile-wrapper").removeClass(hovLeave,1500,"easeInOut");
    index = $(this).attr("index");
    hovEnter = "hover-"+index;
    hovLeave = hovEnter;
    $(".tile-wrapper").addClass(hovEnter,1500,"easeInOut");
  });
$(document).ready(function(){
  for (var i = 1; i <= 12; i++) {
    $(".tiles[index="+i+"]").mouseenter();
  }
});
              
            
!
999px

Console