加林森 发表于 2022-7-21 07:58

【三伏消暑】第陆天 华 《好想爱这个世界啊 (Live)》- 华晨宇

本帖最后由 加林森 于 2022-7-21 08:07 编辑 <br /><br /><style>
#papa { left: -202px; width: 1024px; height: 768px; background: #333 url('https://pic.imgdb.cn/item/62d7cab4f54cd3f937022772.jpg') no-repeat center/cover; box-shadow: 4px 4px 24px #7e6f52; position: relative; }
#papa input { border: none; outline: none; opacity: .75; cursor: pointer; }
#papa p { margin: 0; padding: 0; }
.playbox { position: absolute; left: 450px; bottom: 30px; padding: 10px; font: normal 1em sans-serif; color: #B8972B; background: rgba(255,255,255,.2); border-radius: 8px; backdrop-filter: blur(1px); overflow: hidden; box-shadow: 1px 1px 2px rgba(0,0,0,.15); z-index: 100; }
#btnplay { width: 30px; height: 30px; border-radius: 50%; }
#btnplay:hover { background: #aaa; color: #ff0000; }
#circle { left: 100px; top: -20px; width: 350px; height: 150px; border-radius: 20%; position: absolute; }
#mama { left: 50px; bottom: 90px; width: 100px; height: 100px; position: absolute;transition: 1s; }
@keyframes flash { to { opacity: 0; } }
</style>


<div id="papa">
        <div id="circle"></div>
      <img id="hunter" alt="" src="https://pic.imgdb.cn/item/6247e3c027f86abb2a56f17a.gif" />
        <div class="playbox">
                <p id="geci" style="font-size: 1.2em; text-shadow: 1px 1px 1px #222">好想爱这个世界啊 (Live) </p>
                <p style="display: flex; align-items: center; gap: 4px; margin-top: 10px;">
                        <input id="btnplay" type="button" value=">" />
                        <input id="slider" type="range" min="0" max="100" value="0" />
                        <span id="per">0%</span>
                </p>
        </div>
</div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=1436910205.mp3" autoplay="autoplay" loop="loop"></audio>

<script>

let slip = 0, idx = 0, total = 500, gap = 100;
let add = setInterval(addDot, gap), del;
let num = (min, max) => Math.floor(Math.random() * (max-min+1)) + min;
let lrcAr = [
        ['6.83','好想爱这个世界啊 (Live) - 华晨宇'],
        ['9.81','作词 : 裴育'],
        ['12.68','作曲 : 华晨宇'],
        ['14.67','抱着沙发 睡眼昏花 凌乱头发'],
        ['17.36','却渴望像电影主角一样潇洒'],
        ['25.94','屋檐角下 排着乌鸦 密密麻麻'],
        ['29.39','被压抑的情绪不知如何表达'],
        ['37.19','无论我 在这里 在那里'],
        ['41.14','仿佛失魂的虫鸣'],
        ['43.45','却明白此刻应该做些努力'],
        ['49.20','无论我 在这里 在那里'],
        ['53.32','不能弥补的过去'],
        ['55.78','每当想起'],
        ['59.59','想过离开 以这种方式存在'],
        ['64.29','是因为 那些旁白 那些姿态 那些伤害'],
        ['71.60','不想离开 当你说还有你在'],
        ['76.25','忽然我开始莫名 期待'],
        ['92.81','夕阳西下 翻着电话 无人拨打'],
        ['96.67','是习惯孤独的我该得到的吧'],
        ['103.07','独木桥呀 把谁推下 才算赢家'],
        ['108.87','我无声的反抗 何时能战胜它'],
        ['116.78','无论我 在这里 在那里'],
        ['120.58','仿佛失魂的虫鸣'],
        ['123.16','却明白此刻应该做些努力'],
        ['128.64','无论我 在这里 在那里'],
        ['133.53','不能弥补的过去'],
        ['135.53','每当想起'],
        ['139.91','想过离开 以这种方式存在'],
        ['144.35','是因为 那些旁白 那些姿态 那些伤害'],
        ['150.80','不想离开 也许尝试过被爱'],
        ['155.73','会开始仰望未来'],
        ['159.97','伤疤 就丢给回忆吧'],
        ['172.36','放下 才得到更好啊'],
        ['179.12','别怕 别怕'],
        ['183.93','想过离开 当阳光败给阴霾'],
        ['189.16','没想到你会拼命为我拨开'],
        ['201.89','曾想过离开 却又坚持到现在'],
        ['208.33','熬过了 那些旁白 那些姿态'],
        ['211.77','那些伤害'],
        ['213.87','不想离开 当你的笑容绽开'],
        ['219.69','这世界突然填满 色彩'],
        ['246.91','抱着沙发 睡眼昏花 凌乱头发'],
        ['254.27','夕阳西下 接通电话 是你呀']
];


slider.onmousedown = () => aud.pause();
slider.onchange = () => { aud.currentTime = slider.value * aud.duration / 100; aud.play(); }
btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('playing', () => btnplay.value = '||');
aud.addEventListener('pause', () => btnplay.value = '>');

aud.addEventListener('timeupdate', () => {
        let prog = 100 * aud.currentTime / aud.duration;
        slider.value = prog;
        per.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);
                for(j=0; j<lrcAr.length; j++){
                if(aud.currentTime >= lrcAr - slip){
                        geci.innerHTML = lrcAr;
                }
        }
});

let toMin = (val) => {
        if(!val) return '0:0';
        val = Math.floor(val);
        return parseInt(val / 60) + ':' +parseFloat(val % 60);
}

function addDot() {
        let ele = document.createElement('span');
        let ww = circle.offsetWidth / 2;
        ele.className = 'star';
        ele.style.animation = 'flash ' + 0.1 * num(10,50) + 's infinite';
        let pos = calcCirclePos({x: ww, y: ww, r: num(0,ww - 2), a: num(0,360)});
        ele.style.left = pos.xx + 'px';
        ele.style.top = pos.yy + 'px';
        circle.appendChild(ele);
        idx ++;
        if(idx >= total){
                clearInterval(add);
                idx = 0;
                del = setInterval(delDot, gap);
        }
}

function delDot() {
        let ele = document.querySelector('.star');
        if(ele) {
                circle.removeChild(ele);
        } else {
                clearInterval(del);
                add = setInterval(addDot,gap);
        }
}

function calcCirclePos({x,y,r,a}) {
        let xx = x + r * Math.cos((a * Math.PI) / 180);
        let yy = y + r * Math.sin((a * Math.PI) / 180);
        return {xx,yy};
}
</script>


加林森 发表于 2022-7-21 07:58

华晨宇

樵歌 发表于 2022-7-21 10:06

跟小辣椒学的哈。{:4_173:}

加林森 发表于 2022-7-21 10:43

樵歌 发表于 2022-7-21 10:06
跟小辣椒学的哈。

这样方便点嘛。{:4_189:}

浣溪沙 发表于 2022-7-21 11:09

看画听歌蛮好哒,队长好制作,点赞{:4_176:}

加林森 发表于 2022-7-21 11:17

浣溪沙 发表于 2022-7-21 11:09
看画听歌蛮好哒,队长好制作,点赞

谢谢沙沙!{:4_190:}

梦油 发表于 2022-7-21 13:30

开阔的画面给人很舒服的感觉。

加林森 发表于 2022-7-21 14:50

梦油 发表于 2022-7-21 13:30
开阔的画面给人很舒服的感觉。

是的。

小星世龙 发表于 2022-7-21 15:26

精彩,漂亮,画胜诗词。

加林森 发表于 2022-7-21 16:56

小星世龙 发表于 2022-7-21 15:26
精彩,漂亮,画胜诗词。

谢谢支持!

樵歌 发表于 2022-7-21 18:42

加林森 发表于 2022-7-21 10:43
这样方便点嘛。

对的,怎么快乐怎作哈{:4_174:}

加林森 发表于 2022-7-21 19:01

樵歌 发表于 2022-7-21 18:42
对的,怎么快乐怎作哈

就是。

红影 发表于 2022-7-21 19:12

队长找华晨宇救场啊,聪明。喜欢花花的歌,制作真漂亮{:4_187:}

加林森 发表于 2022-7-21 19:24

红影 发表于 2022-7-21 19:12
队长找华晨宇救场啊,聪明。喜欢花花的歌,制作真漂亮

谢谢红影支持!
页: [1]
查看完整版本: 【三伏消暑】第陆天 华 《好想爱这个世界啊 (Live)》- 华晨宇