forked from Botanical/BotanJS
Added transition decade
This commit is contained in:
parent
5b1955ced7
commit
c739dfd76b
@ -234,13 +234,15 @@
|
|||||||
|
|
||||||
Parallax.attach( window, wsupp, 0.5 );
|
Parallax.attach( window, wsupp, 0.5 );
|
||||||
|
|
||||||
|
var cp = 0;
|
||||||
var bWrapper = Dand.id( "begin-wrapper" );
|
var bWrapper = Dand.id( "begin-wrapper" );
|
||||||
Cycle.perma(
|
Cycle.perma(
|
||||||
"MainBackground"
|
"MainBackground"
|
||||||
, function()
|
, function()
|
||||||
{
|
{
|
||||||
var p = wsupp.scrollTop / ( wsupp.scrollHeight - wsupp.clientHeight );
|
var p = wsupp.scrollTop / ( wsupp.scrollHeight - wsupp.clientHeight );
|
||||||
bWrapper.style.backgroundPosition = "50% " + ( p * 100 ) + "%";
|
cp = 0.75 * cp + 0.25 * p;
|
||||||
|
bWrapper.style.backgroundPosition = "50% " + cp * 100 + "%";
|
||||||
}
|
}
|
||||||
, 15
|
, 15
|
||||||
);
|
);
|
||||||
|
@ -64,18 +64,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cp = 0;
|
||||||
Cycle.perma(
|
Cycle.perma(
|
||||||
"PARALLAXSCR"
|
"PARALLAXSCR"
|
||||||
, function()
|
, function()
|
||||||
{
|
{
|
||||||
var p = sSupplier.scrollTop/(sSupplier.scrollHeight - sSupplier.clientHeight);
|
var p = sSupplier.scrollTop/(sSupplier.scrollHeight - sSupplier.clientHeight);
|
||||||
|
cp = 0.85 * cp + p * 0.15;
|
||||||
|
|
||||||
for(var i = 0; i < l; i ++)
|
for(var i = 0; i < l; i ++)
|
||||||
{
|
{
|
||||||
s = Parallax["s" + i];
|
s = Parallax["s" + i];
|
||||||
for(var j = 0, k; j < s.length; j ++)
|
for(var j = 0, k; j < s.length; j ++)
|
||||||
{
|
{
|
||||||
k = s[j];
|
k = s[j];
|
||||||
k.element.style.top = String(-k.verticalRange*((j + 1)*p)) + "%";
|
k.element.style.top = String(-k.verticalRange*((j + 1)*cp)) + "%";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user