【秋。图】肩上的云@霑夷@丝璇(祝福你们)
本帖最后由 【诗】秋丫 于 2022-10-27 13:54 编辑 <br /><br /><style>#papa { left: -80px; width: 1024px; height: 640px; background: gray
url('http://www.bohann.net/data/attachment/forum/202209/16/092040s3ujia7uoqdjzb59.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; z-index: 1; }
#mplayer { position: absolute; right: 20px; top: 10px; width: 300px; height: 80px; user-select: none; display: grid; place-items: center; cursor: pointer; }
#btnwrap { --yy: -15px; width: 40px; height: 40px; transform: rotate(45deg); border: 1px solid gray; border-radius: 6px; opacity: .15; }
#mplayer:hover #btnwrap, #mplayer:hover #prog { transform: translateY(var(--yy)); }
#mplayer:hover #btnwrap { background: linear-gradient(to top right, rgba(0,255,0,.45), rgba(255,0,0,.35)); border-radius: 50%; opacity: .95; }
#btnwrap, #prog { position: absolute; display: grid; place-items: center;transition: .5s; }
#btnplay { width: 20px; height: 20px; background: #eee; clip-path: polygon(0 0, 0% 100%, 100% 50%); }
#btnpause { width: 2px; height: 20px; border-style: solid; border-width: 0px 4px; border-color: transparent #eee; display: none; }
#prog { --yy: 20px; width: 300px; height: 16px; border-radius: 10px; background: linear-gradient(90deg, rgba(0,255,0,.45), rgba(255,0,0,.35) 100%, transparent 0); border: 1px solid gray; font: normal 14px / 16px sans-serif; color: purple; }
#lrc { position: absolute; left: 20px; top: 20px; font: bold 2em sans-serif; color: transparent; letter-spacing: 2px; background: linear-gradient(to right, darkred, gold, orange, snow) 100% 0 / 200% 100%; background-clip: text; -webkit-background-clip: text; animation: bgMerge 4s linear infinite; }
@keyframes bgMerge { from { background-position: 0 0; } to { background-position: -100% 0; } }
</style>
<div id="papa">
<div id="lrc">lrc</div>
<div id="mplayer">
<div id="btnwrap"><span id="btnplay"></span><span id="btnpause"></span></div>
<div id="prog">00:00 | 00:00</div>
</div>
</div>
<script>
let lrcAr = [
['0.00','肩上的云'],
['240.00','感谢支持']
];
let aud = new Audio();
aud.src = 'https://music.163.com/song/media/outer/url?id=1895376991.mp3';
aud.autoplay = true;
aud.loop = true;
btnwrap.onclick = () => aud.paused ? aud.play() : aud.pause();
prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
aud.addEventListener('pause', () => btnstate());
aud.addEventListener('play',() => btnstate());
aud.addEventListener('timeupdate', () => {
prog.style.background= 'linear-gradient(90deg, rgba(0,255,0,.45), rgba(255,0,0,.35) ' + aud.currentTime / aud.duration * 100 + '%, transparent 0)';//prog.offsetWidth * aud.currentTime / aud.duration) + 'px 0px';
prog.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);
for(j=0; j<lrcAr.length; j++) {
if(aud.currentTime >= lrcAr) lrc.innerText = lrcAr;
}
});
let btnstate = () => aud.paused ? (btnplay.style.display = 'block', btnpause.style.display = 'none') : (btnplay.style.display = 'none', btnpause.style.display = 'block');
let toMin = (val)=> {
if (!val) return '00:00';
val = Math.floor(val);
let min = parseInt(val / 60), sec = parseFloat(val % 60);
if(min < 10) min = '0' + min;
if(sec < 10) sec = '0' + sec;
return min + ':' + sec;
}
</script> @【北】霑夷 @【诗】丝璇 ,看你喜欢音画,送你们一个,祝幸福。。{:6_191:}{:6_191:} 这个好璀璨~ 初点开吓我一跳~{:4_117:} 【诗】秦绮 发表于 2022-10-27 14:00
这个好璀璨~
做得不好。。 【诗】秦绮 发表于 2022-10-27 14:00
初点开吓我一跳~
歌曲不好听吗?{:9_320:} 【诗】秋丫 发表于 2022-10-27 14:02
歌曲不好听吗?
图图好大,以为我手机又乱码了~{:4_132:} 【诗】秦绮 发表于 2022-10-27 14:08
图图好大,以为我手机又乱码了~
哈哈,这就是图图的。 好听,弄得这么好,真有才 这曲子真美 图也好看 【北】紫麟 发表于 2022-10-27 14:17
好听,弄得这么好,真有才
谢谢紫兄谷粒,下午好。{:6_191:} 【诗】朝澜 发表于 2022-10-27 14:18
这曲子真美
我也喜欢听的,妹妹。。 【诗】朝澜 发表于 2022-10-27 14:18
图也好看
网上淘的。。 http://m801.music.126.net/20221027235457/9f63a4f94784df6879a177fbb09abf33/jdymusic/obj/wo3DlMOGwrbDjj7DisKw/11682707844/7ca2/88c8/5ee8/2f14d879e4b68e2f112007332b18e7fe.mp3
制作精美好看{:6_191:} 超级喜欢的歌曲,丫丫辛苦 【北】霑夷 发表于 2022-10-27 23:38
制作精美好看
公子,早。 【诗】知春 发表于 2022-10-28 00:16
超级喜欢的歌曲,丫丫辛苦
春春,早。
页:
[1]