2019-12-22 17:16:19 +00:00
|
|
|
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>;
|
|
|
|
}
|
2019-12-29 06:07:07 +00:00
|
|
|
return <script src={this.props.jsUrl}></script>;
|
2019-12-22 17:16:19 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = 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
|
|
|
};
|
|
|
|
});
|