-
Notifications
You must be signed in to change notification settings - Fork 0
/
audio.html
115 lines (115 loc) · 8.35 KB
/
audio.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="zh-CN">
<head>
<title>音乐播放</title>
<meta charset="UTF-8" />
<meta name="description" content="音乐播放">
<meta name="keywords" content="循环噪音播放器">
<meta name="robots" content="index,follow"/>
<meta name="author" content="lvlanxing"/>
<meta name="google" value="notranslate"/>
<!-- 网页控制 -->
<meta name="referrer" content="no-referrer"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="Access-Control-Allow-Origin" content="*"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<link rel="shortcut icon" href="/img/favicon.ico"/>
<!-- <link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/popzoo/pop/images/favicon.ico"> -->
<!-- iphone suitable -->
<meta name="theme-color" content="#000000"/>
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=0.4,maximum-scale=1.0,minimum-scale=0.3"/>
<link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/gh/popzoo/guide/img/bird2.jpg"/>
<meta name="apple-mobile-web-app-title" content="POPZOO"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="email=no"/>
<div style="text-align:center;clear:both"></div>
</head>
<body style="background:url('https://cdn.jsdelivr.net/gh/popzoo/guide/img/nier_0.jpg') no-repeat fixed;background-size:100% 100%;-moz-background-size:100% 100%;">
<a id="left_link" href="#" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#64CEAA; color:#fff; position: fixed; top: 0; border: 0; left: 0; transform: scale(-1, 1);z-index: 10;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>
<a id="right_link" href="#" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#70B7FD; color:#fff; position: fixed; top: 0; border: 0; right: 0;z-index: 100;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>
<style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<h1 style="color: lime;text-align: center;">音乐脉冲炮</h1>
<div id="top" style="text-align: center;margin: 40px;">
<audio id="audio_play" controls autoplay="autoplay" preload="auto" src="audio/fireworks.mp3"/>
<!-- 您的浏览器不支持 audio 标签!</audio> -->
</div>
<div style="text-align: center;color: blue;font-size: 25px;font-weight: 500;background-color: #FDFDFD;width: 300px;height:54px;line-height: 54px; margin: 0 auto 0;border-radius: 27px;">播放间隔:<input id="control_time" type="text" name="audioTime" value="10" style="width:90px;height:30px;font-size: 25px;">(秒)
</div>
<p style="text-align: center;margin-top:10%;"><img src="https://cdn.jsdelivr.net/gh/popzoo/pop/images/homeGirl.gif" width="270px"></p>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/popzoo/guide/js/renewLink.js"></script>
<!-- <script type="text/javascript">
var serverUrl = document.location.protocol+"//"+document.domain;//WARNING:访问*.html,因为浏览器禁用自动播放
(function initParam(retry){
let paramUrl = retry ? 'https://popzoo.glitch.me/initparam' : 'https://param.firenet.workers.dev';
fetch(paramUrl, {
method: 'GET',
mode: 'cors',
cache: 'default'
}).then((res)=>{
return res.json()
}).then((json)=>{
let domainUrl = window.atob(json.domainUrl);
if(document.URL.indexOf(domainUrl)>-1){
serverUrl = window.atob(json.tlsoffer);
}
runControl();
}).catch((error)=>{
if(retry){
console.error("Param Request Failure", error);
}else{
initParam(true);
}
});
})();
function runControl() {
// let curHour = parseInt(dateFormat("HH",new Date()));
// if(curHour>=3&&curHour<=6){//3~7点
var playGap = document.getElementById("control_time").value;
playGap = playGap > 0 ? parseInt(playGap) * 1000 : 1000 * 10; //默认10s
var timeGap = Math.floor(playGap * Math.random()) + playGap; //*60;// here should *60s
let reqUrl = serverUrl+'/audioName';
// console.debug(reqUrl);
fetch(reqUrl, {
method: 'GET',
mode: 'no-cors',
cache: 'default',
credentials: 'omit'
}).then((res) => {
return res.text();
}).then((txt) => {
document.getElementById('audio_play').setAttribute("src", "https://cdn.jsdelivr.net/gh/popzoo/guide/audio/" + txt); //play new audio name
document.getElementById('audio_play').play();
setTimeout(function(){runControl()}, timeGap);
console.info("播放文件【"+txt+"】-|+|-播放间隔【" + timeGap / 1000 + "s】-|+|-播放时间【" + new Date().toLocaleString() + "】");
}).catch(err => {
console.error('Audio文件访问失败', err);
let audioSrc = "https://cdn.jsdelivr.net/gh/popzoo/guide@master/audio/glassbomb.mp3";
document.getElementById('audio_play').setAttribute("src", audioSrc);
document.getElementById('audio_play').play();
setTimeout(function(){runControl()}, timeGap);
})
}
//date util
function dateFormat(fmt, date) {
let ret;
let opt = {
"Y+": date.getFullYear().toString(),
"m+": (date.getMonth() + 1).toString(),
"d+": date.getDate().toString(),
"H+": date.getHours().toString(),
"M+": date.getMinutes().toString(),
"S+": date.getSeconds().toString()
};
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt;
}
</script> -->
</body>
</html>