-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
221 lines (176 loc) · 4.05 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>p5.js audio visualizer</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<style>
/* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */
input {
z-index: 2;
position: absolute;
bottom: 45px;
left: 10px;
width: 300px;
}
.loader {
font-family: sans-serif;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50% -50%);
display: none;
}
.loader.loading { display: block; }
canvas {
z-index: 1;
margin:auto;
}
body{
margin: 0;
padding: 0;
display: block;
overflow: hidden;
font-size; 30px;
font-family: 'Lato', sans-serif;
}
.button {
background-color: #4169E1;
border: 1px solid black;
color: white;
padding: 5px 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.textbox {
background: white;
border: 1px solid #4169E1;
border-radius: 5px;
box-shadow: 0 0 5px 3px #4169E1;
color: #666;
outline: none;
height:23px;
width: 275px;
}
#title {
color: white;
position: absolute;
bottom: 15px;
left: 10px;
}
#instruction {
color: white;
position: absolute;
bottom: 85px;
left: 10px;
}
#button_play {
z-index: 2;
position: absolute;
bottom: 40px;
left: 33.3%;
}
#button_pause {
z-index: 2;
position: absolute;
bottom: 40px;
left: 33.3%;
}
#scrubber {
z-index: 2;
position: absolute;
bottom: 10px;
left: 33.3vw;
}
.link {
color: rgb(255, 255, 255);
}
/* navbar */
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #f3f3f3;
position: fixed;
top: 0;
width: 100%;
}
li {
border-left: 1px solid #bbb;
float: right;
}
li a {
display: block;
color: #4169E1;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #ddd;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body>
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title> Music Visualizer</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div id="hideBody">
<div id="title">
<h2>P5.JS Audio Visualizer</h2>
</div>
<div id="instruction">
<h4>Choose your song file here:</h4>
</div>
<input style="
padding-left:5px;
border: 1px solid #4169E1;
border-radius: 5px;
bottom: 45px;
box-shadow: 0 0 5px 3px #4169E1; " id="audiofile" controls type="file"/>
<h3 class="loader">Loading...</h3>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.min.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.5/addons/p5.sound.min.js'></script>
<script language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/addons/p5.dom.min.js"></script>
<script language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/addons/p5.sound.min.js"></script>
<script src="./script.js"></script>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="#news">WebGL Audio Visualizer</a></li>
</ul>
<div id="controls">
<div id="button_play">
<button
type="button"
class="button"
value="Play"
onclick="mode('play')"
style="position: relative; right: 86px;"
>⏵</button>
</div>
<div id="button_pause">
<button
type="button"
class="button"
onclick="mode('pause')"
style="position: relative; right: 50px;"
>❚❚</button>
</div>
</div>
</div>
</body>
</html>
<script src="./script.js"></script>
</body>
</html>