mirror of
https://github.com/bigchaindb/site.git
synced 2024-12-24 18:36:11 +01:00
wrigley.js
This commit is contained in:
parent
16a63001f0
commit
e4d00cb16b
48
_src/_assets/javascripts/bigchain/wrigley.js
Normal file
48
_src/_assets/javascripts/bigchain/wrigley.js
Normal file
@ -0,0 +1,48 @@
|
||||
//=include is-in-viewport/lib/isInViewport.js
|
||||
|
||||
jQuery(function($) {
|
||||
|
||||
//
|
||||
// Wrigley
|
||||
//
|
||||
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)
|
||||
})
|
@ -1,6 +1,6 @@
|
||||
//=include bigchain/smoothscroll.js
|
||||
//=include bigchain/newsletter.js
|
||||
//=include is-in-viewport/lib/isInViewport.js
|
||||
//=include bigchain/wrigley.js
|
||||
|
||||
jQuery(function($) {
|
||||
|
||||
@ -8,49 +8,4 @@ jQuery(function($) {
|
||||
// init modules
|
||||
//
|
||||
Newsletter.init()
|
||||
|
||||
|
||||
//
|
||||
// Wrigley
|
||||
//
|
||||
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)
|
||||
})
|
||||
|
@ -13,7 +13,7 @@ redirect_from:
|
||||
<section class="section section--architecture">
|
||||
<div class="row">
|
||||
<header class="section-header">
|
||||
<p class="section-description">Rather than trying to scale up blockchain technology, BigchainDB starts with a big data distributed database and then adds blockchain characteristics - decentralized control, immutability and the transfer of digital assets.</p>
|
||||
<p class="section-description">Get started quickly by installing BigchainDB.</p>
|
||||
</header>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
Loading…
Reference in New Issue
Block a user