-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
122 lines (107 loc) · 3.25 KB
/
Copy pathindex.html
File metadata and controls
122 lines (107 loc) · 3.25 KB
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
<!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.0">
<title>Audio Visualizer PoC</title>
<style>
* {
margin: 0;
padding: 0;
border: 0;
}
body {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 14px;
}
a {
color: #3949ca;
text-decoration: none;
}
a:hover {
color: #050344;
}
#visualisation {
display: block;
z-index: 1;
}
#visualisation, html, body {
height: 100%;
width: 100%;
}
#play-pause {
display: inline-block;
background-color: #3949ca;
color: #FFF;
padding: 1rem;
border-radius: 1rem;
outline: none;
}
#pause {
position: absolute;
top: 10px;
left: 50px;
}
#stop {
position: absolute;
top: 10px;
left: 100px;
}
#credit {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 99;
padding: 1rem;
color: #656565;
}
.player {
display: grid;
height: 100%;
grid-template-rows: calc(100% - 100px) 100px;
}
.player__visualisation {
background: rgb(4,2,67);
position: relative;
background: linear-gradient(180deg, rgba(4,2,67,1) 0%, rgba(25,22,111,1) 100%);
}
.player__progress {
background-color: #3949ca;
position: absolute;
bottom: 0;
left: 0;
right: 50%;
height: 5px;
z-index: 99;
}
#play-pause:hover {
background-color: #050344;
}
.player__controls {
display: flex;
align-items: center;
justify-content: center;
}
</style>
</head>
<body>
<div class="player">
<div class="player__visualisation">
<canvas id="visualisation"></canvas>
<div class="player__progress"></div>
</div>
<div class="player__controls">
<audio id="audio-source" src="./music.mp3"></audio>
<button type="button" id="play-pause">Play</button>
</div>
<div id="credit">
Music by <a href="http://www.bensound.com" target="_blank">bensound.com</a>
</div>
</div>
<script src="script.js"></script>
</body>
</html>