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
|
import { h, Component } from 'preact'
import { Route, Link } from 'react-router-dom'
import util from '../../util'
import Pix2PixNew from './views/pix2pix.new'
import Pix2PixShow from './views/pix2pix.show'
import Pix2PixLive from './views/pix2pix.live'
function router () {
document.body.style.backgroundImage = 'linear-gradient(' + (util.randint(40)+40) + 'deg, #fde, #ffe)'
return (
<section>
<Route exact path='/pix2pix/new/' component={Pix2PixNew} />
<Route exact path='/pix2pix/sequences/' component={Pix2PixShow} />
<Route exact path='/pix2pix/sequences/:id/' component={Pix2PixShow} />
<Route exact path='/pix2pix/live/' component={Pix2PixLive} />
</section>
)
}
function links(){
return [
{ url: '/pix2pix/new/', name: 'new' },
{ url: '/pix2pix/sequences/', name: 'sequences' },
{ name: 'train' },
{ name: 'process' },
{ url: '/pix2pix/live/', name: 'live' },
]
return (
<span>
<span><Link to="/pix2pix/new/">new</Link></span>
<span><Link to="/pix2pix/sequences/">sequences</Link></span>
<span>train</span>
<span>process</span>
<span><Link to="/pix2pix/live/">live</Link></span>
</span>
)
}
export default {
name: 'pix2pix',
router, links,
}
|