mirror of
https://github.com/bigchaindb/site.git
synced 2024-12-24 18:36:11 +01:00
Matthias Kretschmann
6ede38abfc
- start linting scss based on Airbnb style guide - add includePaths to css & js tasks
51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
|
|
//=include is-in-viewport/lib/isInViewport.js
|
|
//=include bigchain/testimonials.js
|
|
|
|
jQuery(function($) {
|
|
|
|
Testimonials.init();
|
|
|
|
var wrigley = $('#wrigley'),
|
|
wrigleyArm = wrigley.find('#arm'),
|
|
wrigleyHead = wrigley.find('#head'),
|
|
wrigleyEye = wrigley.find('#eye');
|
|
|
|
var wrigleyAnimationStart = function() {
|
|
|
|
// set utility classes
|
|
if (wrigley.is( ':in-viewport( -180 )' ) ) {
|
|
wrigley.addClass('is-ready');
|
|
|
|
// toggle paused class so the :hover interaction can fire animation again
|
|
wrigleyArm.on('animationend webkitAnimationEnd oAnimationEnd', function(e) {
|
|
wrigleyArm.addClass('paused');
|
|
wrigleyHead.addClass('paused');
|
|
|
|
wrigley.on('mouseover', function() {
|
|
wrigleyArm.removeClass('paused');
|
|
wrigleyHead.removeClass('paused');
|
|
});
|
|
|
|
// fire eye blinking once other animations have finished
|
|
wrigleyEye.addClass('is-ready');
|
|
|
|
wrigleyEye.on('animationend webkitAnimationEnd oAnimationEnd', function(e) {
|
|
wrigleyEye.removeClass('is-ready');
|
|
});
|
|
}
|
|
);
|
|
} else {
|
|
wrigley.removeClass('is-ready').removeClass('paused');
|
|
wrigleyArm.removeClass('paused');
|
|
wrigleyHead.removeClass('paused');
|
|
wrigleyEye.removeClass('is-ready').removeClass('paused');
|
|
}
|
|
}
|
|
|
|
// fire all the viewport things
|
|
wrigleyAnimationStart();
|
|
$(window).on('load resize scroll', wrigleyAnimationStart);
|
|
|
|
});
|