-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
99 lines (76 loc) · 2.61 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
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1">
<meta name="theme-color" content="#2b3a42">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/amplitudejs@3.3.1/dist/amplitude.min.js"></script>
<link rel="stylesheet" type="text/css" href="./styles.css" />
</head>
<body>
<header> </header>
<div id="head">
<div id="logo"></div>
</div>
<div id="amplitude-player">
<div class="time-container" dir="ltr"> <span class="current-time">
<span class="amplitude-current-time" amplitude-main-current-time="true"></span> </span>
<progress class="amplitude-song-played-progress" id="song-played-progress" amplitude-main-song-played-progress="true"></progress> <span class="duration">
<span class="amplitude-duration-time" amplitude-main-duration-time="true"></span> </span>
</div>
<div id="amplitude-left">
<div id="player-left-bottom">
<div id="control-container">
<div id="central-control-container">
<div id="central-controls">
<div id="prev-container">
<div class="amplitude-prev" id="previous"></div>
</div>
<div id="play-pause-container">
<div class="amplitude-play-pause" amplitude-main-play-pause="true" id="play-pause"></div>
</div>
<div id="next-container">
<div class="amplitude-next" id="next"></div>
</div>
</div>
</div>
</div>
<div id="meta-container"> <span amplitude-song-info="name" id="song-name" amplitude-main-song-info="true"></span> </div>
</div>
</div>
<div id="menu-container">
<div id="share" onclick="openShare()"></div>
</div>
</div>
</body>
<script id="rendered-js" type="text/javascript" src="./audio.js"></script>
<script>
function download(file) {
window.location = file;
}
</script>
<script language="JavaScript">
window.onkeydown = function(e) {
return !(e.keyCode == 32);
};
/*
Handles a click on the song played progress bar.
*/
document.getElementById('song-played-progress').addEventListener('click', function(e) {
var offset = this.getBoundingClientRect();
var x = e.pageX - offset.left;
Amplitude.setSongPlayedPercentage((parseFloat(x) / parseFloat(this.offsetWidth)) * 100);
});
</script>
<script language="JavaScript">
var audiotitle = Amplitude.getActiveSongMetadata().name;
var audiourl = window.location.href;
openShare = async() => {
if(navigator.share) {
navigator.share({
title: audiotitle,
url: audiourl,
}).then(() => console.log('Successful share')).catch((error) => console.log('Error sharing', error));
}
};
</script>
</html>