hexo-theme-amane/layout/plugin/animejs.ejs

43 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-10-16 05:28:42 +00:00
<% if (plugin !== false) { %>
<% if (head) { %>
2018-11-02 23:27:53 +00:00
<style>body>.navbar,body>.section,body>.footer{opacity: 0}</style>
2018-10-16 05:28:42 +00:00
<% } else { %>
<%- js(cdn('animejs', '2.2.0', 'anime.js')) %>
<script>
function isIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
var trident = ua.indexOf('Trident/');
return (msie > 0 || trident > 0);
}
$(document).ready(function () {
2018-11-02 23:27:53 +00:00
$('body>.navbar,body>.section,body>.footer').css('opacity', 1);
2018-10-16 05:28:42 +00:00
if (!isIE()) {
['.column-main > .card',
'.column-left > .card',
'.column-right > .card'].map(function(target) {
2018-10-16 05:28:42 +00:00
anime({
targets: target,
scale: [0.8, 1],
opacity: [0, 1],
duration: 300,
easing: 'easeOutSine',
delay: function(el, i, l) {
return i * 100;
}
})
});
2018-10-16 05:28:42 +00:00
anime({
targets: '.navbar-main',
translateY: [-100, 0],
opacity: [0, 1],
duration: 300,
easing: 'easeOutSine'
});
}
});
</script>
<% } %>
<% } %>