update graphs and styles

This commit is contained in:
Daniel Kummer 2012-08-09 11:28:23 +02:00
parent 1b9e63e912
commit 65b23492c5
32 changed files with 87310 additions and 815 deletions

View File

@ -1,26 +1,3 @@
/*---------------------------------------- Colors */
/*.color1 {
background-color: lightskyblue;
}
.color2 {
background-color: lightblue;
}
.color3 {
background-color: deepskyblue;
}
.color4 {
background-color: darkturquoise;
}
.color5 {
background-color: cornflowerblue;
}
*/
/*---------------------------------------- Text */
body {
@ -101,16 +78,13 @@ ul {
padding-left: 1em;
text-indent: -1em;
text-shadow: 0 2px 1px #fff;
line-height: 1.4;
}
ul li:before {
content: "\2605\a0"
}
.download {
padding: 10px;
}
/** coding block */
blockquote {
text-align: left;
@ -137,12 +111,93 @@ code {
/*---------------------------------------- Images */
div#init-img {
.initialize {
background: url("../img/initialize.png") no-repeat scroll center center transparent;
height: 300px;
width: 300px;
width: 100%;
position: relative;
z-index: 99;
margin-left: 10px;
}
.lines-small {
width: 500px;
height: 150px;
background-repeat: repeat-y;
background: url("../img/lines-small.png");
position: relative;
}
.lines-small-end {
width: 500px;
height: 464px;
background-repeat: repeat-y;
background: url("../img/lines-small.png");
position: absolute;
}
.lines-big {
width: 500px;
height: 5620px;
background-repeat: repeat-y;
background: url("../img/lines-big.png");
position: absolute;
}
.lines-open {
width: 500px;
height: 86px;
background: url("../img/lines-open.png");
}
.lines-close {
width: 500px;
height: 86px;
background: url("../img/lines-close.png");
}
.hotfix-end, .hotfix-start, .release-end, .release-start, .feature-end, .feature-start {
display: inline-block;
background-repeat: no-repeat;
background-image: url('../img/flow-sprites.png');
background-color: rgba(173, 215, 223, 0.8);
border: 2px dashed #008098;
border-radius: 25px;
width: 500px;
height: 370px;
position: relative;
z-index: 99;
box-shadow: 5px 5px 7px #8db7bd;
-webkit-box-shadow: 5px 5px 7px #8db7bd;
-moz-box-shadow: 5px 5px 7px #8db7bd;
}
.hotfix-end {
background-position: 0px 0px;
}
.hotfix-start {
background-position: 0px -370px;
}
.release-end {
background-position: 0px -740px;
}
.release-start {
background-position: 0px -1110px;
}
.feature-end {
background-position: 0px -1480px;
}
.feature-start {
background-position: 0px -1850px;
}
/*---------------------------------------- BLOCKS */
@ -158,10 +213,6 @@ div#init-img {
margin-left: 30px;
}
/*.col-2:after {
clear: both;
}*/
#main {
margin: 0 auto;
position: relative;
@ -169,14 +220,10 @@ div#init-img {
}
.scrollblock {
position: relative;
margin: 0;
width: 100%;
min-height: 600px;
}
.scrollblock h2 {
padding-top: 100px;
min-height: 450px;
position: relative;
}
.divider, .accent {
@ -184,24 +231,6 @@ div#init-img {
text-shadow: none;
}
#console {
display: none;
position: fixed;
top: 0;
left: 15px;
width: 500px;
margin: 0;
font-size: 14px;
font-style: italic;
background-color: #69697A;
text-shadow: none;
text-align: left;
padding: 3px 10px;
border-radius: 0 0 10px 10px;
z-index: 99;
opacity: .8;
}
#title {
margin: auto;
padding-top: 40px;
@ -234,50 +263,6 @@ div#init-img {
width: 100%;
}
#head-img {
position: relative;
top: 200px;
}
#download {
position: absolute;
top: 380px;
font-size: 18px;
width: 100%;
line-height: 1.8;
}
#download a {
color: #69697A;
}
#examples-pin {
height: 500px;
}
.param-list {
color: #C5C3DE;
font-size: 18px;
line-height: 1.4;
padding: 0 18px;
}
.param-list li {
padding-bottom: 20px;
text-shadow: 0 2px 1px #000;
}
.param {
display: block;
color: #69697A;
}
.param-def small {
display: block;
font-weight: normal;
font-style: italic;
}
#disqus_thread {
width: 800px;
text-align: left;
@ -285,7 +270,7 @@ div#init-img {
margin-right: auto;
}
/*---------------------------------------- Banner */
/*---------------------------------------- Github Banner */
#banner {
height: 149px;
width: 149px;
@ -339,95 +324,3 @@ div#init-img {
}
.small {
width: 496px;
height: 2600px;
background-repeat: repeat-y;
background: url("../img/small.png");
position: absolute;
top: 0;
}
.small-end {
width: 496px;
height: 985px;
background-repeat: repeat-y;
background: url("../img/small.png");
position: relative;
}
.big {
width: 496px;
height: 6285px;
background-repeat: repeat-y;
background: url("../img/big.png");
position: absolute;
left: 703px;
}
#open {
width: 496px;
height: 215px;
background: url("../img/opening.png");
background-repeat: no-repeat;
}
#closing {
width: 496px;
height: 215px;
background-repeat: no-repeat;
background: url("../img/closing.png");
}
#feature-start {
width: 496px;
height: 302px;
background-position: -0px -259px;
background-repeat: no-repeat;
}
#feature-finish {
width: 496px;
height: 331px;
background-position: -0px -561px;
background-repeat: no-repeat;
}
#release-start {
width: 496px;
height: 297px;
background-position: -0px -892px;
background-repeat: no-repeat;
}
#release-finish {
width: 496px;
height: 331px;
background-position: -0px -1189px;
background-repeat: no-repeat;
}
#hotfix-start {
width: 496px;
height: 303px;
background-position: -0px -1520px;
background-repeat: no-repeat;
}
#hotfix-finish {
width: 496px;
height: 333px;
background-position: -0px -1823px;
background-repeat: no-repeat;
}
#feature-start, #feature-finish, #release-start, #release-start, #hotfix-start, #hotfix-finish {
background-image: url("../img/git-flow-process.png");
background-color: rgba(163, 167, 251, 0.5);
border: 7px solid #008098;
border-radius: 25px;
}

BIN
files/graphs.psd Normal file

Binary file not shown.

Binary file not shown.

BIN
files/new_opener.psd Normal file

Binary file not shown.

BIN
files/opener_for_graphs.psd Normal file

Binary file not shown.

87201
files/sprites.sprweb Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

BIN
img/feature-end.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
img/flow-sprites.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

BIN
img/hotfix-end.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 14 KiB

BIN
img/lines-big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

BIN
img/lines-close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
img/lines-open.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
img/lines-small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

BIN
img/release-end.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -7,10 +7,8 @@
<link href='http://fonts.googleapis.com/css?family=Sansita+One' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/normalize.css" type="text/css">
<link rel="stylesheet" href="css/style.css" type="text/css">
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery.scrollorama.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
@ -28,11 +26,7 @@
</script>
</head>
<body>
<p id="console"></p>
<div id="banner"><a href="">Fork me on GitHub</a></div>
<header>
<h1 id="title">git-flow cheatsheet</h1>
@ -50,30 +44,14 @@
}
}(document, "script", "twitter-wjs");</script>
</p>
<p id="desc">efficient branching using git-flow by <a href="http://nvie.com/">Vincent Driessen</a></p>
<!-- <p id="download">
<span class="accent">&bigstar;</span>
<a href="files/git-flow-cheatsheet.pdf"
onClick="recordOutboundLink(this, 'Cheat Sheet', 'git-flow-cheatsheet');return false;" class="download">Download
as pdf</a>
<span class="accent">&bigstar;</span>
</p>-->
</header>
<div id="main">
<div>
<div class="col-1"></div>
<div class="col-2">
<div class="small"></div>
</div>
</div>
<div class="scrollblock">
<h2 id="animate1">About</h2>
<h2>About</h2>
<p>
git-flow are a set of git extensions to provide high-level repository operations for Vincent
@ -88,7 +66,7 @@
</div>
<div class="scrollblock">
<h2 id="animate2">Basic tips</h2>
<h2>Basic tips</h2>
<ul>
<li>Git flow provides excellent command line help and output. Read it carefully to see what's happening...</li>
<li>The OSX Client <a href="http://www.sourcetreeapp.com/">Sourcetree</a> is an excellent git gui and provides
@ -130,7 +108,7 @@
</div>
<div class="scrollblock">
<h2 id="animate3">Getting started</h2>
<h2>Getting started</h2>
<div class="col-1">
<h3>Initialize</h3>
@ -148,21 +126,16 @@
</div>
<div class="col-2">
<img src="img/initialize.png" alt="initialize"/>
<div class="initialize"></div>
<div class="lines-small"></div>
<div class="lines-open"></div>
<div class="lines-big"></div>
</div>
</div>
<div class="scrollblock">
<div class="col-1"></div>
<div class="col-2">
<div id="open"></div>
<div class="big"></div>
</div>
</div>
<div class="scrollblock" style="height: 900px;">
<h2 id="animate4">Features</h2>
<div class="scrollblock" style="height: 600px;">
<h2>Features</h2>
<ul class="narrow">
<li>Develop new features for upcoming releases</li>
<li>Typically exist in developers repos only</li>
@ -191,11 +164,9 @@
-->
</div>
<div class="col-2">
<div id="feature-start"></div>
<div class="feature-start"></div>
</div>
</div>
@ -220,7 +191,7 @@
</blockquote>
</div>
<div class="col-2">
<div id="feature-finish"></div>
<div class="feature-end"></div>
</div>
</div>
@ -265,7 +236,7 @@
<div class="scrollblock" style="height: 900px;">
<h2 id="animate5">Make a release</h2>
<h2>Make a release</h2>
<ul>
<li>Support preparation of a new production release</li>
@ -288,7 +259,7 @@
'develop' branch.</p>
</div>
<div class="col-2">
<div id="release-start"></div>
<div class="release-start"></div>
</div>
</div>
@ -318,13 +289,13 @@
</blockquote>
</div>
<div class="col-2">
<div id="release-finish"></div>
<div class="release-end"></div>
<p>(You can track a remote release with the <br/><code>git flow release track RELEASE</code> command)</p>
</div>
</div>
<div class="scrollblock" style="height: 800px;">
<h2 id="animate6">Hotfixes</h2>
<h2>Hotfixes</h2>
<ul>
<li>Hotfixes arise from the necessity to act immediately upon an undesired state of a live production version
@ -344,7 +315,7 @@
<p>The release argument hereby marks the faulty production release</p>
</div>
<div class="col-2">
<div id="hotfix-start"></div>
<div class="hotfix-start"></div>
</div>
</div>
@ -355,15 +326,15 @@
<p>TODO</p>
</div>
<div class="col-2">
<div id="hotfix-finish"></div>
<div class="hotfix-finish"></div>
</div>
</div>
<div class="scrollblock">
<div>
<div class="col-1"></div>
<div class="col-2">
<div id="closing"></div>
<div class="small-end"></div>
<div class="lines-close"></div>
<div class="lines-small-end"></div>
</div>
</div>
@ -389,54 +360,6 @@
</footer>
<script type="text/javascript">
$(document).ready(function () {
var scrollorama = $.scrollorama({
blocks:'.scrollblock',
enablePin:false
});
var colorClassMatcher = function (index, classname) {
var matches = classname.match(/color\d+/g) || [];
return (matches.join(' '));
};
// assign function to add behavior for onBlockChange event
scrollorama.onBlockChange(function () {
var i = scrollorama.blockIndex;
$('#console').css('display', 'block').text('onBlockChange | blockIndex:' + i + ' | current block: ' + scrollorama.settings.blocks.eq(i).attr('id'));
$('body').removeClass(colorClassMatcher);
$('body').addClass('color' + i);
});
/*
var animationOptions = { delay:300, duration:250, property:'left', start:-1400, end:0 };
scrollorama.animate('#animate1', animationOptions);
scrollorama.animate('#animate2', animationOptions);
scrollorama.animate('#animate3', animationOptions);
scrollorama.animate('#animate4', animationOptions);
scrollorama.animate('#animate5', animationOptions);
scrollorama.animate('#animate6', animationOptions);
/*
scrollorama.animate('.fly-in', { delay:300, duration:200, property:'left', start:-1400, end:0 });
scrollorama.animate('#animate', { delay:200, duration:600, property:'zoom', start:0 });
// animate some examples
scrollorama.animate('#unpin', { duration:500, property:'padding-top', start:400, pin:true });
scrollorama.animate('#fade-in', { delay:400, duration:300, property:'opacity', start:0 });
scrollorama.animate('#rotate-in', { duration:800, property:'rotate', start:720 });
scrollorama.animate('#any', { delay:700, duration:200, property:'opacity', start:0 });
scrollorama.animate('#any', { delay:800, duration:200, property:'letter-spacing', start:18 });
// animate the parallaxing
scrollorama.animate('#parallax2', { delay:400, duration:600, property:'top', start:800, end:-800 });
scrollorama.animate('#parallax3', { delay:200, duration:1200, property:'top', start:500, end:-500 });*/
});
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'gitflowcheatsheet'; // required: replace example with your forum shortname

File diff suppressed because one or more lines are too long

View File

@ -1,518 +0,0 @@
/*
scrollorama - The jQuery plugin for doing cool scrolly stuff
by John Polacek (@johnpolacek)
Dual licensed under MIT and GPL.
*/
(function($) {
$.scrollorama = function(options) {
var scrollorama = this,
blocks = [],
browserPrefix = '',
onBlockChange = function() {},
latestKnownScrollY = 0,
ticking = false,
requestAnimFrame = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function( callback ){
window.setTimeout(callback, 1000 / 60);
},
defaults = {offset:0, enablePin: true};
scrollorama.settings = $.extend({}, defaults, options);
scrollorama.blockIndex = 0;
if (options.blocks === undefined) { alert('ERROR: Must assign blocks class selector to scrollorama plugin'); }
// PRIVATE FUNCTIONS
function init() {
var i, block, didScroll = false;
if (typeof scrollorama.settings.blocks === 'string') { scrollorama.settings.blocks = $(scrollorama.settings.blocks); }
// set browser prefix
if ($.browser.mozilla) { browserPrefix = '-moz-'; }
if ($.browser.webkit) { browserPrefix = '-webkit-'; }
if ($.browser.opera) { browserPrefix = '-o-'; }
if ($.browser.msie) { browserPrefix = '-ms-'; }
// create blocks array to contain animation props
$('body').css('position','relative');
for (i=0; i<scrollorama.settings.blocks.length; i++) {
block = scrollorama.settings.blocks.eq(i);
blocks.push({
block: block,
top: block.offset().top - parseInt(block.css('margin-top'), 10),
pin: 0,
animations:[]
});
}
// convert block elements to absolute position
if (scrollorama.settings.enablePin.toString() === 'true') {
for (i=0; i<blocks.length; i++) {
blocks[i].block
.css('position', 'absolute')
.css('top', blocks[i].top);
}
}
$('body').prepend('<div id="scroll-wrap"></div>');
latestKnownScrollY = 0;
ticking = false;
$(window).on( 'scroll.scrollorama', onScroll );
}
function onScroll() {
latestKnownScrollY = window.scrollY;
requestTick();
}
function requestTick() {
if(!ticking) {
requestAnimFrame(function(){
onScrollorama();
update();
});
}
ticking = true;
}
function update() {
// reset the tick so we can
// capture the next onScroll
ticking = false;
}
function onScrollorama() {
var scrollTop = $(window).scrollTop(),
currBlockIndex = getCurrBlockIndex(scrollTop),
i, j, anim, startAnimPos, endAnimPos, animPercent, animVal;
// update all animations
for (i=0; i<blocks.length; i++) {
// go through the animations for each block
if (blocks[i].animations.length) {
for (j=0; j<blocks[i].animations.length; j++) {
anim = blocks[i].animations[j];
// if above current block, settings should be at start value
if (i > currBlockIndex) {
if (currBlockIndex !== i-1 && anim.baseline !== 'bottom') {
setProperty(anim.element, anim.property, anim.startVal);
}
if (blocks[i].pin) {
blocks[i].block
.css('position', 'absolute')
.css('top', blocks[i].top);
}
}
// if below current block, settings should be at end value
// unless on an element that gets animated when it hits the bottom of the viewport
else if (i < currBlockIndex) {
setProperty(anim.element, anim.property, anim.endVal);
if (blocks[i].pin) {
blocks[i].block
.css('position', 'absolute')
.css('top', (blocks[i].top + blocks[i].pin));
}
}
// otherwise, set values per scroll position
if (i === currBlockIndex || (currBlockIndex === i-1 && anim.baseline === 'bottom')) {
// if block gets pinned, set position fixed
if (blocks[i].pin && currBlockIndex === i) {
blocks[i].block
.css('position', 'fixed')
.css('top', 0);
}
// set start and end animation positions
startAnimPos = blocks[i].top + anim.delay;
if (anim.baseline === 'bottom') { startAnimPos -= $(window).height(); }
endAnimPos = startAnimPos + anim.duration;
// if scroll is before start of animation, set to start value
if (scrollTop < startAnimPos) {
setProperty(anim.element, anim.property, anim.startVal);
}
// if scroll is after end of animation, set to end value
else if (scrollTop > endAnimPos) {
setProperty(anim.element, anim.property, anim.endVal);
if (blocks[i].pin) {
blocks[i].block
.css('position', 'absolute')
.css('top', (blocks[i].top + blocks[i].pin));
}
}
// otherwise, set value based on scroll
else {
// calculate percent to animate
animPercent = (scrollTop - startAnimPos) / anim.duration;
// account for easing if there is any
if ( anim.easing && $.isFunction( $.easing[anim.easing] ) ) {
animPercent = $.easing[anim.easing]( animPercent, animPercent*1000, 0, 1, 1000 );
}
// then multiply the percent by the value range and calculate the new value
animVal = anim.startVal + (animPercent * (anim.endVal - anim.startVal));
setProperty(anim.element, anim.property, animVal);
}
}
}
}
}
// update blockIndex and trigger event if changed
if (scrollorama.blockIndex !== currBlockIndex) {
scrollorama.blockIndex = currBlockIndex;
onBlockChange();
}
}
function getCurrBlockIndex(scrollTop) {
var currBlockIndex = 0, i;
for (i=0; i<blocks.length; i++) {
// check if block is in view
if (blocks[i].top <= scrollTop - scrollorama.settings.offset) { currBlockIndex = i; }
}
return currBlockIndex;
}
function setProperty(target, prop, val) {
var scaleCSS, currentPosition;
if (prop === 'rotate' || prop === 'zoom' || prop === 'scale') {
if (prop === 'rotate') {
target.css(browserPrefix+'transform', 'rotate('+val+'deg)');
} else if (prop === 'zoom' || prop === 'scale') {
scaleCSS = 'scale('+val+')';
if (browserPrefix !== '-ms-') {
target.css(browserPrefix+'transform', scaleCSS);
} else {
target.css('zoom', scaleCSS);
}
}
}
else if(prop === 'background-position-x' || prop === 'background-position-y' ) {
currentPosition = target.css('background-position').split(' ');
if(prop === 'background-position-x') {
target.css('background-position',val+'px '+currentPosition[1]);
}
if(prop === 'background-position-y') {
target.css('background-position', currentPosition[0]+' '+val+'px');
}
}
else if(prop === 'text-shadow' ) {
target.css(prop,'0px 0px '+val+'px #ffffff');
} else {
target.css(prop, val);
}
}
// PUBLIC FUNCTIONS
scrollorama.animate = function(target) {
var targetIndex,
targetBlock,
anim,
offset,
i, j;
/*
target = animation target
arguments = array of animation parameters
anim = object that contains all animation params (created from arguments)
offset = positioning helper for pinning
animation parameters:
delay = amount of scrolling (in pixels) before animation starts
duration = amount of scrolling (in pixels) over which the animation occurs
property = css property being animated
start = start value of the property
end = end value of the property
pin = pin block during animation duration (applies to all animations within block)
baseline = top (default, when block reaches top of viewport) or bottom (when block first comies into view)
easing = just like jquery's easing functions
*/
// if string, convert to DOM object
if (typeof target === 'string') { target = $(target); }
// find block of target
for (i=0; i<blocks.length; i++) {
if (blocks[i].block.has(target).length) {
targetBlock = blocks[i];
targetIndex = i;
}
}
// add each animation to the blocks animations array from function arguments
for (i=1; i<arguments.length; i++) {
anim = arguments[i];
// for top/left/right/bottom, set relative positioning if static
if (anim.property === 'top' || anim.property === 'left' || anim.property === 'bottom' || anim.property === 'right' ) {
if (target.css('position') === 'static') { target.css('position','relative'); }
// set anim.start, anim.end defaults
cssValue = parseInt(target.css(anim.property),10);
if (anim.start === undefined) {
anim.start = isNaN(cssValue) ? 0 : cssValue;
} else if (anim.end === undefined) {
anim.end = isNaN(cssValue) ? 0 : cssValue;
}
}
// set anim.start/anim.end defaults for rotate, zoom/scale, letter-spacing
if (anim.property === 'rotate') {
if (anim.start === undefined) { anim.start = 0; }
if (anim.end === undefined) { anim.end = 0; }
} else if (anim.property === 'zoom' || anim.property === 'scale' ) {
if (anim.start === undefined) { anim.start = 1; }
if (anim.end === undefined) { anim.end = 1; }
} else if (anim.property === 'letter-spacing' && target.css(anim.property)) {
if (anim.start === undefined) { anim.start = 1; }
if (anim.end === undefined) { anim.end = 1; }
}
if (anim.baseline === undefined) {
if (anim.pin || targetBlock.pin || targetIndex === 0) {
anim.baseline = 'top';
} else {
anim.baseline = 'bottom';
}
}
if (anim.delay === undefined) { anim.delay = 0; }
targetBlock.animations.push({
element: target,
delay: anim.delay,
duration: anim.duration,
property: anim.property,
startVal: anim.start !== undefined ? anim.start : parseInt(target.css(anim.property),10), // if undefined, use current css value
endVal: anim.end !== undefined ? anim.end : parseInt(target.css(anim.property),10), // if undefined, use current css value
baseline: anim.baseline !== undefined ? anim.baseline : 'bottom',
easing: anim.easing
});
if (anim.pin) {
if (targetBlock.pin < anim.duration + anim.delay) {
offset = anim.duration + anim.delay - targetBlock.pin;
targetBlock.pin += offset;
// adjust positions of blocks below target block
for (j=targetIndex+1; j<blocks.length; j++) {
blocks[j].top += offset;
blocks[j].block.css('top', blocks[j].top);
}
}
}
}
onScrollorama();
};
// function for passing blockChange event callback
scrollorama.onBlockChange = function(f) {
onBlockChange = f;
};
// function for getting an array of scrollpoints
// (top of each animation block and animation element scroll start point)
scrollorama.getScrollpoints = function() {
var scrollpoints = [],i,j,anim;
for (i=0; i<blocks.length; i++) {
scrollpoints.push(blocks[i].top);
// go through the animations for each block
if (blocks[i].animations.length && blocks[i].pin > 0) {
for (j=0; j<blocks[i].animations.length; j++) {
anim = blocks[i].animations[j];
scrollpoints.push(blocks[i].top + anim.delay + anim.duration);
}
}
}
// make sure scrollpoints are in numeric order
scrollpoints.sort(function(a,b) {return a - b;});
return scrollpoints;
};
// Remove scrollorama
scrollorama.destroy = function () {
// Remove animations
for (i=0; i<blocks.length; i++) {
// Remove CSS rules
blocks[i].block.css({
top: '',
position: ''
});
// Remove scrolloroma-specific attributes
delete blocks[i].animations;
delete blocks[i].top;
delete blocks[i].pin;
}
// Unbind the window scroll event
$(window).off('scroll.scrollorama');
$('#scroll-wrap').remove();
// Remove the scrolloroma object
delete scrollorama;
};
// INIT
init();
return scrollorama;
};
//
// Easing functions from jQuery UI
//
$.extend($.easing, {
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert($.easing.default);
return $.easing[$.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) { return c/2*t*t + b; }
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) { return c/2*t*t*t + b; }
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) { return c/2*t*t*t*t + b; }
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) { return c/2*t*t*t*t*t + b; }
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t===0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t===d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t===0) { return b; }
if (t===d) { return b+c; }
if ((t/=d/2) < 1) { return c/2 * Math.pow(2, 10 * (t - 1)) + b; }
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) { return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; }
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158,p=0,a=c;
if (t===0) { return b; }
if ((t/=d)===1) { return b+c; }
if (!p) { p=d*0.3; }
if (a < Math.abs(c)) { a=c; s=p/4; }
else{ s = p/(2*Math.PI) * Math.asin (c/a); }
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158,p=0,a=c;
if (t===0) { return b; }
if ((t/=d)===1) { return b+c; }
if (!p) { p=d*0.3; }
if (a < Math.abs(c)) { a=c; s=p/4; }
else { s = p/(2*Math.PI) * Math.asin (c/a); }
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158,p=0,a=c;
if (t===0) { return b; }
if ((t/=d/2)===2) { return b+c; }
if (!p) { p=d*(0.3*1.5); }
if (a < Math.abs(c)) { a=c; s=p/4; }
else { s = p/(2*Math.PI) * Math.asin (c/a); }
if (t < 1) { return -0.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s === undefined) { s = 1.70158; }
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s === undefined) { s = 1.70158; }
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s === undefined) { s = 1.70158; }
if ((t/=d/2) < 1) { return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; }
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) { return $.easing.easeInBounce (x, t*2, 0, c, d) * 0.5 + b; }
return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * 0.5 + c*0.5 + b;
}
});
})(jQuery);