军港之夜--苏小明演唱
本帖最后由 相约爱晚亭 于 2022-11-22 16:07 编辑 <br /><br /><style>#papa { left:-214px; top: 100px;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;left: 20px; display: grid; grid-template-columns: auto auto auto; place-items: center; gap: 6px; user-select: none; }
#btnplay {border-radius: 50%;left: 20px;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: absolute; width: 1000px; top:50px; left: 650px;font-family:楷体;font-size: 28px;font-weight:bold;font-style: italic; color:#80ffdf;">苏小明演唱</div>
<div style="position: absolute; width: 1000px;top:550px; left:780px;font-family:楷体;font-size: 28px;font-weight:bold;font-style: italic; color:#b38600;">相约爱晚亭</div>
<div style="position: absolute; width: 1000px; top:590px; 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 =[['0.00', '军港之夜',2.0],
['2.02', '军港之夜',2.8],
['4.91', '作词:马金星',2.1],
['7.15', '作曲:刘诗召',2.7],
['9.98', '演唱:苏小明',1.9],
['11.98', 'LRC歌词制作:相约爱晚亭',4.8],
['17.07', '军港的夜啊静悄悄',8.1],
['25.56', '海浪把战舰轻轻地摇',7.9],
['33.84', '年轻的水兵头枕着波涛',7.8],
['42.08', '睡梦中露出甜美的微笑',7.8],
['50.28', '海风你轻轻地吹',3.9],
['54.33', '海浪你轻轻地摇',4.0],
['58.52', '远航的水兵多么辛劳',7.7],
['66.60', '回到了祖国母亲的怀抱',7.8],
['74.76', '让我们的水兵好好睡觉',6.9],
['80.00', '★★★★★★★★',5.6],
['90.00', 'LRC歌词制作 相约爱晚亭',6.9],
['95.16', '★★★★★★★★',7.0],
['102.50', '独白:军港的夜啊静悄悄',5.3],
['108.05', '海浪把战舰轻轻地摇',5.1],
['113.40', '年轻的水兵头枕着波涛',5.3],
['119.00', '睡梦中露出甜美的微笑',5.9],
['125.27', '海风你轻轻地吹',3.7],
['129.21', '海浪你轻轻地摇',4.1],
['133.50', '远航的水兵多么辛劳',7.2],
['141.10', '待到朝霞映红了海面',7.8],
['149.32', '看我们的战舰就要起锚',8.3],
['158.10', '鸣…',18.0],
['177.00', '',4.5]];
aud.src = 'https://pan.365.tf/uploads/dengkh/军港之夜-苏小明.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><br><br><br><br> <br><br><br><br> 谢谢黑黑老师源码分享! 晚景的图意,精致优雅,令人神往,棒棒哒 好曲美图,特别是水中的倒影真漂亮。 马黑黑 发表于 2022-10-29 09:02
晚景的图意,精致优雅,令人神往,棒棒哒
谢谢黑黑老师美言鼓励! 醉美水芙蓉 发表于 2022-10-29 09:41
老师动图做得漂亮!
找到一个可上传gif图片的图床,使软件制作的水波图得以呈现。 梦油 发表于 2022-10-29 10:13
好曲美图,特别是水中的倒影真漂亮。
找到一个制作水波纹的软件,第一次尝试制作倒影动图。做同步歌词有点费时,不如剪映有自动识别歌词功能好用。 相约爱晚亭 发表于 2022-10-29 10:49
找到一个制作水波纹的软件,第一次尝试制作倒影动图。做同步歌词有点费时,不如剪映有自动识别歌词功能好 ...
做得很好了。 相约爱晚亭 发表于 2022-10-29 10:40
谢谢黑黑老师美言鼓励!
{:4_191:} 这首歌承载了一代人的记忆! 相约爱晚亭 发表于 2022-10-29 10:49
找到一个制作水波纹的软件,第一次尝试制作倒影动图。做同步歌词有点费时,不如剪映有自动识别歌词功能好 ...
倒影非常真实,好漂亮的动态背景图。欣赏爱晚亭精美制作{:4_199:} 欣赏、点赞! 起个网名好难 发表于 2022-10-29 13:14
欣赏、点赞!
谢谢老师的支持和点赞! 闲言不语 发表于 2022-10-29 11:17
这首歌承载了一代人的记忆!
谢谢您的关注和评点! 马黑黑 发表于 2022-10-29 09:02
晚景的图意,精致优雅,令人神往,棒棒哒
黑黑老师,本帖同步歌词不运作了,以前是正常的。我把代码放到本地DW上测试,同步歌词运作正常。您帮我看看,是那儿出错了? 相约爱晚亭 发表于 2022-11-22 16:12
黑黑老师,本帖同步歌词不运作了,以前是正常的。我把代码放到本地DW上测试,同步歌词运作正常。您帮我看 ...
黑黑老师,问题找到了,不知什么时候浏览器选择为兼容方式了,现改回极速模式,同步歌词正常运作了。
页:
[1]