var app = angular.module('fox-scrollReveal-example', ['fox.scrollReveal']);
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body ng-app="fox-scrollReveal-example">
<div class="column-container clearfix" data-sr-container='{ "reset":true, "vFactor": 0.2 }'>
<!-- col 1 -->
<div class="column">
<div class="block block-1x block-slate" data-sr="enter top over 3s after 0.5s"></div>
<div class="block block-2x block-mango" data-sr="enter right after 0.5s"></div>
<div class="block block-1x block-kiwi" data-sr="enter bottom over 1s and move 300px after 0.3s"></div>
<div class="block block-3x block-blueberry" data-sr="enter top over 0.5s and move 200px"></div>
<div class="block block-2x block-raspberry" data-sr="enter bottom over 1s and move 100px"></div>
<div class="block block-1x block-grape" data-sr="enter top"></div>
</div>
<!-- col 2 -->
<div class="column">
<div class="block block-3x block-kiwi" data-sr="enter bottom over 1s and move 300px after 0.3s"></div>
<div class="block block-1x block-orange" data-sr="enter left"></div>
<div class="block block-2x block-grape" data-sr="enter top"></div>
<div class="block block-1x block-orange" data-sr="enter left"></div>
<div class="block block-1x block-grape" data-sr="enter top"></div>
<div class="block block-2x block-slate" data-sr="enter top over 3s after 0.5s"></div>
</div>
<!-- col 3 -->
<div class="column">
<div class="block block-2x block-raspberry" data-sr="enter bottom over 1s and move 100px"></div>
<div class="block block-1x block-blueberry" data-sr="enter top over 0.5s and move 200px"></div>
<div class="block block-2x block-slate" data-sr="enter top over 3s after 0.5s"></div>
<div class="block block-1x block-mango" data-sr="enter right after 0.5s"></div>
<div class="block block-1x block-slate" data-sr="enter top over 3s after 0.5s"></div>
<div class="block block-3x block-orange" data-sr="enter left"></div>
</div>
<!-- col 4 -->
<div class="column">
<div class="block block-1x block-orange" data-sr="enter left"></div>
<div class="block block-2x block-grape" data-sr="enter top"></div>
<div class="block block-3x block-raspberry" data-sr="enter bottom over 1s and move 100px"></div>
<div class="block block-1x block-blueberry" data-sr="enter top over 0.5s and move 200px"></div>
<div class="block block-2x block-kiwi" data-sr="enter bottom over 1s and move 300px after 0.3s"></div>
<div class="block block-1x block-mango" data-sr="enter right after 0.5s"></div>
</div>
<!-- col 5 -->
<div class="column">
<div class="block block-3x block-mango" data-sr="enter right after 0.5s"></div>
<div class="block block-1x block-kiwi" data-sr="enter bottom over 1s and move 300px after 0.3s"></div>
<div class="block block-2x block-orange" data-sr="enter left"></div>
<div class="block block-1x block-grape" data-sr="enter top"></div>
<div class="block block-1x block-slate" data-sr="enter top over 3s after 0.5s"></div>
<div class="block block-2x block-raspberry" data-sr="enter bottom over 1s and move 100px"></div>
</div>
<!-- col 6 -->
<div class="column">
<div class="block block-1x block-kiwi" data-sr="enter bottom over 1s and move 300px after 0.3s"></div>
<div class="block block-3x block-slate" data-sr="enter top over 3s after 0.5s"></div>
<div class="block block-1x block-blueberry" data-sr="enter top over 0.5s and move 200px"></div>
<div class="block block-3x block-kiwi" data-sr="enter bottom over 1s and move 300px after 0.3s"></div>
<div class="block block-1x block-orange" data-sr="enter left"></div>
<div class="block block-1x block-blueberry" data-sr="enter top over 0.5s and move 200px"></div>
</div>
<!-- col 7 -->
<div class="column">
<div class="block block-2x block-blueberry" data-sr="enter top over 0.5s and move 200px"></div>
<div class="block block-1x block-raspberry" data-sr="enter bottom over 1s and move 100px"></div>
<div class="block block-1x block-mango" data-sr="enter right after 0.5s"></div>
<div class="block block-3x block-raspberry" data-sr="enter bottom over 1s and move 100px"></div>
<div class="block block-2x block-mango" data-sr="enter right after 0.5s"></div>
<div class="block block-1x block-slate" data-sr="enter top over 3s after 0.5s"></div>
</div>
<!-- col 8 -->
<div class="column">
<div class="block block-1x block-grape" data-sr="enter top"></div>
<div class="block block-2x block-orange" data-sr="enter left"></div>
<div class="block block-1x block-grape" data-sr="enter top"></div>
<div class="block block-3x block-slate" data-sr="enter top over 3s after 0.5s"></div>
<div class="block block-1x block-blueberry" data-sr="enter top over 0.5s and move 200px"></div>
<div class="block block-2x block-kiwi" data-sr="enter bottom over 1s and move 300px after 0.3s"></div>
</div>
</div>
<script data-require="angular.js@1.3.x" src="https://code.angularjs.org/1.3.1/angular.js" data-semver="1.3.1"></script>
<script src="https://rawgit.com/julianlloyd/scrollReveal.js/v2.1.0/scrollReveal.js"></script>
<script src="fox-scrollReveal.js"></script>
<script src="app.js"></script>
</body>
</html>
/* Put your css in here */
/* Styles go here */
[data-sr] {
visibility: hidden;
}
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
.floater {
padding: 18px 32px;
background: #18212E;
color: white;
border-radius: 64px;
-moz-border-radius: 64px;
-webkit-border-radius: 64px;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
a {
cursor: pointer;
}
* {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
h1, .h1 {
font-family: "proxima-nova", sans-serif;
font-weight: 100;
}
html, body {
font-family: "proxima-nova", sans-serif;
font-weight: 300;
}
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
html, body {
color: white;
text-align: center;
}
@media screen and (min-width: 300px) {
html, body {
font-size: 14px;
}
}
@media screen and (min-width: 460px) {
html, body {
font-size: 20px;
}
}
@media screen and (min-width: 900px) {
html, body {
font-size: 24px;
}
}
h1, .h1 {
line-height: 1.166;
margin: .66em 0;
}
@media screen and (min-width: 300px) {
h1, .h1 {
font-size: 2.33em;
}
}
@media screen and (min-width: 460px) {
h1, .h1 {
font-size: 2.66em;
}
}
@media screen and (min-width: 720px) {
h1, .h1 {
font-size: 3.33em;
}
}
p {
color: #616c84;
margin: 0.33em 0;
}
a.inline:link,
a.inline:visited {
color: #35ff99;
text-decoration: none;
border-radius: 5px;
padding: 2px;
}
a.inline:hover,
a.inline:active {
background: #35ff99;
color: #202a39;
}
small {
font-size: .75em;
}
em {
font-style: italic;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
html, body {
height: 100%;
background: #202a39;
}
.column-container {
width: 80%;
max-width: 1000px;
margin: 0 auto;
overflow: hidden;
height: 250%;
text-align: center;
}
@media screen and (min-width: 300px) {
.column-container {
padding-top: 20%;
margin-bottom: -125px;
}
}
@media screen and (min-width: 720px) {
.column-container {
padding-top: 10%;
}
}
.column {
width: 3%;
height: 100%;
margin: 0 2%;
display: inline-block;
}
.block {
border-radius: 5px;
margin-bottom: 150%;
}
.block-1x {
height: 10%;
}
.block-2x {
height: 15%;
}
.block-3x {
height: 20%;
}
.block-blueberry {
background: #008597;
}
.block-slate {
background: #2d3443;
}
.block-grape {
background: #4d407c;
}
.block-raspberry {
background: #ff005d;
}
.block-mango {
background: #ffcc00;
}
.block-orange {
background: #ff7c35;
}
.block-kiwi {
background: #35ff99;
}
.withLove {
overflow: hidden;
text-align: center;
padding-bottom: 2em;
cursor: default;
color: #616c84;
}
@media screen and (min-width: 900px) {
.withLove {
margin-top: 125px;
}
}
.withLove * {
display: inline-block;
}
.withLove .alpha,
.withLove .omega {
width: 40%;
}
.withLove .alpha {
text-align: right;
}
.withLove .omega {
text-align: left;
}
.withLove .heart {
margin: 0 -2px;
position: relative;
z-index: 3;
-webkit-animation: throb 1.33s ease-in-out infinite;
animation: throb 1.33s ease-in-out infinite;
}
.withLove .heart path {
fill: #ff005d;
}
@media screen and (min-width: 300px) {
.withLove .heart {
width: 30px;
height: 30px;
top: .66em;
}
}
@media screen and (min-width: 460px) {
.withLove .heart {
top: .8em;
width: 50px;
height: 50px;
}
}
@-webkit-keyframes throb {
0% {
-webkit-transform: scale(1);
}
50% {
-webkit-transform: scale(0.8);
}
100% {
-webkit-transform: scale(1);
}
}
@keyframes throb {
0% {
transform: scale(1);
}
50% {
transform: scale(0.8);
}
100% {
transform: scale(1);
}
}
(function (angular, ScrollReveal) {
'use strict';
angular.module('fox.scrollReveal', [
]).controller('ScrollRevealCtrl', ['$scope', '$timeout',
function ($scope, $timeout) {
var timeout, self = this;
var defaultOpts = {};
this.setOpts = function (opts) {
angular.extend(defaultOpts, opts || {});
if (!this.scrollReveal) {
this.scrollReveal = new ScrollReveal(defaultOpts);
$scope.$emit('scrollReveal.created');
}
};
this.scheduleInit = function () {
if (timeout) {
$timeout.cancel(timeout);
}
timeout = $timeout(function runScrollReveal() {
$timeout(function () {
$scope.$emit('scrollReveal.init');
self.scrollReveal.init();
}, 50);
}, 30);
};
}
]).directive('srContainer', function () {
return {
retrict: 'EA',
controller: 'ScrollRevealCtrl',
link: {
pre: function (scope, element, attrs, ctrl) {
ctrl.setOpts(angular.fromJson(attrs.srContainer || '{}'));
}
}
};
}).directive('sr', function () {
return {
retrict: 'A',
require: '^srContainer',
link: function link(scope, element, attrs, ctrl) {
var index;
ctrl.scheduleInit();
element.on('$destroy', function () {
ctrl.scheduleInit();
});
scope.$watch('$index', function () {
if (index !== undefined && index !== scope.$index) {
ctrl.scheduleInit();
}
index = scope.$index;
});
}
};
});
}(window.angular, window.scrollReveal));