电子木鱼(by pbp)

/ 83 阅读 / 0评 / 2690字 / 0

主题原因, 显示可能会有问题, 请访问 muyu.html

代码(HTML):

<!DOCTYPE html>
<html>

<head>
<script>
var a=Number("0");

var myKnockSound=new Audio("https://chongzhen.wikidot.com/local--files/files:pbp/muyu.mp3");

var mySenPaiSound=new Audio("https://chongzhen.wikidot.com/local--files/files:pbp/%E9%87%8E%E5%85%BD%E5%85%88%E8%BE%88%E5%A3%B0%E9%9F%B3%E7%B4%A0%E6%9D%90.mp3");

var myLaughSound=new Audio("https://chongzhen.wikidot.com/local--files/files:reno/%E4%BD%9B%E7%A5%96%E7%AC%91%E5%A3%B0.mp3");

function stra(){
    document.getElementById("counter").innerHTML = String(a);
}
function myPlus(){
    a=a+1;
    myKnockSound.play();
    document.getElementById("counter").innerHTML = String("功德+1");
    setTimeout("stra()","300");
    if (a==114514) {
        mySenPaiSound.play();
    }
}
function myLaugh(){
    a=Number("0");
    myLaughSound.play();
    stra();
    alert("佛曰:“做人不仅要心胸宽广,更要脑洞大开!”\n功 德 尽 丧 !");
}
</script>


<style>
#counter {
    position:absolute;
    top:0.5em;
    left:calc(300px - 2em);
    left:250px;
    width:2em;
    height:2em;
    font-size:1.5em;
    color:white;
    text-align:right;
}
#laugh {
    width:300px;
    text-align:center;
    font-size:2em;
    cursor:pointer;
}
#muyuimg {
    width:300px;
    cursor:crosshair;
</style>
</head>

<body>
<div id="counter"></div>
<img id="muyuimg" src="https://chongzhen.wdfiles.com/local--files/files%3Apbp/muyu2.jpg" onClick="myPlus();"></img><br />
<button id="laugh" type="button" onClick="myLaugh();">佛 祖 陪 你 一 起 笑</button>
<script>var beginningA=Number("0");document.getElementById("counter").innerHTML = String(beginningA);</script>
<noscript><p>电子木鱼,功德无量。<br />请施主开启JavaScript。</p><style>#laugh,#muyuimg {display:none;}</style></noscript>
</body>

</html>

from http://pbp.wikidot.com/include:internet-wooden-fish

CC BY-SA 3.0

除非特别声明,本站所有文章均采用 CC BY-NC-SA 4.0 协议,转载时请附上作者和原文链接。


发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注