import PropTypes from 'prop-types'; import React from 'react'; import bindAll from 'lodash.bindall'; import styles from './prehistoric-mode.css'; import {connect} from 'react-redux'; import {isTimeTravel220022BC} from '../../reducers/time-travel'; import torch from './torch.gif'; class PrehistoricMode extends React.Component { constructor (props) { super(props); bindAll(this, [ 'handleMouseMove' ]); this.state = { x: window.innerWidth / 2, y: window.innerHeight / 2 }; } componentDidMount () { document.addEventListener('pointermove', this.handleMouseMove); } componentWillUnmount () { document.removeEventListener('pointermove', this.handleMouseMove); } handleMouseMove (event) { this.setState({x: event.clientX, y: event.clientY}); } render () { if (!this.props.show) return null; return (