diff options
Diffstat (limited to 'app/client/modules/pix2pixhd/index.js')
| -rw-r--r-- | app/client/modules/pix2pixhd/index.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/app/client/modules/pix2pixhd/index.js b/app/client/modules/pix2pixhd/index.js new file mode 100644 index 0000000..331fe01 --- /dev/null +++ b/app/client/modules/pix2pixhd/index.js @@ -0,0 +1,44 @@ +import { h, Component } from 'preact' +import { Route, Link } from 'react-router-dom' + +import actions from '../../actions' + +import util from '../../util' + +import Pix2PixHDNew from './views/pix2pixhd.new' +import Pix2PixHDShow from './views/pix2pixhd.show' +import Pix2PixHDLive from './views/pix2pixhd.live' + +class router { + componentWillMount(){ + actions.system.changeTool('pix2pixhd') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' + } + componentWillReceiveProps(){ + actions.system.changeTool('pix2pixhd') + document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' + } + render(){ + return ( + <section> + <Route exact path='/pix2pixhd/new/' component={Pix2PixHDNew} /> + <Route exact path='/pix2pixhd/sequences/' component={Pix2PixHDShow} /> + <Route exact path='/pix2pixhd/sequences/:id/' component={Pix2PixHDShow} /> + <Route exact path='/pix2pixhd/live/' component={Pix2PixHDLive} /> + </section> + ) + } +} + +function links(){ + return [ + { url: '/pix2pixhd/new/', name: 'new' }, + { url: '/pix2pixhd/sequences/', name: 'sequences' }, + { url: '/pix2pixhd/live/', name: 'live' }, + ] +} + +export default { + name: 'pix2pixhd', + router, links, +} |
