summaryrefslogtreecommitdiff
path: root/frontend/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/views')
-rw-r--r--frontend/app/views/graph/components/graph.header.js3
-rw-r--r--frontend/app/views/graph/components/page.form.js27
-rw-r--r--frontend/app/views/page/components/page.header.js3
-rw-r--r--frontend/app/views/page/components/tile.edit.js4
-rw-r--r--frontend/app/views/page/components/tile.handle.js1
5 files changed, 32 insertions, 6 deletions
diff --git a/frontend/app/views/graph/components/graph.header.js b/frontend/app/views/graph/components/graph.header.js
index 46ad962..b969400 100644
--- a/frontend/app/views/graph/components/graph.header.js
+++ b/frontend/app/views/graph/components/graph.header.js
@@ -9,7 +9,8 @@ function GraphHeader(props) {
return (
<header>
<div>
- <Link to="/" className="logo"><b>{props.site.siteTitle}</b></Link>
+ <Link to="/" className="logo arrow">{"◁ "}</Link>
+ <b>{props.site.siteTitle}</b>
</div>
<div>
<button onClick={() => props.graphActions.toggleAddPageForm()}>+ Add page</button>
diff --git a/frontend/app/views/graph/components/page.form.js b/frontend/app/views/graph/components/page.form.js
index 8fc00b0..2c283aa 100644
--- a/frontend/app/views/graph/components/page.form.js
+++ b/frontend/app/views/graph/components/page.form.js
@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'
import { session } from 'app/session'
-import { TextInput, ColorInput, LabelDescription, TextArea, Checkbox, SubmitButton, Loader } from 'app/common'
+import { TextInput, ColorInput, Checkbox, LabelDescription, TextArea, SubmitButton, Loader } from 'app/common'
const newPage = (data) => ({
path: '',
@@ -14,6 +14,8 @@ const newPage = (data) => ({
x: 0.05,
y: 0.05,
background_color: '#000000',
+ audio: "",
+ restartAudio: false,
},
...data,
})
@@ -76,6 +78,10 @@ export default class PageForm extends Component {
handleSettingsChange(e) {
const { name, value } = e.target
+ this.handleSettingsSelect(name, value)
+ }
+
+ handleSettingsSelect(name, value) {
this.setState({
data: {
...this.state.data,
@@ -147,7 +153,7 @@ export default class PageForm extends Component {
autoComplete="off"
/>
<ColorInput
- title='BG'
+ title='BG Color'
name='background_color'
data={data.settings}
onChange={this.handleSettingsChange.bind(this)}
@@ -159,6 +165,23 @@ export default class PageForm extends Component {
data={data}
onChange={this.handleChange.bind(this)}
/>
+
+ <TextInput
+ title="Background Audio URL"
+ name="audio"
+ required
+ data={data.settings}
+ onChange={this.handleSettingsChange.bind(this)}
+ autoComplete="off"
+ />
+ <Checkbox
+ label="Restart audio on load"
+ name="restartAudio"
+ checked={data.settings.restartAudio}
+ onChange={this.handleSettingsSelect.bind(this)}
+ autoComplete="off"
+ />
+
<div className='row buttons'>
<SubmitButton
title={submitTitle}
diff --git a/frontend/app/views/page/components/page.header.js b/frontend/app/views/page/components/page.header.js
index eb1c3b9..998572a 100644
--- a/frontend/app/views/page/components/page.header.js
+++ b/frontend/app/views/page/components/page.header.js
@@ -10,7 +10,8 @@ function PageHeader(props) {
return (
<header>
<div>
- <Link to={props.graph.show.res ? "/" + props.graph.show.res.path : "/"} className="logo"><b>{props.site.siteTitle}</b></Link>
+ <Link to={props.graph.show.res ? "/" + props.graph.show.res.path : "/"} className="logo arrow">{"◁"}</Link>
+ <b>{props.site.siteTitle}</b>
</div>
<div>
<button onClick={() => props.pageActions.toggleAddTileForm()}>+ Add tile</button>
diff --git a/frontend/app/views/page/components/tile.edit.js b/frontend/app/views/page/components/tile.edit.js
index 2ea09d1..cae9f73 100644
--- a/frontend/app/views/page/components/tile.edit.js
+++ b/frontend/app/views/page/components/tile.edit.js
@@ -29,7 +29,9 @@ class TileEdit extends Component {
load() {
const { currentEditTileId } = this.props.page.editor
- const tile = this.props.page.show.res.tiles.filter(tile => tile.id === currentEditTileId)[0]
+ const { tiles } = this.props.page.show.res
+ if (!tiles) return
+ const tile = tiles.filter(tile => tile.id === currentEditTileId)[0]
console.log('edit', currentEditTileId)
this.setState({ tile })
}
diff --git a/frontend/app/views/page/components/tile.handle.js b/frontend/app/views/page/components/tile.handle.js
index 9331cb3..f47c3cd 100644
--- a/frontend/app/views/page/components/tile.handle.js
+++ b/frontend/app/views/page/components/tile.handle.js
@@ -151,7 +151,6 @@ const generateTransform = (tile, box) => {
if (xalign === 'center') {
transform.push('translateX(-50%)')
}
- console.log(units)
// if (x % 2 == 1) x += 0.5
// if (y % 2 == 1) y += 0.5
transform.push('translateX(' + x + units + ')')