diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-17 21:16:57 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-17 21:16:57 +0200 |
| commit | cc36bb1ad49dc054b32f20a97386a938a529fe0e (patch) | |
| tree | f3f486f8376f7dc52e785f39127d443b6d6d8499 /app/client/modules/pix2pixhd/index.js | |
| parent | 8048cfc3981f79f2b65b23c124581aa51ef3768b (diff) | |
pix2pixhd modules
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, +} |
