Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ryan778
GitHub Repository: Ryan778/Ryan778.github.io
Path: blob/master/bkmusic/script.js
574 views
1
var currentOption = 'rick';
2
var previewTracks = {
3
'sandstorm': 'https://archive.org/download/DarudeSandstorm_201411/Darude%20-%20Sandstorm.mp3',
4
'rick': 'https://pixelcoding.nl/download/rickroll.mp3',
5
'sax': 'https://ryan778.github.io/bkmusic/tracks/sax.mp3',
6
'nyan': 'https://web.archive.org/web/20170517005627/http://www.nyan.cat/music/technyancolor.mp3',
7
'tacos': 'https://ryan778.github.io/bkmusic/tracks/rainingtacos.mp3',
8
'whitenoise': 'https://ryan778.github.io/bkmusic/tracks/whitenoise.mp3'
9
}
10
var dlTracks = {
11
'sandstorm': 'DarudeSandstorm.js',
12
'rick': 'RickRoll.js',
13
'sax': 'EpicSaxGuy.js',
14
'nyan': 'NyanCat.js',
15
'tacos': 'RainingTacos.js',
16
'whitenoise': 'WhiteNoise.js'
17
}
18
function selectOption(newopt){
19
document.getElementById('opt_'+currentOption).className = 'option';
20
currentOption = newopt;
21
document.getElementById('opt_'+newopt).className = 'option selected';
22
if(!audio.paused){
23
audio.pause();
24
previewbtn.innerHTML = "<i class='fa fa-play fa-fw'></i>";
25
}
26
showDL(agree.checked);
27
}
28
function showDL(x){
29
var dl = document.getElementById('dl');
30
if(x){
31
dl.href = currentOption+'.js';
32
dl.download = dlTracks[currentOption];
33
}
34
else{
35
dl.removeAttribute('href');
36
dl.removeAttribute('download');
37
}
38
}
39
function preview(){
40
var audio = document.getElementById('audio');
41
if(audio.paused){
42
previewbtn.innerHTML = "<i class='fa fa-cog fa-spin fa-fw'></i>";
43
audio.src = previewTracks[currentOption];
44
audio.play();
45
}
46
else{
47
previewbtn.innerHTML = "<i class='fa fa-play fa-fw'></i>";
48
audio.pause();
49
}
50
}
51
52
function showAbout(){
53
alertify.alert("<b>About</b><br>Inspired by <a href='http://www.latlmes.com/'>La Tlmes</a>, this site serves to allow people to harmlessly prank their friends, coworkers, and enemies. I don't take responsibility (you agreed to this when downloading the scripts) but will take suggestions and/or comments. <br><b>Contact Me:</b> <br>Twitter: <a href='https://twitter.com/ryanz778'>@ryanz778</a>, Mail: <a href='mailto:[email protected]'>[email protected]</a>")
54
}
55
56
function showDMCA(){
57
alertify.alert("<b>DMCA</b><br>Some tracks aren't hosted on this site, thus, contact the site owner hosting the tracks for DMCA takedown requests.<br><br>If a track is on my site, contact me at <a href='mailto:[email protected]'>[email protected]</a> for DMCA requests");
58
}
59
60
window.onload = function(){
61
var audio = document.getElementById('audio');
62
audio.onplaying = function(){
63
previewbtn.innerHTML = "<i class='fa fa-stop fa-fw'></i>";
64
}
65
}
66