<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html><html class=''>
<head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/greypants/pen/MYWMrg?limit=all&page=36&q=animation" />
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css'>
<style class="cp-pen-styles">body {
background: black;
}
#tiles {
height: 130px;
left: 50%;
margin-top: -0.5px;
opacity: 0.75;
overflow: hidden;
position: absolute;
top: 290px;
-webkit-transform: translate(-40%, -50%) rotate(45deg);
transform: translate(-40%, -50%) rotate(45deg);
width: 130px;
z-index: 2;
}
.tile {
background: #6cafb8;
display: block;
float: left;
height: 21px;
margin: 0 0 0.5px 0.5px;
width: 21px;
}
.page-intro {
color: #fff;
width: 100%;
margin: auto;
position: relative;
background-image: url("https://f.cl.ly/items/0x283w0W0R202j0c3w1T/landscape-1-full.jpg");
background-size: cover;
background-position: 50% 50%;
height: 400px;
overflow: hidden;
display: block;
}
.page-intro .page-section__title,
.page-intro a {
color: #fff;
}
.page-intro .container {
z-index: 2;
}
.page-intro:before {
background-size: 1200px 507px;
background-image: url("https://cl.ly/image/0Z2d3z3W1N0K/prism-pattern.png");
background-position: 50% 0%;
content: "";
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 0;
}
.page-intro:after {
background: -webkit-linear-gradient(top, #487380, rgba(72, 115, 128, 0)), -webkit-linear-gradient(left, rgba(72, 115, 128, 0.5), rgba(108, 175, 184, 0.5), rgba(211, 88, 158, 0.5));
background: linear-gradient(to bottom, #487380, rgba(72, 115, 128, 0)), linear-gradient(to right, rgba(72, 115, 128, 0.5), rgba(108, 175, 184, 0.5), rgba(211, 88, 158, 0.5));
content: "";
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 1;
}
</style></head><body>
<section class='page-intro'>
<div class='container'>
<div id='tiles'>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
<div class='tile'></div>
</div>
</div>
</section>
<script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script>
<script >(function() {
var TileAnimation, animation,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
TileAnimation = (function() {
function TileAnimation() {
this.animate = bind(this.animate, this);
this.setupTiles();
}
TileAnimation.prototype.animate = function() {
var now;
now = Date.now();
this.tiles.forEach(function(tile) {
var delta, opacity;
delta = tile.offset + now;
opacity = Math.sin(delta / 1000);
return tile.el.setAttribute('style', "opacity: " + opacity);
});
return setTimeout((function(_this) {
return function() {
return requestAnimationFrame(_this.animate);
};
})(this), 50);
};
TileAnimation.prototype.setupTiles = function() {
var i, len, ref, results, tile;
this.tiles = [];
ref = document.getElementsByClassName('tile');
results = [];
for (i = 0, len = ref.length; i < len; i++) {
tile = ref[i];
results.push(this.tiles.push({
el: tile,
offset: Math.random() * 10000
}));
}
return results;
};
return TileAnimation;
})();
animation = new TileAnimation();
animation.animate();
}).call(this);
//# sourceURL=pen.js
</script>
</body></html>