Skip to content

Commit 9e709fe

Browse files
committed
Move Arp buttons to top
1 parent a44b55f commit 9e709fe

File tree

8 files changed

+58
-48
lines changed

8 files changed

+58
-48
lines changed

css/fader.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
$blue: #0047B4;
2+
13
.fader {
24
-webkit-appearance: none; /* Hides the slider so that custom slider can be made */
35
width: 180px; /* Specific width is required for Firefox. */
@@ -30,7 +32,7 @@
3032
width: 16px;
3133
border-radius: 16px;
3234
cursor: pointer;
33-
background: #fff;
35+
background: $blue;
3436
margin-top: -7px; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
3537
/* box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d; /* Add cool effects to your sliders! */
3638
}

css/index.scss

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ h2 {
3636
background-color: $blue;
3737
padding: 24px 36px;
3838
color: white;
39+
font-size: 24px;
3940
}
4041

4142
.scroll-container {
@@ -50,12 +51,12 @@ h2 {
5051
}
5152

5253
header {
53-
height: 48px;
54-
width: 996px;
55-
background-color: $blue;
56-
color: white;
54+
width: 960px;
55+
background-color: white;
56+
color: $blue;
5757
margin: 0 auto;
5858
padding: 4px 12px;
59+
5960
h1 {
6061
display: inline-block;
6162
margin: 0;
@@ -71,13 +72,13 @@ header {
7172
cursor: pointer;
7273
}
7374
}
74-
.horizontal-slider {
75-
display: inline-block;
76-
margin: -14px 0 0 58px;
77-
vertical-align: middle;
78-
.slider-label {
79-
width: 53px;
80-
}
75+
76+
.header-controls {
77+
display: flex;
78+
justify-content: space-between;
79+
margin: 0;
80+
padding: 24px 0 0 0;
81+
align-items: center;
8182
}
8283
}
8384

@@ -331,15 +332,15 @@ h1 {
331332
}
332333

333334
/* Arpeggiator Buttons */
335+
.arp-switch-label {
336+
margin-bottom: 12px;
337+
text-align: center;
338+
display:block;
339+
}
340+
334341
.arpeggiator-switch {
335-
width: 34px;
336-
display: inline-block;
337-
margin-left: 32px;
342+
display: flex;
338343
vertical-align: bottom;
339-
.arp-switch-label {
340-
padding-bottom: 28px;
341-
text-align: center;
342-
}
343344
.toggle-button:first-child{
344345
margin-bottom: 12px;
345346
}

css/react-select-overrides.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ $blue: #0047B4;
1010
display: inline-block;
1111
width: 200px;
1212
float: right;
13-
border: 3px solid white;
13+
border: 3px solid $blue;
1414
margin-top: 2px;
1515
margin-left: 12px;
1616

1717
}
1818
.Select.preset-list,
1919
.Select.midi-input-list {
2020
.Select-value-label {
21-
color: #fff;
21+
color: $blue;
2222
}
2323
.Select-arrow {
24-
border-color: #fff transparent transparent;
24+
border-color: $blue transparent transparent;
2525
}
2626
}
2727
.Select-placeholder {

src/App.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {connect} from 'react-redux'
1616

1717
import Synth from './audio/Synth.js'
1818
import HorizontalSlider from './views/Components/HorizontalSlider.js'
19+
import ArpeggiatorSwitch from './views/Effects/ArpeggiatorSwitch'
1920
import Keyboard from './views/Keyboard/Keyboard.js'
2021
import EventEmitter from 'event-emitter'
2122

@@ -53,6 +54,10 @@ class App extends React.Component {
5354
let action = Actions.masterGainChanged(e.target.value)
5455
this.props.dispatch(action)
5556
}
57+
onArpTempoChange (event) {
58+
let action = Actions.arpTempoChanged(Number(event.target.value))
59+
this.props.dispatch(action)
60+
}
5661

5762
render () {
5863
// Shows a message if no audio support in the browser.
@@ -75,6 +80,11 @@ class App extends React.Component {
7580
<div>
7681
<h1>Wavetable</h1>
7782
<a onClick={this.onOpenAboutModal.bind(this)}>About</a>
83+
84+
<MidiInput eventEmitter={eventEmitter} />
85+
<Presets presetId={this.props.Master.presetId} />
86+
</div>
87+
<div className="header-controls">
7888
<HorizontalSlider
7989
id='master'
8090
name='master gain'
@@ -84,11 +94,19 @@ class App extends React.Component {
8494
step={1}
8595
onChange={this.onMasterGainChanged.bind(this)}
8696
value={this.props.Master.volume} />
87-
<MidiInput eventEmitter={eventEmitter} />
88-
<Presets presetId={this.props.Master.presetId} />
97+
<ArpeggiatorSwitch
98+
arpIsOn={this.props.Effects.arpIsOn} />
99+
<HorizontalSlider
100+
name='arpTempo'
101+
label='arp tempo'
102+
min={10}
103+
max={160}
104+
step={1}
105+
onChange={this.onArpTempoChange.bind(this)}
106+
value={this.props.Effects.arpTempo} />
89107
</div>
90-
91108
</header>
109+
92110
<div className='scroll-contents'>
93111
{
94112
this.props.Oscillators.map((oscillator) => {

src/views/Effects/ArpeggiatorSwitch.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ class ArpeggiatorSwitch extends React.Component {
2929
render () {
3030
let selected = this.props.arpIsOn
3131
return (
32-
<div onClick={this.onArpValueChanged.bind(this)} className='arpeggiator-switch'>
33-
<div data-name={'on'} className={this.buttonClassName(true, selected)}>ON</div>
34-
<div data-name={'off'} className={this.buttonClassName(false, selected)}>OFF</div>
35-
<div className='arp-switch-label'>arp</div>
32+
<div>
33+
<div className='arp-switch-label'>arpeggiator</div>
34+
<div onClick={this.onArpValueChanged.bind(this)} className='arpeggiator-switch'>
35+
<div data-name={'on'} className={this.buttonClassName(true, selected)}>ON</div>
36+
<div data-name={'off'} className={this.buttonClassName(false, selected)}>OFF</div>
37+
</div>
3638
</div>
3739
)
3840
}

src/views/Effects/EffectsView.js

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import React from 'react'
66
import {connect} from 'react-redux'
77
import VerticalSlider from '../Components/VerticalSlider.js'
88
import Actions from '../../data/Actions.js'
9-
import ArpeggiatorSwitch from './ArpeggiatorSwitch'
9+
10+
11+
1012

1113
class EffectsView extends React.Component {
1214

@@ -23,11 +25,6 @@ class EffectsView extends React.Component {
2325
this.props.dispatch(action)
2426
}
2527

26-
onArpTempoChange (event) {
27-
let action = Actions.arpTempoChanged(Number(event.target.value))
28-
this.props.dispatch(action)
29-
}
30-
3128
render () {
3229
return (
3330
<div className='module'>
@@ -61,17 +58,7 @@ class EffectsView extends React.Component {
6158
step={1}
6259
onChange={this.onGlideChange.bind(this)}
6360
value={this.props.glide} />
64-
<ArpeggiatorSwitch
65-
arpIsOn={this.props.arpIsOn} />
66-
<VerticalSlider
67-
className='short'
68-
name='arpTempo'
69-
label='arp tempo'
70-
min={10}
71-
max={160}
72-
step={1}
73-
onChange={this.onArpTempoChange.bind(this)}
74-
value={this.props.arpTempo} />
61+
7562
</div>
7663
</div>
7764
</div>

src/views/Presets/Presets.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class Presets extends React.Component {
2929
}
3030

3131
render () {
32-
console.log("options --->", this.props.presetId, this.state.options);
3332
return (
3433
<div className='preset-list-container'>
3534
<Select

webpack.config.babel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module.exports = function () {
99
output: {
1010
path: resolve('dist'),
1111
filename: 'bundle.js',
12-
publicPath: '/dist/'
12+
// change this to './dist/' for production build, '/dist/' for local host.
13+
publicPath: './dist/'
1314
},
1415

1516
// 'eval' Eval will display the babel transpiled code.

0 commit comments

Comments
 (0)