mirror of
https://github.com/maputnik/editor.git
synced 2026-08-26 15:07:41 +00:00
Darker source editor
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { fontSizes } from '../config/scales'
|
import { fontSizes, margins } from '../config/scales'
|
||||||
|
|
||||||
class Heading extends React.Component {
|
class Heading extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@@ -10,7 +10,9 @@ class Heading extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
const headingProps = {
|
const headingProps = {
|
||||||
style: {
|
style: {
|
||||||
|
fontWeight: 400,
|
||||||
fontSize: fontSizes[this.props.level - 1],
|
fontSize: fontSizes[this.props.level - 1],
|
||||||
|
marginBottom: margins[1],
|
||||||
...this.props.style
|
...this.props.style
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ export default class Toolbar extends React.Component {
|
|||||||
mapStyle={this.props.mapStyle}
|
mapStyle={this.props.mapStyle}
|
||||||
onStyleChanged={this.props.onStyleChanged}
|
onStyleChanged={this.props.onStyleChanged}
|
||||||
isOpen={this.state.openSourcesModal}
|
isOpen={this.state.openSourcesModal}
|
||||||
|
//isOpen={true}
|
||||||
toggle={() => this.toggleSources.bind(this)}
|
toggle={() => this.toggleSources.bind(this)}
|
||||||
/>
|
/>
|
||||||
<ToolbarAction style={{
|
<ToolbarAction style={{
|
||||||
|
|||||||
@@ -18,13 +18,14 @@ class Modal extends React.Component {
|
|||||||
<div style={{
|
<div style={{
|
||||||
minWidth: 350,
|
minWidth: 350,
|
||||||
maxWidth: 600,
|
maxWidth: 600,
|
||||||
backgroundColor: colors.gray,
|
backgroundColor: colors.black,
|
||||||
|
boxShadow: '0px 0px 5px 0px rgba(0,0,0,0.3)',
|
||||||
}}>
|
}}>
|
||||||
<div style={{
|
<div style={{
|
||||||
backgroundColor: colors.midgray,
|
backgroundColor: colors.gray,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
padding: margins[1],
|
padding: margins[2],
|
||||||
fontSize: fontSizes[4],
|
fontSize: fontSizes[4],
|
||||||
}}>
|
}}>
|
||||||
{this.props.title}
|
{this.props.title}
|
||||||
@@ -36,7 +37,7 @@ class Modal extends React.Component {
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div style={{
|
<div style={{
|
||||||
padding: margins[1]
|
padding: margins[2],
|
||||||
}}>
|
}}>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -29,11 +29,7 @@ class SettingsModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const inputProps = {
|
const inputProps = { }
|
||||||
style: {
|
|
||||||
backgroundColor: colors.midgray
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return <Modal
|
return <Modal
|
||||||
isOpen={this.props.isOpen}
|
isOpen={this.props.isOpen}
|
||||||
toggleOpen={this.props.toggle}
|
toggleOpen={this.props.toggle}
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import InputBlock from '../inputs/InputBlock'
|
|||||||
import StringInput from '../inputs/StringInput'
|
import StringInput from '../inputs/StringInput'
|
||||||
import publicSources from '../../config/tilesets.json'
|
import publicSources from '../../config/tilesets.json'
|
||||||
import colors from '../../config/colors'
|
import colors from '../../config/colors'
|
||||||
import { margins } from '../../config/scales'
|
import { margins, fontSizes } from '../../config/scales'
|
||||||
|
|
||||||
|
import AddIcon from 'react-icons/lib/md/add-circle-outline'
|
||||||
|
|
||||||
class PublicSource extends React.Component {
|
class PublicSource extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@@ -21,27 +23,32 @@ class PublicSource extends React.Component {
|
|||||||
verticalAlign: 'top',
|
verticalAlign: 'top',
|
||||||
marginTop: margins[2],
|
marginTop: margins[2],
|
||||||
marginRight: margins[2],
|
marginRight: margins[2],
|
||||||
borderColor: colors.midgray,
|
backgroundColor: colors.gray,
|
||||||
borderStyle: 'solid',
|
|
||||||
borderWidth: 2,
|
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
width: 240,
|
width: 240,
|
||||||
height: 120,
|
fontSize: fontSizes[4],
|
||||||
|
color: colors.lowgray,
|
||||||
}}>
|
}}>
|
||||||
<div style={{
|
<div style={{
|
||||||
backgroundColor: colors.midgray,
|
padding: margins[2],
|
||||||
padding: margins[1],
|
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
}}>
|
}}>
|
||||||
<span>{this.props.title}</span>
|
<div>
|
||||||
|
<span style={{fontWeight: 700}}>{this.props.title}</span><br/>
|
||||||
|
<span style={{fontSize: fontSizes[5]}}>{this.props.id}</span>
|
||||||
|
</div>
|
||||||
<span style={{flexGrow: 1}} />
|
<span style={{flexGrow: 1}} />
|
||||||
<span>#{this.props.id}</span>
|
<a style={{
|
||||||
</div>
|
display: 'table',
|
||||||
<div style={{
|
cursor: 'pointer',
|
||||||
padding: margins[1],
|
backgroundColor: colors.midgray,
|
||||||
}}>
|
color: colors.lowgray,
|
||||||
<p>{this.props.description}</p>
|
padding: margins[1],
|
||||||
|
borderRadius: 2,
|
||||||
|
}}>
|
||||||
|
Add
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -54,11 +61,7 @@ class SourceEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const inputProps = {
|
const inputProps = { }
|
||||||
style: {
|
|
||||||
backgroundColor: colors.midgray
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return <div style={{
|
return <div style={{
|
||||||
}}>
|
}}>
|
||||||
<InputBlock label={"Source ID"}>
|
<InputBlock label={"Source ID"}>
|
||||||
@@ -103,12 +106,7 @@ class SourcesModal extends React.Component {
|
|||||||
/>
|
/>
|
||||||
})
|
})
|
||||||
|
|
||||||
const inputProps = {
|
const inputProps = { }
|
||||||
style: {
|
|
||||||
backgroundColor: colors.midgray
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return <Modal
|
return <Modal
|
||||||
isOpen={this.props.isOpen}
|
isOpen={this.props.isOpen}
|
||||||
toggleOpen={this.props.toggle}
|
toggleOpen={this.props.toggle}
|
||||||
@@ -122,6 +120,7 @@ class SourcesModal extends React.Component {
|
|||||||
<StringInput {...inputProps} />
|
<StringInput {...inputProps} />
|
||||||
</InputBlock>
|
</InputBlock>
|
||||||
<Heading level={4}>Choose Public Source</Heading>
|
<Heading level={4}>Choose Public Source</Heading>
|
||||||
|
<p style={{color: colors.lowgray, fontSize: fontSizes[5]}}>Add one of the publicly availble sources to your style.</p>
|
||||||
<div style={{maxwidth: 500}}>
|
<div style={{maxwidth: 500}}>
|
||||||
{tilesetOptions}
|
{tilesetOptions}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
"id": "mapbox-streets",
|
"id": "mapbox-streets",
|
||||||
"type": "vector",
|
"type": "vector",
|
||||||
"url": "mapbox://mapbox.mapbox-streets-v7",
|
"url": "mapbox://mapbox.mapbox-streets-v7",
|
||||||
"title": "Mapbox Streets",
|
"title": "Mapbox Streets"
|
||||||
"description": "Mapbox Streets provides a vector tileset for complex general-purpose maps."
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "tilezen",
|
"id": "tilezen",
|
||||||
@@ -14,21 +13,18 @@
|
|||||||
],
|
],
|
||||||
"minZoom": 0,
|
"minZoom": 0,
|
||||||
"maxZoom": 15,
|
"maxZoom": 15,
|
||||||
"title": "Mapzen",
|
"title": "Mapzen Vector Tile Service"
|
||||||
"description": "Mapzen vector tile services"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "openmaptiles",
|
"id": "openmaptiles",
|
||||||
"type": "vector",
|
"type": "vector",
|
||||||
"url": "https://free.tilehosting.com/data/v3.json?key=25ItXg7aI5wurYDtttD",
|
"url": "https://free.tilehosting.com/data/v3.json?key=25ItXg7aI5wurYDtttD",
|
||||||
"title": "OpenMapTiles",
|
"title": "OpenMapTiles CDN"
|
||||||
"description": "A free vector tile schema for general-purpose maps."
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "swissnames-landscape",
|
"id": "swissnames-landscape",
|
||||||
"type": "geojson",
|
"type": "geojson",
|
||||||
"data": "http://swissnames.lukasmartinelli.ch/data/landscape.geojson",
|
"data": "http://swissnames.lukasmartinelli.ch/data/landscape.geojson",
|
||||||
"title": "Geographic Names of Switzerland",
|
"title": "Landscape Names GeoJSON"
|
||||||
"description": "GeoJSON example from https://github.com/lukasmartinelli/swissnames"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -5,10 +5,6 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
|
||||||
font-size: 10px
|
|
||||||
}
|
|
||||||
|
|
||||||
.chrome-picker {
|
.chrome-picker {
|
||||||
background-color: #1c1f24 !important;
|
background-color: #1c1f24 !important;
|
||||||
font-family: inherit !important;
|
font-family: inherit !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user