Initial Proof of concept

main
Dillon Mulroy 7 years ago committed by Brian Dennis
parent 048ab355ff
commit 7a2b778204

@ -418,3 +418,19 @@ if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
} }
) )
} }
export const DEFAULT_SETTINGS = {
paddingVertical: '50px',
paddingHorizontal: '50px',
marginVertical: '45px',
marginHorizontal: '45px',
backgroundMode: 'color',
backgroundColor: 'rgba(171, 184, 195, 1)',
dropShadowOffsetY: '20px',
dropShadowBlurRadius: '68px',
theme: 'seti',
windowTheme: 'none',
language: DEFAULT_LANGUAGE,
fontFamily: 'Hack',
fontSize: '14px'
}

1158
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -26,7 +26,8 @@ import {
DEFAULT_THEME, DEFAULT_THEME,
COLORS, COLORS,
DEFAULT_CODE, DEFAULT_CODE,
DEFAULT_BG_COLOR DEFAULT_BG_COLOR,
DEFAULT_SETTINGS
} from '../lib/constants' } from '../lib/constants'
import { getQueryStringState, updateQueryString } from '../lib/routing' import { getQueryStringState, updateQueryString } from '../lib/routing'
import { getState, saveState } from '../lib/util' import { getState, saveState } from '../lib/util'
@ -85,6 +86,7 @@ class Editor extends React.Component {
this.upload = this.upload.bind(this) this.upload = this.upload.bind(this)
this.updateCode = this.updateCode.bind(this) this.updateCode = this.updateCode.bind(this)
this.updateAspectRatio = this.updateAspectRatio.bind(this) this.updateAspectRatio = this.updateAspectRatio.bind(this)
this.resetDefaultSettings = this.resetDefaultSettings.bind(this)
} }
componentDidMount() { componentDidMount() {
@ -141,6 +143,11 @@ class Editor extends React.Component {
}) })
} }
resetDefaultSettings() {
console.log('DEFAULT_SETTINGS', DEFAULT_SETTINGS)
this.setState(DEFAULT_SETTINGS)
}
upload() { upload() {
this.setState({ uploading: true }) this.setState({ uploading: true })
this.getCarbonImage() this.getCarbonImage()
@ -189,6 +196,7 @@ class Editor extends React.Component {
style={{ marginRight: '8px' }} style={{ marginRight: '8px' }}
/> />
<Button onClick={this.save} title="Save Image" color="#c198fb" /> <Button onClick={this.save} title="Save Image" color="#c198fb" />
<Button onClick={this.resetDefaultSettings} title="Reset Settings" color="#c198fb" />
</div> </div>
</Toolbar> </Toolbar>

Loading…
Cancel
Save