summaryrefslogtreecommitdiff
path: root/app/client/modules/pix2pix/index.js
blob: f3a4050e9df5f04dd58465998645a8a63f1320ce (plain)
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
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 (
    <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,
}