Improve layer colors

This commit is contained in:
lukasmartinelli 2016-09-09 11:29:18 +02:00
parent 73e36a22bf
commit 1ae5594d9a
6 changed files with 81 additions and 61 deletions

View file

@ -1,3 +0,0 @@
{
"presets": ["es2015", "react"]
}

View file

@ -33,6 +33,15 @@
"rebass": "^0.3.1", "rebass": "^0.3.1",
"sass-loader": "^4.0.1" "sass-loader": "^4.0.1"
}, },
"babel": {
"presets": [
"es2015",
"react"
],
"plugins": [
"transform-object-rest-spread"
]
},
"jshintConfig": { "jshintConfig": {
"esversion": 6 "esversion": 6
}, },
@ -49,6 +58,8 @@
"ecmaVersion": 6, "ecmaVersion": 6,
"sourceType": "module", "sourceType": "module",
"ecmaFeatures": { "ecmaFeatures": {
"impliedStrict": true,
"experimentalObjectRestSpread": true,
"jsx": true "jsx": true
} }
}, },
@ -61,11 +72,14 @@
"babel-loader": "6.2.4", "babel-loader": "6.2.4",
"babel-plugin-transform-class-properties": "^6.11.5", "babel-plugin-transform-class-properties": "^6.11.5",
"babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-plugin-transform-runtime": "^6.15.0", "babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "6.14.0", "babel-preset-es2015": "6.14.0",
"babel-preset-react": "6.11.1", "babel-preset-react": "6.11.1",
"babel-runtime": "^6.11.6", "babel-runtime": "^6.11.6",
"css-loader": "0.25.0", "css-loader": "0.25.0",
"eslint": "^3.4.0",
"eslint-plugin-react": "^6.2.0",
"extract-text-webpack-plugin": "^1.0.1", "extract-text-webpack-plugin": "^1.0.1",
"file-loader": "0.9.0", "file-loader": "0.9.0",
"html-webpack-plugin": "^2.22.0", "html-webpack-plugin": "^2.22.0",

View file

@ -60,7 +60,7 @@ export default class App extends React.Component {
render() { render() {
console.log(this.state.mapStyle) console.log(this.state.mapStyle)
return <div> return <div style={{ fontFamily: theme.fontFamily, color: theme.color }}>
<Toolbar onStyleUpload={this.updateStyle} /> <Toolbar onStyleUpload={this.updateStyle} />
<WorkspaceDrawer mapStyle={this.state.mapStyle} /> <WorkspaceDrawer mapStyle={this.state.mapStyle} />
<div className={layout.map}> <div className={layout.map}>

View file

@ -1,7 +1,6 @@
import React from 'react' import React from 'react'
import ScrollArea from 'react-scrollbar'
import { Checkbox, Slider, Switch, Input, Panel, PanelHeader, Toolbar, NavItem, Tooltip, Container, Space} from 'rebass' import { Heading, Checkbox, Slider, Switch, Input, Panel, PanelHeader, Toolbar, NavItem, Tooltip, Container, Space} from 'rebass'
import { Button, Text } from 'rebass' import { Button, Text } from 'rebass'
import Collapse from 'react-collapse' import Collapse from 'react-collapse'
@ -50,7 +49,9 @@ export class LayerPanel extends React.Component {
} }
return <Panel> return <Panel>
<PanelHeader onClick={this.toggleLayer} inverted theme="default">{this.props.layer.id}</PanelHeader> <PanelHeader onClick={this.toggleLayer} theme="default">
#{this.props.layer.id}
</PanelHeader>
<Collapse isOpened={this.state.isOpened}> <Collapse isOpened={this.state.isOpened}>
{layer} {layer}
</Collapse> </Collapse>
@ -64,10 +65,8 @@ export class LayerEditor extends React.Component {
return <LayerPanel key={layer.id} layer={layer} /> return <LayerPanel key={layer.id} layer={layer} />
}); });
return <div> return <div>
<Toolbar> <Heading level={2}>Layers</Heading>
<NavItem is="a"> Toolbar </NavItem> {layerPanels}
</Toolbar>
<ScrollArea speed={0.8} horizontal={false}>{layerPanels}</ScrollArea>
</div> </div>
} }
} }

View file

@ -1,5 +1,6 @@
import React from 'react' import React from 'react'
import ReactMapboxGl from "react-mapbox-gl" import ReactMapboxGl from "react-mapbox-gl"
import theme from './theme.js'
export class Map extends React.Component { export class Map extends React.Component {
constructor(props) { constructor(props) {
@ -12,7 +13,7 @@ export class Map extends React.Component {
style={this.props.mapStyle} style={this.props.mapStyle}
accessToken="pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w"/> accessToken="pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w"/>
} }
return <div /> return <div style={{backgroundColor: theme.colors.black}}/>
} }
} }

View file

@ -3,54 +3,66 @@ const caps = {
letterSpacing: '.2em' letterSpacing: '.2em'
} }
const dark = { const baseColors = {
name: 'Dark',
color: '#eee',
fontFamily: '-apple-system, BlinkMacSystemFont, sans-serif',
backgroundColor: '#111',
borderRadius: 5,
borderColor: `rgba(255, 255, 255, ${1/16})`,
colors: {
black: '#242424', black: '#242424',
gray: '#313131', gray: '#313131',
midgray: '#778',
white: '#fff', white: '#fff',
blue: '#00d9f7', blue: '#00d9f7',
info: '#00d9f7',
green: '#0f8', green: '#0f8',
success: '#0f8',
orange: '#fb3', orange: '#fb3',
warning: '#fb3',
primary: '#778',
midgray: '#778',
gray: '#333339',
secondary: '#333339',
red: '#f04', red: '#f04',
error: '#f04' }
},
inverted: '#222',
scale: [ const themeColors = {
3, 5, 10, 20, 40 primary: baseColors.gray,
], secondary: baseColors.midgray,
default: baseColors.gray,
info: baseColors.blue,
success: baseColors.green,
warning: baseColors.orange,
error: baseColors.red
}
Card: { const colors = {
backgroundColor: '#222', ...baseColors,
border: 0, ...themeColors
}
const scale = [3, 5, 10, 20, 40]
const fontSizes = [28, 24, 20, 16, 14, 12, 10]
const border = {
borderColor: colors.black,
borderRadius: 0,
}
const dark = {
name: 'Dark',
color: colors.white,
fontFamily: 'Roboto, sans-serif',
scale,
fontSizes,
colors,
inverted: colors.midGray,
...border,
Panel: {
backgroundColor: colors.gray,
...border,
borderLeft: 0,
borderRight: 0,
marginBottom: 0,
},
PanelHeader: {
marginRight: -10,
fontSize: fontSizes[4],
fontWeight: 400,
color: colors.white,
}, },
Heading: caps,
Button: { Button: {
color: '#00d9f7', color: '#00d9f7',
}, },
ButtonOutline: {
color: '#00d9f7',
},
Toolbar: {
minHeight: 64,
color: '#00d9f7',
backgroundColor: "rgba(0, 0, 0, 0.8)"
},
Label: { opacity: 5/8 },
Menu: { Menu: {
color: '#00d9f7', color: '#00d9f7',
backgroundColor: '#000' backgroundColor: '#000'
@ -59,12 +71,9 @@ const dark = {
color: '#111', color: '#111',
opacity: 15/16 opacity: 15/16
}, },
Text: { Header: {
opacity: 7/8 fontWeight: 400,
}, },
Footer: {
opacity: 1/2
}
} }
export default dark export default dark