-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
190 lines (170 loc) · 9.14 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Siren</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="app.css">
<link rel="icon" href="favicon.svg" />
</head>
<body>
<div id="app">
<div id="loading-wrapper" v-if="isLoading">
<div id="loading-text">LOADING</div>
<div id="loading-content"></div>
</div>
<div class="container">
<div class="row mt-4">
<!-- Modulation -->
<div class="col-12 col-lg-8">
<div class="card text-white bg-dark mb-3">
<div class="card-header">
Modulation
</div>
<div class="card-body pt-2">
<div class="row">
<div class="col-12 col-lg-4">
<div class="card bg-secondary-custom text-white h-100">
<div class="card-body">
<h5 class="card-title">Wave</h5>
<div class="custom-control custom-radio">
<input type="radio" id="sine" name="wave" v-model="values.siren.waveForm" value="sine" class="custom-control-input">
<label class="custom-control-label" for="sine">Sine</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="triangle" name="wave" v-model="values.siren.waveForm" value="triangle" class="custom-control-input">
<label class="custom-control-label" for="triangle">Triangle</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="square" name="wave" v-model="values.siren.waveForm" value="square" class="custom-control-input">
<label class="custom-control-label" for="square">Square</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="sawtooth" name="wave" v-model="values.siren.waveForm" value="sawtooth" class="custom-control-input">
<label class="custom-control-label" for="sawtooth">Sawtooth</label>
</div>
</div>
</div>
</div>
<!-- Tone -->
<div class="col-12 col-lg-4">
<div class="card bg-secondary-custom text-white h-100">
<div class="card-body">
<h5 class="card-title">Tone <small>({{ values.siren.tone }})</small></h5>
<p><input class="custom-range" v-model="values.siren.tone" max="1400" min="40" step="10" value="700" type="range"></p>
</div>
</div>
</div>
<!-- Speed -->
<div class="col-12 col-lg-4">
<div class="card bg-secondary-custom text-white h-100">
<div class="card-body">
<h5 class="card-title">Speed <small>({{ values.siren.speed }})</small></h5>
<p><input class="custom-range" v-model="values.siren.speed" max="12" min="0.1" step="0.1" value="8" type="range"></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Presets -->
<div class="col-12 col-lg-4">
<div class="card text-white bg-dark mb-3">
<div class="card-header">
Presets
</div>
<div class="card-body">
<p>
<button v-bind:class="{ 'btn btn-secondary ml-1 mr-1 mt-1 mb-1': true, 'btn-info': selectedPreset == p.name }" v-on:click="applyPreset(p)" v-for="p in presets">{{ p.name }}</button>
</p>
<p><button class="btn btn-light btn-block ml-1 mr-1 mt-1 mb-1" v-on:click="applyRandomPreset(p)">Random</button></p>
</div>
</div>
</div>
<!-- Delay -->
<div class="col-12 col-lg-6">
<div class="card text-white bg-dark mb-3">
<div class="card-header">
Delay
</div>
<div class="card-body">
<div class="row">
<div class="col-12 mb-3 text-center">
<div class="card text-white bg-secondary-custom mb-3">
<div class="card-body">
<div class="custom-control custom-switch">
<input type="checkbox" v-model="values.isDelayEnabled" class="custom-control-input" id="customSwitch1">
<label class="custom-control-label" for="customSwitch1">On/Off</label>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<div class="card text-white bg-secondary-custom mb-3">
<div class="card-body">
<p>Time <small>({{ values.delay.time }})</small></p>
<p><input class="custom-range" v-model="values.delay.time" max="1700" min="1" step="1" type="range"></p>
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<div class="card text-white bg-secondary-custom mb-3">
<div class="card-body">
<p>Feedback <small>({{ values.delay.feedback }})</small></p>
<p><input class="custom-range" v-model="values.delay.feedback" max="1" min="0" step="0.1" type="range"></p>
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<div class="card text-white bg-secondary-custom mb-3">
<div class="card-body">
<p>Mix <small>({{ values.delay.mix }})</small></p>
<p><input class="custom-range" v-model="values.delay.mix" max="1" min="0" step="0.1" type="range"></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Output -->
<div class="col-12 col-lg-4">
<div class="card text-white bg-dark mb-3">
<div class="card-header">
Output
</div>
<div class="card-body">
<div class="row">
<div class="col-12">
<p>Volume <small>({{ values.volume }})</small></p>
<p><input class="custom-range" v-on:update="updateVolume()" v-model="values.volume" max="1" min="0" step="0.1" type="range"></p>
</div>
<div class="col-12">
<div class="progress" style="height: 30px;">
<div v-bind:class="{ 'progress-bar bg-success': true, 'bg-danger': isClipping }" role="progressbar" :style="{ width: meterValue + '%' }" :aria-valuenow="meterValue" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 text-center">
<button class="btn btn-info btn-lg btn-block" v-on:keydown.space="play" v-on:keyup.space="stop" @mousedown="play" @mouseup="stop"><i class="fa fa-play" aria-hidden="true"></i> Trigger</button>
<small>Or press the <b>space</b> bar..</small>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tunajs/1.0.1/tuna-min.js" type="text/javascript"></script>
<script src="vendor/volume-meter.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js" type="text/javascript"></script>
<script src="app.js" type="text/javascript"></script>
</body>
</html>