Files
Iris/src/js/components/Parallax.js

33 lines
572 B
JavaScript
Raw Normal View History

2016-10-25 17:01:37 +13:00
import React, { PropTypes } from 'react'
import * as helpers from '../helpers'
export default class Parallax extends React.Component{
constructor(props) {
super(props);
this.state = {
image: false
}
}
componentDidMount(){
this.setState({
image: helpers.SizedImages( this.props.images )
})
this.update();
}
update(){
// TODO: copy canvas rules in here from Spotmop
}
render(){
return (
<div className="parallax">
{ this.state.image ? <img src={this.state.image.huge} /> : null }
</div>
);
}
}