醉美水芙蓉 发表于 2022-10-22 22:30

当思念变成火焰

本帖最后由 醉美水芙蓉 于 2022-10-23 09:01 编辑 <br /><br /><style>
#papa { left:-214px; width: 1024px; height: 640px; background: url('https://s1.ax1x.com/2022/10/22/xgeN59.jpg') 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: ''; width: 100%; height: 100%; background: url('https://638183.freep.cn/638183/t22/webp/124.gif') repeat; opacity: var(--opt); }
#mplayer { position: absolute; bottom: 0; z-index: 9; }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; top: 500px; font: bold 2.4em sans-serif; 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(280,100%,50%,.75),hsla(180,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%; } }
</style>

<div id="papa">
        <div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
        <svg id="mplayer" width="360" height="60" style="user-select: none;">
                <rect x="50" y="25" rx="6" ry="6" width="200" height="12" stroke="hsla(280,90%,55%,.45)" fill="hsla(60,100%,92%,.35)" id="track" />
                <rect x="50" y="25" rx="6" ry="6" width="0" height="12" stroke="transparnet" fill="hsla(280,90%,55%,.45)" id="prog" />
                <text x="260" y="31" font-size="14" dominant-baseline="middle" stroke="none" fill="tan" id="audtime">00:00 | 00:00</text>
                <text x="10" y="35" font-size="40" dominant-baseline="middle" stroke="tan" fill="purple" id="btnplay" style="cursor: pointer;">☀
                        <animateTransform attributeName="transform" dur="4s" type="rotate" from="0 26.86 30" to="360 26.86 30" repeatCount="indefinite" />
                </text>
        </svg>
</div>

<script>
(function() {
        let mp = { len: track.getAttribute('width')*1, x: track.getAttribute('x')*1 }, aud = new Audio(), mKey = 0, mFlag = true;
               let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
        aud.src = 'https://www.qqmc.com/up/kwlink.php?id=221991129&.mp3';
        aud.loop = true;
        aud.autoplay = true;
        if(aud.paused) mplayer.pauseAnimations();
        btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
        prog.onclick = track.onclick = (e) => aud.currentTime = aud.duration * (e.offsetX - mp.x) / mp.len;
        aud.addEventListener('seeked', () => calcKey());
        aud.addEventListener('pause', () =>mState());
        aud.addEventListener('play', () =>mState());
        aud.addEventListener('timeupdate', () => {prog.style.setProperty('width', aud.currentTime * 200 / aud.duration + 'px');audtime.textContent = 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 ? (mplayer.pauseAnimations(),lrc.style.setProperty('--state', 'paused'),papa.style.setProperty('--opt','0')) : (mplayer.unpauseAnimations(), 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>

马黑黑 发表于 2022-10-22 22:41

很精致的制作,棒棒哒

小辣椒 发表于 2022-10-22 22:58

问好水芙蓉,这个是黑黑老师的(夕颜花)播放器效果

改了歌词的到下面了{:4_199:}

醉美水芙蓉 发表于 2022-10-22 23:14

小辣椒 发表于 2022-10-22 22:58
问好水芙蓉,这个是黑黑老师的(夕颜花)播放器效果

改了歌词的到下面了

谢谢辣椒美女光临支持!

醉美水芙蓉 发表于 2022-10-22 23:15

马黑黑 发表于 2022-10-22 22:41
很精致的制作,棒棒哒

谢谢黑黑老师光临!

马黑黑 发表于 2022-10-22 23:22

醉美水芙蓉 发表于 2022-10-22 23:15
谢谢黑黑老师光临!

你的歌词数组拿去增强版转换一下就好

醉美水芙蓉 发表于 2022-10-22 23:34

马黑黑 发表于 2022-10-22 23:22
你的歌词数组拿去增强版转换一下就好

本来是做的加的老师的鱼儿&#128031;的动画,感觉不太好!就做了个简单的!忘了歌词同步没有换?我还在找原因呢,怎么歌词不动了,谢谢黑黑老师指导!

马黑黑 发表于 2022-10-22 23:37

醉美水芙蓉 发表于 2022-10-22 23:34
本来是做的加的老师的鱼儿&#128031;的动画,感觉不太好!就做了个简单的!忘了歌词同步没有换?我还在找 ...

现在这个歌词,拿去增强版那里,点微调,粘贴完整的歌词数组到大文本框,小文本框输入音乐地址,再点左下方的“微调”按钮,就可以了,需要手工微调的就慢慢做,要个大概的这就成

起个网名好难 发表于 2022-10-22 23:45

欣赏、点赞

起个网名好难 发表于 2022-10-22 23:50

本帖最后由 起个网名好难 于 2022-10-23 00:36 编辑

醉美水芙蓉 发表于 2022-10-22 23:34
本来是做的加的老师的鱼儿&#128031;的动画,感觉不太好!就做了个简单的!忘了歌词同步没有换?我还在找 ...
每行歌词都差了个持续时间的数值,大致应是如下摸样的
['0.00', '当思念变成火焰 (DJ默涵版) - 安静',2.84],
['2.99', '词:于跃好',0.77],
['3.80', '曲:石雨菲',0.81],
['4.65', '制作人:米奇',0.90],
['5.60', 'Op:星汉马文化',16.83],
['23.32', '夜空中的残月孤单',4.35],
['27.90', '那是谁偷走它的另一半',5.66],
['33.86', '想着你的长夜漫漫',4.90],
['39.02', '你的身影在脑海不停打转',5.62],
['44.94', '等待是种痛的纠缠',4.87],
['50.07', '我始终走不出这道心坎',5.62],
['55.99', '多想和你再见一面',4.93],
['61.18', '无奈这爱留下太多遗憾',6.29],
['67.80', '当思念变成火焰',4.93],
['72.99', '燃烧着我的每个夜晚',4.94],
['78.19', '多少次在梦里把你呼唤',4.90],
['83.35', '泪水落满枕头一遍又一遍',5.06],
['88.68', '当思念变成火焰',4.81],
['93.74', '燃不尽我对你的爱恋',4.95],
['98.95', '老天为什么拆开这段缘',5.00],
['104.21', '却忘了把这份情丝给剪断',24.65],
['130.16', '等待是种痛的纠缠',4.49],
['134.89', '我始终走不出这道心坎',5.67],
['140.86', '多想和你再见一面',4.80],
['145.91', '无奈这爱留下太多遗憾',6.17],
['152.40', '当思念变成火焰',5.00],
['157.66', '燃烧着我的每个夜晚',4.98],
['162.90', '多少次在梦里把你呼唤',5.01],
['168.17', '泪水落满枕头一遍又一遍',4.85],
['173.28', '当思念变成火焰',4.95],
['178.49', '燃不尽我对你的爱恋',5.10],
['183.86', '老天为什么拆开这段缘',4.95],
['189.07', '却忘了把这份情丝给剪断',4.5]

醉美水芙蓉 发表于 2022-10-23 09:03

起个网名好难 发表于 2022-10-22 23:50
每行歌词都差了个持续时间的数值,大致应是如下摸样的

谢谢老师指导!

相约爱晚亭 发表于 2022-10-23 10:59

欣赏音画佳作!

醉美水芙蓉 发表于 2022-10-23 15:20

相约爱晚亭 发表于 2022-10-23 10:59
欣赏音画佳作!

谢谢老师欣赏支持!

红影 发表于 2022-10-23 23:08

这个是动图可以跟随暂停的,水芙蓉美女真棒,制作真漂亮{:4_187:}

醉美水芙蓉 发表于 2022-10-24 06:30

红影 发表于 2022-10-23 23:08
这个是动图可以跟随暂停的,水芙蓉美女真棒,制作真漂亮

谢谢红影美女支持!

红影 发表于 2022-10-24 16:47

醉美水芙蓉 发表于 2022-10-24 06:30
谢谢红影美女支持!

问好水芙蓉,新周快乐{:4_187:}
页: [1]
查看完整版本: 当思念变成火焰