Files
ucharify_landing/src/js/main.js
T
2019-02-18 22:37:47 -08:00

54 lines
1.5 KiB
JavaScript

(function () {
const doc = document
const rootEl = doc.documentElement
const body = doc.body
/* global ScrollReveal */
const sr = window.sr = ScrollReveal({ mobile: false })
rootEl.classList.remove('no-js')
rootEl.classList.add('js')
window.addEventListener('load', function () {
body.classList.add('is-loaded')
})
// Reveal animations
function revealAnimations () {
sr.reveal('.features .section-title, .features-illustration, .feature', {
delay: 300,
duration: 600,
distance: '60px',
easing: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
origin: 'bottom',
viewFactor: 0.2,
interval: 150
})
sr.reveal('.feature-extended:nth-child(odd) .feature-extended-body, .feature-extended:nth-child(even) .feature-extended-image', {
duration: 600,
distance: '40px',
easing: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
origin: 'right',
viewFactor: 0.5
})
sr.reveal('.feature-extended:nth-child(even) .feature-extended-body, .feature-extended:nth-child(odd) .feature-extended-image', {
duration: 600,
distance: '40px',
easing: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
origin: 'left',
viewFactor: 0.5
})
sr.reveal('.pricing-table, .testimonial, .cta-inner', {
duration: 600,
distance: '60px',
easing: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
origin: 'bottom',
viewFactor: 0.5,
interval: 150
})
}
if (body.classList.contains('has-animations')) {
window.addEventListener('load', revealAnimations)
}
}())