你很牛!
我属牛的。当然要特别牛才行的。。。。{:4_172:}
<style>
#papa { left: -214px; width: 1024px; height: 600px; background: #333 url('https://pic.imgdb.cn/item/62e0fb43f54cd3f937bd5c9f.jpg') no-repeat center/cover; box-shadow: 4px 4px 24px #000; opacity: .95; position: relative; }
#piece { position: absolute; width: 90px; height: 66px; transition: all 4s; }
#papa input { border: none; outline: none; opacity: .75; cursor: pointer; }
#papa p { margin: 0; padding: 0; }
.playbox { position: absolute; left: 20px; bottom: 20px; padding: 10px; font: normal 1em sans-serif; color: gold; background: rgba(255,255,255,.2); border-radius: 8px; backdrop-filter: blur(1px); overflow: hidden; box-shadow: 1px 1px 2px rgba(0,0,0,.15); z-index: 100; }
#btnplay { width: 30px; height: 30px; border-radius: 50%; }
#btnplay:hover { background: #aaa; color: #ff0000; }
@keyframes rot1 { to { transform: rotate(360deg); } }
@keyframes rot2 { to { transform: rotate(-360deg); } }
</style>
<div id="papa">
<imgid="piece" alt="" src="/data/attachment/forum/202207/08/225900jzc7ctq9wa99r83a.gif" />
<div class="playbox">
<p id="geci" style="font-size: 1.2em; text-shadow: 1px 1px 1px #222">LRC Loading ... </p>
<p style="display: flex; align-items: center; gap: 4px; margin-top: 10px;">
<input id="btnplay" type="button" value=">" />
<input id="slider" type="range" min="0" max="100" value="0" />
<span id="per">0%</span>
</p>
</div>
</div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=416892296.mp3" autoplay="autoplay" loop="loop"></audio>
<script>
let aniFlag = 0, slip = 0;
let num = (min, max) => Math.floor(Math.random() * (max-min+1)) + min;
let lrcAr = [ ['0.00','曲名 : 安和桥(Cover 宋冬野) '], ['100.00','歌手 : 宇西'], ['180.00','谢谢欣赏'] ];
setTimeout(gogo,100);
slider.onmousedown = () => aud.pause();
slider.onchange = () => { aud.currentTime = slider.value * aud.duration / 100; aud.play(); }
btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('playing', () => btnplay.value = '||');
aud.addEventListener('pause', () => btnplay.value = '>');
aud.addEventListener('timeupdate', () => {
let prog = 100 * aud.currentTime / aud.duration;
slider.value = prog;
per.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);
for(j=0; j<lrcAr.length; j++){
if(aud.currentTime >= lrcAr - slip){
geci.innerHTML = lrcAr;
}
}
});
let toMin = (val) => {
if(!val) return '0:0';
val = Math.floor(val);
return parseInt(val / 60) + ':' +parseFloat(val % 60);
}
function gogo() {
let idx1 =num(0,1), idx2 = num(0,1);
let w1 = papa.clientWidth, w2 = piece.clientWidth, h1 = papa.clientHeight, h2 = piece.clientHeight;
piece.style.left = (w1 - w2) * idx1 + 'px';
piece.style.top = (h1 - h2) * idx2 + 'px';
setTimeout(gogo,6000);
}
</script>
加林森 发表于 2022-6-21 10:56
老梦不客气的。收礼开森!
谢谢你啊! 加林森 发表于 2022-6-21 10:55
红影上午好!是的,把歌词取点为转圈文字了。
这个转圈文字在这里还是很漂亮的{:4_204:} 红影 发表于 2022-6-21 16:48
这个转圈文字在这里还是很漂亮的
嗯嗯,有点意思的。 梦油 发表于 2022-6-21 14:26
谢谢你啊!
不客气的。
页:
1
[2]