Skip to content

Commit 78bd635

Browse files
committed
Added info modals.
1 parent 6f9185a commit 78bd635

File tree

6 files changed

+121
-3
lines changed

6 files changed

+121
-3
lines changed

css/index.scss

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ body {
1313
letter-spacing: 0.03em;
1414
}
1515

16+
p {
17+
&.about {
18+
padding: 32px;
19+
max-width: 600px;
20+
margin: 0 auto;
21+
}
22+
}
1623

1724
.scroll-container {
1825
padding: 0;
@@ -74,17 +81,21 @@ footer {
7481
transform: translate3d(0, 0, 0);
7582
.footer-info {
7683
padding: 4px;
84+
text-align: right;
7785
}
78-
p {
86+
a, p {
7987
font-size: 12px;
8088
display: inline-block;
81-
vertical-align: super;
8289
margin: 0 12px;
8390
font-weight: 400;
8491
letter-spacing: 0.06em;
8592
}
8693
a {
8794
color: white;
95+
text-decoration: underline;
96+
&:hover {
97+
cursor: pointer;
98+
}
8899
}
89100
}
90101

@@ -97,6 +108,7 @@ footer {
97108
display: inline-block;
98109
border: 1px solid $blue;
99110
border-radius: 24px;
111+
vertical-align: middle;
100112
&:hover {
101113
cursor: pointer;
102114
border: 1px solid white;
@@ -305,3 +317,26 @@ h1 {
305317
margin-bottom: 12px;
306318
}
307319
}
320+
321+
// Modals
322+
.ReactModal__Content {
323+
.modal-close-button {
324+
float: right;
325+
padding: 10px;
326+
font-size: 16px;
327+
&:hover {
328+
cursor: pointer;
329+
}
330+
}
331+
p {
332+
text-align: center;
333+
max-width: 500px;
334+
margin: 12px auto;
335+
&.inverted {
336+
border: 3px solid $blue;
337+
word-wrap: break-word;
338+
padding: 32px;
339+
max-width: 436px;
340+
}
341+
}
342+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"lodash": "^4.14.1",
3838
"node-sass": "^4.5.0",
3939
"query-string": "^4.3.1",
40+
"react-modal": "^1.7.1",
4041
"react-select": "^1.0.0-rc.3",
4142
"react-share": "^1.12.1",
4243
"rimraf": "^2.5.4",

src/App.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import LFOView from './views/LFO/LFOView.js'
1010
import ShareButtonRow from './views/ShareButtons/ShareButtonRow.js'
1111
import Presets from './views/Presets/Presets.js'
1212
import MidiInput from './views/Midi/MidiInput.js'
13+
import SavePatchModal from './views/Modals/SavePatchModal.js'
14+
import AboutModal from './views/Modals/AboutModal.js'
1315
import {connect} from 'react-redux'
1416

1517
import Synth from './audio/Synth.js'
@@ -33,6 +35,23 @@ class App extends React.Component {
3335
let action = Actions.waveFileListLoaded(response.data)
3436
props.dispatch(action)
3537
})
38+
this.state = {
39+
isSavePatchModalOpen: false,
40+
isAboutModalOpen: false
41+
}
42+
}
43+
44+
onOpenSavePatchModal () {
45+
this.setState({isSavePatchModalOpen: true})
46+
}
47+
onCloseSavePatchModal () {
48+
this.setState({isSavePatchModalOpen: false})
49+
}
50+
onOpenAboutModal () {
51+
this.setState({isAboutModalOpen: true})
52+
}
53+
onCloseAboutModal () {
54+
this.setState({isAboutModalOpen: false})
3655
}
3756

3857
render () {
@@ -112,6 +131,8 @@ class App extends React.Component {
112131
eventEmitter={eventEmitter}
113132
Keyboard={this.props.Keyboard} />
114133
<div className='footer-info'>
134+
<a onClick={this.onOpenAboutModal.bind(this)}>About</a>
135+
<a onClick={this.onOpenSavePatchModal.bind(this)}>Save Patch</a>
115136
<ShareButtonRow />
116137
<p>Made By Elegant Borzoi and Jordan</p>
117138
<p>
@@ -122,6 +143,14 @@ class App extends React.Component {
122143
</div>
123144
</footer>
124145

146+
<SavePatchModal
147+
isOpen={this.state.isSavePatchModalOpen}
148+
onClose={this.onCloseSavePatchModal.bind(this)} />
149+
150+
<AboutModal
151+
isOpen={this.state.isAboutModalOpen}
152+
onClose={this.onCloseAboutModal.bind(this)} />
153+
125154
<Synth
126155
store={this.props.store}
127156
eventEmitter={eventEmitter}

src/views/Modals/AboutModal.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
AboutModal
3+
*/
4+
import React from 'react'
5+
import ReactModal from 'react-modal'
6+
7+
export default class AboutModal extends React.Component {
8+
9+
render () {
10+
return (
11+
<div className='module'>
12+
<ReactModal
13+
isOpen={this.props.isOpen}
14+
contentLabel='Save Your Patch'>
15+
<div className='modal-close-button' onClick={this.props.onClose}>
16+
X
17+
</div>
18+
<div>
19+
<h1 className='text-center'>About This Synth</h1>
20+
<p className='about'>Loosely based on Wavetable synthesis. More info to come...</p>
21+
</div>
22+
</ReactModal>
23+
</div>
24+
)
25+
}
26+
}

src/views/Modals/SavePatchModal.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
SavePatchModal
3+
*/
4+
import React from 'react'
5+
import ReactModal from 'react-modal'
6+
7+
export default class SavePatchModal extends React.Component {
8+
9+
render () {
10+
return (
11+
<div>
12+
<ReactModal
13+
isOpen={this.props.isOpen}
14+
contentLabel='Save Your Patch'>
15+
<div className='modal-close-button' onClick={this.props.onClose}>
16+
X
17+
</div>
18+
<div>
19+
<h1 className='text-center'>Save Patch</h1>
20+
<p className='inverted'>{window.location.href}</p>
21+
<p>Copy and paste the above link to save the current patch.</p>
22+
<p>You can also copy the URL from the address bar.</p>
23+
</div>
24+
</ReactModal>
25+
</div>
26+
)
27+
}
28+
}

src/views/ShareButtons/ShareButtonRow.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/prefer-stateless-function */
21
import React from 'react'
32
import {
43
ShareButtons,

0 commit comments

Comments
 (0)