1
1
mirror of https://github.com/c8r/x0.git synced 2024-10-05 17:47:32 +03:00

Add new demo movie

This commit is contained in:
Brent Jackson 2018-05-26 10:18:49 -04:00
parent 5f888b5996
commit 834d2a654f
8 changed files with 57 additions and 32 deletions

View File

@ -12,7 +12,7 @@ npm install -g @compositor/x0
[build-badge]: https://img.shields.io/travis/c8r/x0/master.svg?style=flat-square [build-badge]: https://img.shields.io/travis/c8r/x0/master.svg?style=flat-square
[build]: https://travis-ci.org/c8r/x0 [build]: https://travis-ci.org/c8r/x0
<img src='docs/demo.gif' class='demo-image' /> <img src='docs/hello-x0.gif' class='demo-image' />
## Features ## Features

31
demo/count.js Normal file
View File

@ -0,0 +1,31 @@
import React from 'react'
import { Link } from 'react-router-dom'
export default class extends React.Component {
static getInitialProps = async () => {
return {
asyncProps: 'hello'
}
}
render () {
const {
count,
update
} = this.props
return (
<div>
<Link to='/'>Home</Link>
<Link to='/about'>About</Link>
<h1>Hello x0</h1>
<samp>{count}</samp>
<button onClick={e => update(dec)}>-</button>
<button onClick={e => update(inc)}>+</button>
</div>
)
}
}
const dec = s => ({ count: s.count - 1 })
const inc = s => ({ count: s.count + 1 })

View File

@ -1,31 +1,25 @@
import React from 'react' import React from 'react'
import { Link } from 'react-router-dom' import { Logo } from '@compositor/logo'
import { Box, Text, Heading } from 'rebass'
export default class extends React.Component { export default props =>
static getInitialProps = async () => { <Box
return { px={4}
asyncProps: 'hello' pt={0}
} pb={7}
} color='white'
bg='black'>
render () { <Logo
const { horizontal
count, size={256}
update color='cyan'
} = this.props backgroundColor='black'
/>
return ( <Heading
<div> is='h1'
<Link to='/'>Home</Link> px={4}
<Link to='/about'>About</Link> ml={2}
<h1>Hello x0</h1> fontSize={7}>
<samp>{count}</samp> <Text is='span' color='cyan'>Hello</Text> x0
<button onClick={e => update(dec)}>-</button> </Heading>
<button onClick={e => update(inc)}>+</button> </Box>
</div>
)
}
}
const dec = s => ({ count: s.count - 1 })
const inc = s => ({ count: s.count + 1 })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 KiB

Binary file not shown.

BIN
docs/hello-x0.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
docs/hello-x0.mp4 Normal file

Binary file not shown.

View File

@ -39,8 +39,8 @@ export default class extends React.Component {
loop loop
muted muted
playsInline playsInline
poster='demo.gif' poster='hello-x0.gif'
src='demo.mp4' src='hello-x0.mp4'
/> />
</Box> </Box>
<Pre>npm i -g @compositor/x0</Pre> <Pre>npm i -g @compositor/x0</Pre>