/*
Eventually by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/
(function() {
"use strict";
// Methods/polyfills.
// classList | (c) @remy | github.com/remy/polyfills | rem.mit-license.org
!function(){function t(t){this.el=t;for(var n=t.className.replace(/^\s+|\s+$/g,"").split(/\s+/),i=0;i= $bgs.length)
pos = 0;
// Swap top images.
$bgs[lastPos].classList.remove('top');
$bgs[pos].classList.add('visible');
$bgs[pos].classList.add('top');
// Hide last image after a short delay.
window.setTimeout(function() {
$bgs[lastPos].classList.remove('visible');
}, settings.delay / 2);
}, settings.delay);
})();
// Signup Form.
(function() {
// Vars.
var $form = document.querySelectorAll('#signup-form')[0],
$submit = document.querySelectorAll('#signup-form input[type="submit"]')[0],
$message;
// Bail if addEventListener isn't supported.
if (!('addEventListener' in $form))
return;
// Message.
$message = document.createElement('span');
$message.classList.add('message');
$form.appendChild($message);
$message._show = function(type, text) {
$message.innerHTML = text;
$message.classList.add(type);
$message.classList.add('visible');
window.setTimeout(function() {
$message._hide();
}, 3000);
};
$message._hide = function() {
$message.classList.remove('visible');
};
// Events.
// Note: If you're *not* using AJAX, get rid of this event listener.
$form.addEventListener('submit', function(event) {
event.stopPropagation();
event.preventDefault();
// Hide message.
$message._hide();
// Disable submit.
$submit.disabled = true;
// Process form.
// Note: Doesn't actually do anything yet (other than report back with a "thank you"),
// but there's enough here to piece together a working AJAX submission call that does.
window.setTimeout(function() {
// Reset form.
$form.reset();
// Enable submit.
$submit.disabled = false;
// Show message.
$message._show('success', 'Thank you!');
//$message._show('failure', 'Something went wrong. Please try again.');
}, 750);
});
})();
})();