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
| <script> var gongde = document.getElementById("gongde"); var muyu = document.getElementById("muyu"); var jishu = document.getElementById("jishu-box"); var mp3Url = "/music/muyu.mp3"; var player = new Audio(mp3Url); var num = 0; muyu.addEventListener("click", function() { num += 999; player.load(); player.play(); muyu.animate([{ transform: 'scale(0.85)' }, { transform: 'scale(1.03)' }, { transform: 'scale(1)' }], 500); gongde.animate([{ opacity: 0, transform: 'translateY(0)' }, { opacity: 0.3, transform: 'translateY(-10px)' }, { opacity: 0.8, transform: 'translateY(-20px)' }, { opacity: 1, transform: 'translateY(-30px)' }, { opacity: 0.8, transform: 'translateY(-35px)' }, { opacity: 0, transform: 'translateY(-40px)' }], 600); jishu.innerHTML = "<p id='jishu'>功德:" + num + "</p>"; }); </script>
|