岩新新 发表于 2023-7-2 16:17

英文版--吻别

本帖最后由 岩新新 于 2023-7-2 16:23 编辑 <br /><br /><div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1915455">
<i class="pstatus"></i><br /><br /><style>
#mydiv {
        margin: 60px 0 0 calc(50% - 651px);
        width: 1140px;
        height: 640px;
        background: url('https://i.mp3.wf/view.php/bf2bf8e08915d817e3dd17d46f34dc02.gif');
        box-shadow: 0 0 8px 0 #000;
        display: grid;
        place-items: center;
        position: relative;
        z-index: 1;
}
#lrc {
        position: absolute;
        width: fit-content;
        height: fit-content;
        top: 5%;
        font: bold 2.4em Sans-serif;
        color: #fff;
        text-shadow: 1px 1px 2px #000;
        white-space: pre;
        display: inherit;
        place-items: inherit;
        user-select: none;
        --state: paused; --motion: cover2; --tt: 2s;
}
#lrc::before, #lrc::after { position: absolute; content: ''; cursor: pointer; }
#lrc::before {
        content: attr(data-lrc);
        width: 100%;
        height: 100%;
        white-space: pre;
        width: 0;
        left: 0;
        color: orange;
        overflow: hidden;
        animation: var(--motion) var(--tt) linear forwards var(--state);
}
#lrc::after {
        width: 50px;
        height: 50px;
        bottom: -60px;
        background: red;
        border-radius: 0%;
        opacity: .7;
        clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
        animation: rot 6s infinite linear var(--state);
}
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes rot { to { transform: rotate(360deg); } }
</style>

<div id="mydiv">
        <div id="lrc" data-lrc="HUACHAO">HUACHAO</div>
</div>
<audio id="aud" src="https://i.mp3.wf/view.php/d71aa54b97160c62cff3570237fa958b.mp3" autoplay="autoplay" loop="loop"></audio>

<script>
(function() {
        let mKey = 0, mFlag = true, slip = 0;
        let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
        let mState = () => lrc.style.setProperty('--state', aud.paused ? 'paused' : '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); };
        aud.addEventListener('timeupdate', () => {for (j = 0; j < lrcAr.length; j++) {if (aud.currentTime - slip >= lrcAr) {cKey = j;if (mKey === j)

showLrc(lrcAr);else continue;}}});
        aud.addEventListener('play', mState, false);
        aud.addEventListener('pause', mState, false);
        aud.addEventListener('seeked', () => calcKey());
        lrc.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
</script>
</td></tr></table>

红影 发表于 2023-7-2 18:13

漂亮的制作,好听的歌儿。欣赏新新好帖{:4_204:}

梦缘 发表于 2023-7-2 19:29

欣赏精彩佳作,点赞!{:4_204:}
页: [1]
查看完整版本: 英文版--吻别