1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
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 Pix2PixHDResults from './views/pix2pixhd.results'
import Pix2PixHDUprez from './views/pix2pixhd.uprez'
import Pix2PixHDTrain from './views/pix2pixhd.train'
import Pix2PixHDLive from './views/pix2pixhd.live'
class router {
componentWillMount(){
actions.system.changeTool('pix2pixhd')
document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #def, #dfe)'
}
componentWillReceiveProps(){
actions.system.changeTool('pix2pixhd')
document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #def, #dfe)'
}
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/train/' component={Pix2PixHDTrain} />
<Route exact path='/pix2pixhd/results/' component={Pix2PixHDResults} />
<Route exact path='/pix2pixhd/uprez/' component={Pix2PixHDUprez} />
<Route exact path='/pix2pixhd/live/' component={Pix2PixHDLive} />
</section>
)
}
}
function links(){
return [
{ url: '/pix2pixhd/new/', name: 'folders' },
{ url: '/pix2pixhd/sequences/', name: 'sequences' },
{ url: '/pix2pixhd/train/', name: 'checkpoints' },
{ url: '/pix2pixhd/results/', name: 'results' },
{ url: '/pix2pixhd/uprez/', name: 'uprez' },
{ url: '/pix2pixhd/live/', name: 'live' },
]
}
export default {
name: 'pix2pixhd',
router, links,
}
|