宁静 发表于 2022-10-23 16:51

光辉岁月 帖赠:恋恋风尘

<style>
#papa { left: -270px; width: 1400px; height: 711px;top:150px; background: gray url('http://wx.ttt.dj/data/nfs/img/1400X711.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; display: grid; place-items: center; overflow: hidden; user-select: none; position: relative; z-index: 1; }
.btnplay { position: absolute; top: 0px; left: 100px; width: 80px; height: 80px; border-radius: 50%; box-shadow: 15px 10px 0 0 orange; cursor: pointer; z-index: 10; animation: swing 1s linear infinite alternate; }
.btnplay::before { position: absolute; content: ''; left: 20px; top: 12px; width: 100%; height: 100%; }
.btnplay::after { position: absolute; content: ''; left: 25px; top: 25px; width: 40%; height: 40%; border-radius: 50%; background: tan; box-shadow: 0 0 30px 0px purple, 0 0 100px 0 snow; }
#lrc { --motion: cover1; --tt: 1s; --state: paused; position: absolute; bottom: 200px;left: 150px; font: bold 2.4em sans-serif; color: hsl(60,100%,90%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0,100%,0%,.85)); }
#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(0,100%,50%,.75),hsla(60,100%,50%,.65)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
#svg { position: absolute; font: bold 10em sans-serif; }
.text { fill: none; stroke-width: 3; stroke-dasharray: 0 300; stroke-dashoffset: 0; }
.text:nth-child(3n + 1) { stroke: orange; animation: stroke1 30s ease-in-out infinite alternate; }
.text:nth-child(3n + 2) { stroke: red; animation: stroke2 30s ease-in-out infinite alternate; }
.text:nth-child(3n + 3) { stroke: snow; animation: stroke3 30s ease-in-out infinite alternate; }
.text:hover { fill: teal; opacity: .45; }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes swing { from { transform: rotate(0deg); } to { transform: rotate(30deg); } }
@keyframes stroke1 { to { stroke-dashoffset: 1000; stroke-dasharray: 80 160; } }
@keyframes stroke2 { to { stroke-dashoffset: 1080; stroke-dasharray: 80 160; } }
@keyframes stroke3 { to { stroke-dashoffset: 1160; stroke-dasharray: 80 160; } }
</style>

<div id="papa">
        <svg id="svg" width="1400" height="640">
                <symbol id="s-text"><text text-anchor="middle" x="35%" y="30%" dy=".35em">光辉岁月</text></symbol>
                <use xlink:href="#s-text" class="text"></use>
                <use xlink:href="#s-text" class="text"></use>
                <use xlink:href="#s-text" class="text"></use>
        </svg>
        <span class="btnplay" title="播放/暂停"></span>
        <span style="position: absolute; transform: rotate(270deg); bottom: -120px; left: 80px; ">
                <span class="btnplay" style="filter:blur(3px); opacity: .45; cursor: default;"></span>
        </span>
        <span id="lrc" data-lrc="帖赠:恋恋风尘">帖赠:恋恋风尘</span>
</div>

<script>
(function() {
        let mKey = 0, mFlag = true, aud = new Audio();
        let lrcAr = [
                ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ];
        let btnplay = document.querySelector('.btnplay');
        aud.src = 'https://wx.ttt.dj/data/nfs/mp3/ghss.mp3';
        aud.loop = false;
        aud.play();
        btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
        aud.addEventListener('pause', () => mState());
        aud.addEventListener('play', () => mState());
        aud.addEventListener('ended', () => { mKey = 0; aud.play(); });
        aud.addEventListener('timeupdate', () => {for (j = 0; j < lrcAr.length; j++) {if (aud.currentTime >= lrcAr) {if (mKey === j) showLrc(lrcAr);else continue;}}});
        let mState = () => aud.paused ? (btnplay.style.animationPlayState = 'paused', lrc.style.setProperty('--state', 'paused')) : (btnplay.style.animationPlayState = '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;};
})();
</script>
<br><br><br><br><br><br><br><br><br>

宁静 发表于 2022-10-23 16:52

@恋恋风尘

宁静 发表于 2022-10-23 16:53

发现你比我都忙。。。。搞失踪了{:9001:}

宁静 发表于 2022-10-23 16:55

弄几个播放器过来发,看见你的抖音上的都很漂亮,发过来

恋恋风尘 发表于 2022-10-23 16:57

哇,,爱了 爱了很漂亮,,谢谢,,,,{:10_401:}{:10_401:}

宁静 发表于 2022-10-23 16:58

恋恋风尘 发表于 2022-10-23 16:57
哇,,爱了 爱了很漂亮,,谢谢,,,,

发几个播放器上来

宁静 发表于 2022-10-23 17:02

恋恋风尘 发表于 2022-10-23 16:57
哇,,爱了 爱了很漂亮,,谢谢,,,,

不用谢,直接发播放器

蜻蜓 发表于 2022-10-23 19:31

宁静这帖子做的真漂亮!

苏三月 发表于 2022-10-23 20:29

才发现是我的网络不好,看不全呢{:9016:}

苏三月 发表于 2022-10-23 20:32

只能看到运行的三个元素,都是美美哒,没听到音乐
页: [1] 2 3 4 5
查看完整版本: 光辉岁月 帖赠:恋恋风尘