相约爱晚亭 发表于 2022-10-29 11:00

军港之夜

<style>
#papa { left: -15px; top: 10px;width: 1024px; height: 640px; background: url('http://tuku.link/imgs/2022/11/6c99e44804f972a1.gif') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; display: grid; place-items: center; user-select: none; z-index: 1; --opt: .25; }
#papa::before { position: absolute; content: ''; background: url('https://638183.freep.cn/638183/t22/gif/121.gi') repeat; width:100%; height: 100%; mix-blend-mode: screen; opacity: var(--opt); animation: opa linear 20s infinite alternate; }

#papa::after { position: absolute; content: '军港之夜 '; white-space:pre; font: bold 3em sans-serif; font-style: italic; color: #668cff; top: 20px; right: 380px; text-shadow: 2px 2px 4px #000; }
#mplayer { position: absolute; bottom: 10px; display: grid; grid-template-columns: auto auto auto; place-items: center; gap: 6px; user-select: none; }
#btnplay {border-radius: 50%; width: 50px; height: 50px; cursor: pointer; animation: rot linear 3s infinite; }
#prog { --ww: 0px; width: 300px; height: 12px; border: 1px solid green; border-radius: 6px; background: snow; opacity: .65; position: relative; }
#prog::before { position: absolute; content: ''; width: var(--ww); height: 12px; border-radius: 6px; background: snow linear-gradient(90deg, orange, red); opacity: .65; }
#audtime { font: normal 14px sans-serif; color: hsl(0,80%,50%); }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; bottom: 60px; font: bold 2.4em sans-serif; font-style: italic; color: hsl(0,10%,90%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0,0%,0%,.95)); }
#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(60,50%,50%,.45),hsla(0,100%,50%,.75)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes rot { to { transform: rotate(1turn); } }
</style>

<div id="papa">
      <div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
      <div id="mplayer">
                <img id="btnplay" src="https://638183.freep.cn/638183/t22/btn/g1.png" alt="" />
                <span id="prog"></span>
                <span id="audtime">00:00 | 00:00</span>
      </div>
<div style="position: relative; width: 1000px; top:-50px; left: 650px;font-family:楷体;font-size: 28px;font-weight:bold;font-style: italic; color:#80ffdf;">苏小明演唱</div>
<div style="position: relative; width: 1000px; top:250px; left:780px;font-family:楷体;font-size: 28px;font-weight:bold;font-style: italic; color:#b38600;">相约爱晚亭</div>
<div style="position: relative; width: 1000px; top:70px; left: 900px;font-family:楷体;font-size: 20px;font-weight:bold;font-style: italic; color:#997300;">20221029</div>
</div>

<script>
(function() {
      let aud = new Audio(), mKey = 0, mFlag = true, down = true;
      let lrcAr = [['2.02', '军港之夜',2.75],
['4.91', '作词:马金星',2.13],
['7.15', '作曲:刘诗召',2.69],
['9.98', '演唱:苏小明',1.90],
['11.98', 'LRC歌词制作:相约爱晚亭',4.84],
['17.07', '军港的夜啊静悄悄',8.07],
['25.56', '海浪把战舰轻轻地摇',7.87],
['33.84', '年轻的水兵头枕着波涛',7.83],
['42.08', '睡梦中露出甜美的微笑',7.79],
['50.28', '海风你轻轻地吹',3.85],
['54.33', '海浪你轻轻地摇',3.98],
['58.52', '远航的水兵多么辛劳',7.68],
['66.60', '回到了祖国母亲的怀抱',7.75],
['74.76', '让我们的水兵好好睡觉',6.88],
['82.00', '★★★★★★★★',7.60],
['90.00', 'LRC歌词制作 相约爱晚亭',4.90],
['95.16', '★★★★★★★★',6.97],
['102.50', '独白:军港的夜啊静悄悄',5.27],
['108.05', '海浪把战舰轻轻地摇',5.08],
['113.40', '年轻的水兵头枕着波涛',5.32],
['119.00', '睡梦中露出甜美的微笑',5.96],
['125.27', '海风你轻轻地吹',3.74],
['129.21', '海浪你轻轻地摇',4.08],
['133.50', '远航的水兵多么辛劳',7.22],
['141.10', '待到朝霞映红了海面',7.81],
['149.32', '看我们的战舰就要起锚',8.34],
['158.10', '鸣…',17.96],
['177.00', '',4.5]];
      aud.src = 'https://music.163.com/song/media/outer/url?id=291156.mp3';
      aud.loop = true;
      aud.autoplay = true;
      if(aud.paused) btnplay.style.animationPlayState = 'paused';
      btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
      prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
      aud.addEventListener('seeked', () => calcKey());
      aud.addEventListener('pause', () =>mState());
      aud.addEventListener('play', () =>mState());
      aud.addEventListener('timeupdate', () => {let prg = aud.currentTime * prog.offsetWidth / aud.duration < 6 ? 6 : aud.currentTime * prog.offsetWidth / aud.duration;prog.style.setProperty('--ww', prg + 'px');audtime.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);for(j=0; j<lrcAr.length; j++) {if(aud.currentTime >= lrcAr) {cKey = j;if(mKey === j) showLrc(lrcAr);else continue;}}});
      let calcKey = () => {for(j = 0; j < lrcAr.length; j ++) {if(aud.currentTime <= lrcAr) {mKey = j - 1;break;}}if(mKey <0) mKey = 0;if(mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;let time = lrcAr - (aud.currentTime - lrcAr);showLrc(time);};
      let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = lrc.dataset.lrc = lrcAr;lrc.style.setProperty('--motion', name);lrc.style.setProperty('--tt', time + 's');lrc.style.setProperty('--state', 'running');mKey += 1;mFlag = !mFlag;};
      let mState = () => aud.paused ? (btnplay.style.animationPlayState='paused',lrc.style.setProperty('--state', 'paused'),papa.style.setProperty('--opt','0')) : (btnplay.style.animationPlayState='running', lrc.style.setProperty('--state', 'running'),papa.style.setProperty('--opt','.25'));
      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>
<br><br><br><br>

沉醉的曲 发表于 2022-10-29 11:18

问好老师,欣赏佳作-军港之夜,赏图听歌,点赞。

非常开心 发表于 2022-10-29 21:18

欣赏楼主的新作,点赞多谢分享!

蓝魔 发表于 2022-10-29 22:59

欣赏一下,谢谢。

相约爱晚亭 发表于 2022-10-30 09:56

沉醉的曲 发表于 2022-10-29 11:18
问好老师,欣赏佳作-军港之夜,赏图听歌,点赞。

谢谢您的支持和加分鼓励!问好!

相约爱晚亭 发表于 2022-10-30 09:56

非常开心 发表于 2022-10-29 21:18
欣赏楼主的新作,点赞多谢分享!

谢谢您的支持和鼓励!问好!

相约爱晚亭 发表于 2022-10-30 09:57

蓝魔 发表于 2022-10-29 22:59
欣赏一下,谢谢。

谢谢您的关注和支持!

张红 发表于 2022-10-30 17:23

问好朋友
欣赏你的精彩

诺北 发表于 2022-10-31 09:43

欣赏了,不过代码贴放音画版不合适哦,我先转到《代码图腾》了

相约爱晚亭 发表于 2022-11-1 14:56

张红 发表于 2022-10-30 17:23
问好朋友
欣赏你的精彩

谢谢张红朋友临帖评点、问好、鼓励!祝快乐开心每一天!
页: [1] 2
查看完整版本: 军港之夜