醉美水芙蓉 发表于 2022-6-28 22:46

故乡情歌 - 云飞

本帖最后由 醉美水芙蓉 于 2022-6-28 22:45 编辑 <br /><br /><style>
.papa { left: -214px; width: 1024px; height: 680px; background: rgba(0,0,0,.6) url('https://s1.ax1x.com/2022/06/28/jex2cV.png') no-repeat center / cover; box-shadow: 0 2px 30px #000; overflow: hidden; position: relative; perspective: 1000px; }
.papa::before { position: absolute; content: ''; width: 1024px; height: 680px; background: url('https://s1.ax1x.com/2022/06/28/jejjxK.png') no-repeat center /cover; opacity: 1; transform-style: preserve-3d; }
.papa:hover::before { animation: rot 4s forwards; }
.papa input { border: none; outline: none; opacity: .75; cursor: pointer; }
.papa p { margin: 0; padding: 0; }
.playbox { position: absolute; bottom: 10px; left: 10px; padding: 10px; width: fit-content; font: normal 1em sans-serif; color: ghostwhite; background: rgba(255,255,255,.25); backdrop-filter: blur(2px); overflow: hidden; box-shadow: 1px 2px 2px #000; text-shadow: 1px 1px 1px #000; z-index: 100; }
#btnplay { width: 30px; height: 30px; border-radius: 50%; }
#btnplay:hover { background: #aaa; color: #ff0000; }
@keyframes rot { to { transform: scale3d(0,0,-200) skew(0,30deg); } }
</style>

<div class="papa">
        <div class="playbox">
                <p id="geci" style="font-size: 1.2em">LRC Loading ... </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:0 | 0:0</span>
                </p>
        </div>
        <audio id="aud" src="https://www.qqmc.com/up/kwlink.php?id=225302751&.mp3" autoplay="autoplay" loop="loop"></audio>
</div>

<script>
let slider = document.querySelector('#slider'),
        aud = document.querySelector('#aud'),
        per = document.querySelector('#per'),
        btnplay = document.querySelector('#btnplay'),
        geci = document.querySelector('#geci');
let slip = 0;

let lrcAr = [
        ['0.00','故乡情歌 - 云飞'],
        ['0.06','词:内蒙古民歌'],
        ['1.05','曲:内蒙古民歌'],
        ['20.03','LRC编辑:醉美水芙蓉'],
        ['38.04','碧绿的草原铺向远方'],
        ['47.02','天边浮现出座座白毡房'],
        ['55.07','那里有童年的七彩憧憬'],
        ['64.03','那是我生长的美丽的家乡'],
        ['75.04','朵朵白云飘在青山上'],
        ['83.07','青山蜿蜒伸向远方'],
        ['92.00','梦中映现出迷人的景色'],
        ['100.06','带我回到了美丽的家乡'],
        ['109.03','梦中映现出迷人的景色'],
        ['117.08','带我回到了美丽的家乡'],
        ['163.01','朵朵白云飘在青山上'],
        ['171.04','青山蜿蜒伸向远方'],
        ['180.00','梦中映现出迷人的景色'],
        ['188.06','带我回到了美丽的家乡'],
        ['197.00','梦中映现出迷人的景色'],
        ['205.06','带我回到了美丽的家乡'],
        ['214.03','那里有童年的七彩憧憬'],
        ['222.08','那是我生长的美丽的家乡'],
        ['231.03','那里有童年的七彩憧憬'],
        ['239.09','那是我生长的美丽的家乡'],
        ['245.03','谢谢欣赏!']
];

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 = (sec) => {
        if(!sec) return '0:00';
        sec = parseInt(sec);
        return parseInt(sec / 60) + ':' + parseFloat(sec % 60).toString().padStart(2,'0');
}
</script>

加林森 发表于 2022-6-28 23:18

谢谢水芙蓉。制作得很漂亮!

马黑黑 发表于 2022-6-29 07:38

风景美美哒,帖子漂漂哒{:4_199:}

红影 发表于 2022-6-29 08:34

满眼绿色,这个让人看得心旷神怡。欣赏水芙蓉好制作{:4_187:}
页: [1]
查看完整版本: 故乡情歌 - 云飞