RandolphLiu (Talk | contribs) |
RandolphLiu (Talk | contribs) (many edits) |
||
Line 4: | Line 4: | ||
$(window).scroll(function() { | $(window).scroll(function() { | ||
if ($(this).scrollTop() == 0) { | if ($(this).scrollTop() == 0) { | ||
− | $(' | + | $(function() { |
− | + | $('.navbar-nav > li > a').animate({lineHeight: '74px'}, 200, 'linear'); | |
− | + | $('.nav-background').animate({height: '74px', opacity: '0.4'}, 200, 'linear'); | |
− | + | $('.nav-head-wrapper').animate({top: '10px'}, 200, 'linear'); | |
− | + | $('header').data('expend', 'true'); | |
− | } else if ($(this).scrollTop() | + | console.log('scoll to the top'); |
− | $('.nav-head-wrapper').animate({top: '0'}, 400, 'linear'); | + | }); |
− | + | } else if ($(this).scrollTop() != 0 && $('header').data('expend') != 'false') { | |
− | + | $(function() { | |
− | + | $('.nav-head-wrapper').animate({top: '0'}, 400, 'linear'); | |
+ | $('.nav-background').animate({height: '54px', opacity: '1'}, 400, 'linear'); | ||
+ | $('.navbar-nav > li > a').animate({lineHeight: '54px'}, 400, 'linear'); | ||
+ | $('header').data('expend', 'false'); | ||
+ | }); | ||
} | } | ||
}); | }); | ||
// banner text showing animation | // banner text showing animation | ||
− | $('#text-d'). | + | $('#text-d').animate({opacity: '1'}, 800, 'swing'); |
− | $('#text-e').delay(800). | + | $('#text-e').delay(800).animate({opacity: '1'}, 800, 'swing'); |
− | $('#text-cose').delay(1600). | + | $('#text-cose').delay(1600).animate({opacity: '1'}, 1000, 'swing'); |
− | $('.banner-sub-text').delay(3000). | + | $('.banner-sub-text').delay(3000).animate({opacity: '1'}, 800, 'swing'); |
− | $('.banner-up-arrow').delay(4000). | + | $('.banner-up-arrow').delay(4000).animate({opacity: '1'}, 800, 'swing'); |
// banner scroll hint animation | // banner scroll hint animation | ||
Line 43: | Line 47: | ||
// content text showing animation | // content text showing animation | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
$('.content-title').waypoint(function(){ | $('.content-title').waypoint(function(){ | ||
− | + | $(this.element).animate({top: '0', opacity: '1'}, 800, 'swing'); | |
− | + | }, {offset: '70%'}); | |
− | + | ||
− | + | ||
− | }, {offset: ' | + | |
$('.content-text:not(#content-block-2 .content-text)').waypoint(function(){ | $('.content-text:not(#content-block-2 .content-text)').waypoint(function(){ | ||
− | + | $(this.element).animate({left: '0', opacity: '1'}, 600, 'swing'); | |
− | + | }, {offset: '70%'}); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | }, {offset: ' | + | |
$('#content-block-2 .content-text').waypoint(function(){ | $('#content-block-2 .content-text').waypoint(function(){ | ||
− | + | $(this.element).animate({left: '0', opacity: '1'}, 600, 'swing'); | |
− | }, {offset: ' | + | }, {offset: '70%'}); |
// team picture | // team picture |
Revision as of 17:19, 13 October 2018
$(document).ready(function(){
// header scroll to top animation $(window).scroll(function() { if ($(this).scrollTop() == 0) { $(function() { $('.navbar-nav > li > a').animate({lineHeight: '74px'}, 200, 'linear'); $('.nav-background').animate({height: '74px', opacity: '0.4'}, 200, 'linear'); $('.nav-head-wrapper').animate({top: '10px'}, 200, 'linear'); $('header').data('expend', 'true'); console.log('scoll to the top'); }); } else if ($(this).scrollTop() != 0 && $('header').data('expend') != 'false') { $(function() { $('.nav-head-wrapper').animate({top: '0'}, 400, 'linear'); $('.nav-background').animate({height: '54px', opacity: '1'}, 400, 'linear'); $('.navbar-nav > li > a').animate({lineHeight: '54px'}, 400, 'linear'); $('header').data('expend', 'false'); }); } });
// banner text showing animation $('#text-d').animate({opacity: '1'}, 800, 'swing'); $('#text-e').delay(800).animate({opacity: '1'}, 800, 'swing'); $('#text-cose').delay(1600).animate({opacity: '1'}, 1000, 'swing'); $('.banner-sub-text').delay(3000).animate({opacity: '1'}, 800, 'swing'); $('.banner-up-arrow').delay(4000).animate({opacity: '1'}, 800, 'swing');
// banner scroll hint animation setInterval(function(){ $('.banner-up-arrow').fadeTo(1400, 0.4).fadeTo(1400, 0.8); }, 2800); var iter=1;
// banner picture cycling animation setInterval(function(){ if (iter == $('.banner-pic-wrapper').children().length-1) { var next_iter = 1; } else { var next_iter = iter+1; } $('#banner-pic-'+next_iter).fadeIn(1000); $('#banner-pic-'+iter).delay(500).fadeOut(1000); iter = next_iter; }, 6000)
// content text showing animation $('.content-title').waypoint(function(){ $(this.element).animate({top: '0', opacity: '1'}, 800, 'swing'); }, {offset: '70%'}); $('.content-text:not(#content-block-2 .content-text)').waypoint(function(){ $(this.element).animate({left: '0', opacity: '1'}, 600, 'swing'); }, {offset: '70%'}); $('#content-block-2 .content-text').waypoint(function(){ $(this.element).animate({left: '0', opacity: '1'}, 600, 'swing'); }, {offset: '70%'});
// team picture $("#content-block-4").waypoint(function() { if ($("#content-block-4").data('inview') != 'true') { $('.banner-pic-wrapper').hide(); $('#content-block-4-pic').show(); $("#content-block-4").data('inview', 'true'); } else { $('.banner-pic-wrapper').show(); $('#content-block-4-pic').hide(); $("#content-block-4").data('inview', 'false'); } }, {offset: 'bottom-in-view'});
});