2019-12-22 17:16:19 +00:00
|
|
|
const { Component } = require('inferno');
|
2020-01-23 04:07:43 +00:00
|
|
|
const { cacheComponent } = require('hexo-component-inferno/lib/util/cache');
|
2019-12-22 17:16:19 +00:00
|
|
|
|
|
|
|
class AnimeJs extends Component {
|
|
|
|
render() {
|
|
|
|
if (this.props.head) {
|
|
|
|
return <style dangerouslySetInnerHTML={{ __html: 'body>.footer,body>.navbar,body>.section{opacity:0}' }}></style>;
|
|
|
|
}
|
2019-12-29 06:07:07 +00:00
|
|
|
return <script src={this.props.jsUrl}></script>;
|
2019-12-22 17:16:19 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-09 00:32:11 +00:00
|
|
|
AnimeJs.Cacheable = cacheComponent(AnimeJs, 'plugin.animejs', props => {
|
2019-12-23 06:49:48 +00:00
|
|
|
const { helper, head } = props;
|
2019-12-22 17:16:19 +00:00
|
|
|
return {
|
2019-12-23 06:49:48 +00:00
|
|
|
head,
|
2019-12-29 06:07:07 +00:00
|
|
|
jsUrl: helper.url_for('/js/animation.js')
|
2019-12-22 17:16:19 +00:00
|
|
|
};
|
|
|
|
});
|
2020-03-09 00:32:11 +00:00
|
|
|
|
|
|
|
module.exports = AnimeJs;
|