summaryrefslogtreecommitdiff
path: root/client/components
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-06-22 01:31:18 +0200
committerJules Laplace <julescarbon@gmail.com>2017-06-22 01:31:18 +0200
commitec598c5bbc692fc473fbed411d05b07d137b8e14 (patch)
tree4d0735f5d270ae7b8a54781a28c278517450edc0 /client/components
parent50f562afc47adfb222f18375236becab6af6f948 (diff)
more css :)
Diffstat (limited to 'client/components')
-rw-r--r--client/components/Modal.jsx6
-rw-r--r--client/components/Paintings.jsx17
2 files changed, 14 insertions, 9 deletions
diff --git a/client/components/Modal.jsx b/client/components/Modal.jsx
index fded5e2..2d7cc13 100644
--- a/client/components/Modal.jsx
+++ b/client/components/Modal.jsx
@@ -1,5 +1,6 @@
import { h, Component } from 'preact'
import { Link } from 'react-router-dom'
+import { randrange } from '../util'
export default class Modal extends Component {
render() {
@@ -14,7 +15,7 @@ export default class Modal extends Component {
? 'modal visible'
: 'modal'
- const style = 'background-color:hsl(' + randint(360) + ',20%,95%)'
+ const style = 'background-color:hsl(' + randrange(0,140) + ',100%,98%)'
return (
<div class={className} style={style}>
@@ -25,6 +26,3 @@ export default class Modal extends Component {
)
}
}
-
-function randint(n){ return (Math.random()*n)|0 }
-function randrange(n){ return (Math.random()*n)|0 } \ No newline at end of file
diff --git a/client/components/Paintings.jsx b/client/components/Paintings.jsx
index 93b24eb..a2eb601 100644
--- a/client/components/Paintings.jsx
+++ b/client/components/Paintings.jsx
@@ -1,6 +1,6 @@
import { h, Component } from 'preact'
import { Link } from 'react-router-dom'
-import util from '../util'
+import { randrange } from '../util'
export default class Paintings extends Component {
constructor() {
@@ -8,10 +8,13 @@ export default class Paintings extends Component {
}
render() {
const paintings = this.props.data.painting.map( (painting, i) => {
+ painting.style = painting.style || 'background-color:hsl(' + randrange(300,460) + ',50%,98%)'
return (
- <div class='cell' key={i}>
+ <div class='cell' key={i} style={painting.style}>
<div class='painting'>
- <div class='image' style={'background-image: url(' + painting.image.uri + ')'} />
+ <Link to={'/painting/' + painting.id}>
+ <div class='image' style={'background-image: url(' + painting.image.uri + ')'} />
+ </Link>
</div>
<div class='about'>
<div>
@@ -33,9 +36,13 @@ export default class Paintings extends Component {
const page = (
<div class='cell'>
<div class='painting'>
- <div class='image' style={'background-image: url(' + about.image.uri + ')'} />
+ <a href='http://asdf.us/pepper' target='_blank'>
+ <div class='image' style={'background-image: url(' + about.image.uri + ')'} />
+ </a>
+ </div>
+ <div class='about'>
+ <div dangerouslySetInnerHTML={{ __html: body }} />
</div>
- <div class='about' dangerouslySetInnerHTML={{ __html: body }} />
</div>
)
return (