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

22 lines
568 B
React
Raw Normal View History

2019-12-22 17:16:19 +00:00
'use strict';
const { Component } = require('inferno');
const { cacheComponent } = require('../util/cache');
class AnimeJs extends Component {
render() {
if (this.props.head) {
return <style dangerouslySetInnerHTML={{ __html: 'body>.footer,body>.navbar,body>.section{opacity:0}' }}></style>;
}
return <script src={this.props.url_for('/js/animation.js')}></script>;
}
}
module.exports = cacheComponent(AnimeJs, 'plugin.animejs', props => {
return {
head: props.head,
url_for: props.url_for
};
});