diff --git a/web/src/App.js b/web/src/App.js index d5ddebe..1da5a78 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -5,6 +5,7 @@ import { UrlStateProvider } from './UrlState'; import ColorState from './ColorState'; import ColorSetInputs from './ColorSetInputs'; import TextPreviews from './TextPreviews'; +import WallpaperPreview from './WallpaperPreview'; export default class App extends PureComponent { render() { @@ -35,7 +36,10 @@ export default class App extends PureComponent {

1. Define colors

2. Preview

- +
+ + +
) } diff --git a/web/src/App.module.css b/web/src/App.module.css index c25ffda..026bb6c 100644 --- a/web/src/App.module.css +++ b/web/src/App.module.css @@ -23,4 +23,10 @@ .h2 { font-size: var(--size-large-1); margin: var(--size-regular) 0; -} \ No newline at end of file +} + +.previewsContainer { + display: grid; + grid-template-columns: calc((100% - var(--size-large-1)) * 2 / 3) calc((100% - var(--size-large-1)) / 3); + grid-column-gap: var(--size-large-1); +} diff --git a/web/src/Checkbox.js b/web/src/Checkbox.js index 97560b4..46bf95e 100644 --- a/web/src/Checkbox.js +++ b/web/src/Checkbox.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { Check } from './Icons'; +import { CheckIcon } from './Icons'; import styles from './Checkbox.module.css'; import ColorState from './ColorState'; @@ -18,7 +18,7 @@ export default class Checkbox extends PureComponent { checked={ this.props.value } onChange={ evt => this.props.onChange(evt.target.checked) } /> - - + ( +export const DropletIcon = () => ( ); -export const Check = ({ backgroundColor, outlineColor, checkColor }) => ( +export const CheckIcon = ({ backgroundColor, outlineColor, checkColor }) => ( ); -export const Radio = ({ selected }) => ( +export const RadioIcon = ({ selected }) => ( diff --git a/web/src/Radio.js b/web/src/Radio.js new file mode 100644 index 0000000..8ac147b --- /dev/null +++ b/web/src/Radio.js @@ -0,0 +1,28 @@ +import React, { PureComponent } from 'react'; +import { RadioIcon } from './Icons'; +import ColorState from './ColorState'; +import styles from './Radio.module.css'; + +export default class Radio extends PureComponent { + render() { + return ( + + { ({ getColor }) => ( + { this.props.label } + + ) } + + ); + } +} diff --git a/web/src/Radio.module.css b/web/src/Radio.module.css new file mode 100644 index 0000000..e17d548 --- /dev/null +++ b/web/src/Radio.module.css @@ -0,0 +1,13 @@ +.wrapper { + display: flex; + align-items: center; +} + +.input { + display: none; +} + +.label { + margin-left: var(--size-small-2); + flex-grow: 1; +} diff --git a/web/src/Tabs.js b/web/src/Tabs.js index 8623a23..5910abc 100644 --- a/web/src/Tabs.js +++ b/web/src/Tabs.js @@ -17,7 +17,10 @@ export default class Tabs extends PureComponent { borderLeftColor: getColor('shade7'), }), contentClassName: styles.tabContent, - contentStyle: { borderColor: getColor('shade7') }, + contentStyle: { + borderColor: getColor('shade7'), + backgroundColor: getColor('shade0'), + }, }) } ); diff --git a/web/src/Tabs.module.css b/web/src/Tabs.module.css index 90b28c4..77b6acb 100644 --- a/web/src/Tabs.module.css +++ b/web/src/Tabs.module.css @@ -1,5 +1,7 @@ .tab { + display: inline-block; font-size: var(--size-regular); + line-height: var(--line-height); font-family: 'Fira Code', monospace; padding: var(--size-small-4) var(--size-small-1); border-width: var(--border-size); @@ -19,4 +21,5 @@ border-top-right-radius: var(--border-radius-size); border-bottom-right-radius: var(--border-radius-size); border-bottom-left-radius: var(--border-radius-size); + padding: var(--size-large-1); } diff --git a/web/src/TextPreviews.js b/web/src/TextPreviews.js index e835415..7c6e41c 100644 --- a/web/src/TextPreviews.js +++ b/web/src/TextPreviews.js @@ -2,7 +2,6 @@ import React, { PureComponent } from 'react'; import CodePreview from './CodePreview'; import TerminalPreview from './TerminalPreview'; import Tabs from './Tabs'; -import styles from './TextPreviews.module.css'; export default class TextPreviews extends PureComponent { @@ -12,7 +11,7 @@ export default class TextPreviews extends PureComponent { return ( { ({ tabClassName, getTabStyle, contentClassName, contentStyle }) => ( - <> +
-
+
{ this.state.activePreview === 'code' ? ( ) : null } @@ -33,7 +32,7 @@ export default class TextPreviews extends PureComponent { ) : null }
- +
) } ); diff --git a/web/src/TextPreviews.module.css b/web/src/TextPreviews.module.css deleted file mode 100644 index 632915e..0000000 --- a/web/src/TextPreviews.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.previewContainer { - padding: var(--size-large-1); -} diff --git a/web/src/UrlState.js b/web/src/UrlState.js index 5ce6aa4..3c9e94c 100644 --- a/web/src/UrlState.js +++ b/web/src/UrlState.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React, { PureComponent } from 'react'; import qs from 'qs'; import { merge } from 'lodash'; import getValueOrFallback from './getValueOrFallback'; @@ -52,9 +52,10 @@ const fallbackState = { dark: true, light: true, }, + activeWallpaper: 'none', }; -export class UrlStateProvider extends Component { +export class UrlStateProvider extends PureComponent { constructor(props, ...args) { super(props, ...args); this.state = stateFromParams(props.history.location.search); diff --git a/web/src/WallpaperPreview.js b/web/src/WallpaperPreview.js new file mode 100644 index 0000000..e34c5fd --- /dev/null +++ b/web/src/WallpaperPreview.js @@ -0,0 +1,28 @@ +import React, { PureComponent } from 'react'; +import { UrlStateConsumer } from './UrlState'; +import Tabs from './Tabs'; +import Radio from './Radio'; + +export default class WallpaperPreview extends PureComponent { + render() { + return ( + + { ({ getValueOrFallback, mergeState }) => ( + + { ({ tabClassName, getTabStyle, contentClassName, contentStyle }) => ( +
+ Wallpaper +
+ +
+
+ ) } +
+ ) } +
+ ); + } +} diff --git a/web/src/index.css b/web/src/index.css index 99e79c9..f7e3f3a 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -38,10 +38,12 @@ body, --border-size: var(--size-small-6); --border-radius-size: var(--size-small-3); + --line-height: calc(1 / var(--size-ratio)); + height: 100%; font-family: 'Fira Code', monospace; font-size: 16px; - line-height: calc(1 / var(--size-ratio)); + line-height: var(--line-height); } * {