小辣椒 发表于 2023-7-17 21:36

出卖我 - 歌手:程响 (学习套用黑黑烟花落尽频谱效果)

<style>
#mydiv { margin: 150px 0 0 calc(50% - 780px); width: 1383px; height: 771px; background: url('https://xlaj.cn/assets/file/zp/20230717212510.gif') no-repeat center/cover; box-shadow: 0 0 8px 0 #000; opacity: .9; overflow: hidden; z-index: 1; position: relative; --state: paused; }
#lrc { position: absolute; top: 100px; left: 50%; transform: translate(-50%); 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)); --motion: cover2; --tt: 5s; }
#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,100%,50%,.45),hsla(0,100%,50%,.75)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards var(--state); }
pinpu-wrapper { position: absolute; bottom: 0; left: 50%; transform: translate(-50%); cursor: pointer; }
pin-pu { position: absolute; bottom: 0; animation: pinpuMotion var(--du) var(--delay) infinite alternate linear var(--state);}
.mybox { position: absolute; bottom: -100px; left: calc(96% - 158px); font-size: 100px; animation: up 8s var(--delay) infinite linear var(--state); --delay: 0s; --deg: 5deg; }
.mybox:nth-of-type(2) { --delay: -2s; --deg: -5deg; }
.mybox:nth-of-type(3) { --delay: -4s; --deg: -15deg; }
.mybox:nth-of-type(4) { --delay: -6s; --deg: -15deg; }
@keyframes pinpuMotion { from { height: 0px; } to { height: var(--height); } }
@keyframes up { to { transform: rotate(var(--deg)) translateY(-740px); } }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
</style>

<div id="mydiv">
        <span class="mybox">&#127880;</span>
        <span class="mybox">&#127880;</span>
        <span class="mybox">&#127880;</span>
    <span class="mybox">&#127880;</span>
        <pinpu-wrapper></pinpu-wrapper>
        <div id="lrc"data-lrc="花潮lrc在线">花潮lrc在线</div>
</div>
<audio id="aud"src="https://xlaj.cn/assets/file/zp/20230717212546.mp3" autoplay loop></audio>

<script>

~function() {
        let pinpuNum = 100, pinpuWidth = 6, pinpuHeight = 120, mKey = 0, mFlag = true, slip = 0.2;
        let ppwrap = document.querySelector('pinpu-wrapper');
       
let lrcAr = [
                ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ];
        let mState = () => aud.paused ? (mydiv.style.setProperty('--state','paused'), lrc.style.setProperty('--state','paused')) : (mydiv.style.setProperty('--state','running'), lrc.style.setProperty('--state','running'));
        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 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 msort = (ar) => {let newAr = [];ar.forEach((v,k) => k % 2 === 0 ? newAr.unshift(v) : newAr.push(v));return newAr;}
        ~function() {let ar = Array.from(Array(pinpuNum), (v,k) => pinpuNum - k -1);Array.from({length: pinpuNum}).forEach((item,key) => {item = document.createElement('pin-pu');item.style.cssText += `width: ${pinpuWidth}px;left: ${(pinpuWidth + 2) * key}px;background: #${Math.random().toString(16).substr(-6)};--height: ${15 + (pinpuHeight - 15) / pinpuNum * msort(ar)}px;--du: ${Math.random() * .3 + .3}s;--delay: -${Math.random()}s;`;ppwrap.appendChild(item);});ppwrap.style.height = `${pinpuHeight}px`;ppwrap.style.width = `${(pinpuWidth + 2) * pinpuNum}px`;}();
        aud.addEventListener('play', mState, false);
        aud.addEventListener('pause', mState, false);
        aud.addEventListener('seeked', calcKey, false);
        aud.addEventListener('timeupdate', () => {
        for (j = 0; j < lrcAr.length; j++) {if (aud.currentTime >= lrcAr + slip) {cKey = j;if (mKey === j) showLrc(lrcAr);else continue;}}});
        ppwrap.onclick = () => aud.paused ? aud.play() : aud.pause();
}();

</script>

小辣椒 发表于 2023-7-17 21:37

@马黑黑

黑黑套用玩一个,只是因为时间关系,我直接把歌曲裁剪了一半掉{:4_170:}

小辣椒 发表于 2023-7-17 21:38

这个气球发现可以给画面添彩,特别这个红颜色,歌词颜色也是不用换{:4_173:}

小辣椒 发表于 2023-7-17 21:38

谢谢黑黑的教程分享,频谱稍微改了一下尺寸

马黑黑 发表于 2023-7-17 21:41

小辣椒 发表于 2023-7-17 21:38
这个气球发现可以给画面添彩,特别这个红颜色,歌词颜色也是不用换

配套了

马黑黑 发表于 2023-7-17 21:42

小辣椒 发表于 2023-7-17 21:37
@马黑黑

黑黑套用玩一个,只是因为时间关系,我直接把歌曲裁剪了一半掉

{:4_172:}

千羽 发表于 2023-7-17 21:53

这个图太亮眼了,美美的,棒棒哒{:4_187:}

小辣椒 发表于 2023-7-17 21:54

马黑黑 发表于 2023-7-17 21:41
配套了

是的。这个气球颜色很漂亮的

千羽 发表于 2023-7-17 21:54

歌儿也挺好听的{:4_187:}

小辣椒 发表于 2023-7-17 21:54

马黑黑 发表于 2023-7-17 21:42


速度快很多啊{:4_170:}

小辣椒 发表于 2023-7-17 21:54

千羽 发表于 2023-7-17 21:53
这个图太亮眼了,美美的,棒棒哒

千羽看见你了,我们有好几天没有碰到了

千羽 发表于 2023-7-17 21:56

小辣椒 发表于 2023-7-17 21:54
千羽看见你了,我们有好几天没有碰到了

是啊,这两天忙啊{:4_187:}

小辣椒 发表于 2023-7-17 21:58

千羽 发表于 2023-7-17 21:54
歌儿也挺好听的

千羽这首歌特别长,我赶时间,裁剪了一半,现在这样也是不错,听不出少了一半{:4_170:}

小辣椒 发表于 2023-7-17 21:59

千羽 发表于 2023-7-17 21:56
是啊,这两天忙啊

先忙自己的事,现实也是重要的

千羽 发表于 2023-7-17 22:03

小辣椒 发表于 2023-7-17 21:58
千羽这首歌特别长,我赶时间,裁剪了一半,现在这样也是不错,听不出少了一半

第一次听,感觉不出来{:4_173:}

红影 发表于 2023-7-17 22:04

亲爱的真快,这么快就做出来了。底图特别漂亮。欣赏亲爱的好帖{:4_187:}

千羽 发表于 2023-7-17 22:04

小辣椒 发表于 2023-7-17 21:59
先忙自己的事,现实也是重要的

嗯,瞎忙{:4_173:}

小辣椒 发表于 2023-7-17 22:07

千羽 发表于 2023-7-17 22:03
第一次听,感觉不出来

我也是第一次听,感觉太长,直接裁了一点掉

醉美水芙蓉 发表于 2023-7-17 22:08

小辣椒 发表于 2023-7-17 22:08

红影 发表于 2023-7-17 22:04
亲爱的真快,这么快就做出来了。底图特别漂亮。欣赏亲爱的好帖

这个是套用速度是快的,10点要下的,怕来不及,所以歌曲也是裁了一点掉。
页: [1] 2 3
查看完整版本: 出卖我 - 歌手:程响 (学习套用黑黑烟花落尽频谱效果)