import { h, Component } from 'preact' import { Route, Link } from 'react-router-dom' import actions from '../../actions' import util from '../../util' import Pix2PixNew from './views/pix2pix.new' import Pix2PixShow from './views/pix2pix.show' import Pix2PixLive from './views/pix2pix.live' class router { componentWillMount(){ actions.system.changeTool('pix2pix') document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' } componentWillReceiveProps(){ actions.system.changeTool('pix2pix') document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)' } render(){ return (
) } } function links(){ return [ { url: '/pix2pix/new/', name: 'new' }, { url: '/pix2pix/sequences/', name: 'sequences' }, { url: '/pix2pix/live/', name: 'live' }, ] } export default { name: 'pix2pix', router, links, }