小辣椒 发表于 2024-10-15 21:47

纯音欣赏---古筝演奏 (套用黑黑和光同尘播放器效果)


<style>
        #tz {margin: 140px 0 20px calc(50% - 801px);width: 1438px; height: 772px; border: 1px solid gray; background: url('https://wj1.zp68.com:812/lxx/yunhua/2023/01/17/5IF.gif') no-repeat center/cover; box-shadow: 3px 3px 6px gray; border-radius: 8px; z-index: 1; position: relative; }
        #player, #ssvg { position: absolute; }
        #player { width: 150px; height: 150px; left: calc(10% - 100px); top: 560px; cursor: pointer; animation: rot 8s infinite linear var(--state); }
        .down { animation: down var(--dur) var(--delay) linear infinite var(--state), flash 1s var(--delay) infinite alternate linear var(--state); }
        @keyframes down { to { transform: rotate(-10deg) translate(0, 1000px); } }
        @keyframes flash { to { opacity: 0; } }
        @keyframes rot { to { transform: rotate(360deg); } }
#dt2{ position: absolute; width:244px; height: 120px;bottom: 0px; right: 0px; ; }
#dt3{ position: absolute; width: 32px; height: 32px; top: 50px; left: 920px; }


</style>

<div id="tz">
<img id="dt2" src="https://file.uhsea.com/2410/f1ab3a81bf3829bde02709037f803e6eXL.png " alt="" />
<img id="dt3" src="https://xlaj.cn/assets/file/zp/20231112124430.jpg " alt="" />

        <audio id="aud" src="https://wj1.zp68.com:812/lxx/yunhua/2023/01/17/yy/01.mp3" autoplay loop></audio>
        <svg id="ssvg" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
                <symbol id="cc" width="10" height="10" viewBox="0 0 10 10">
                        <circle cx="5" cy="5" r="5"></circlie>
                </symbol>
                <defs>
                        <g><animate attributeName="y" to="400" dur="10s" repeatCount="indefinite"></animate></g>
                </defs>
        </svg>
        <img id="player" alt="" src="https://638183.freep.cn/638183/web/svg/3star_133731353409967500.svg" />
</div>

<script>
mkBalls = (num) => {
        var ww = ssvg.clientWidth,
                str = '',
                colors = ['orange', 'tan', 'yellow', 'gold', 'red', 'plum', 'pink', 'purple'];
        Array(num).fill(0).forEach((a,b) => {
                var x = Math.round(Math.random() * (ww - 20)),
                        size = Math.floor(Math.random() * 18) + 4,
                        fill = colors,
                        dur = Math.floor(10 * Math.random() + 10),
                        delay = -1 * Math.round(Math.random() * 15);
                str += `<use x="${x}" y="-20" width="${size}" height="${size}" fill="${fill}" href="#cc" class="down" style="--dur:${dur}s;--delay:${delay}s"/>`;
        });
        return str;
};

ssvg.innerHTML += mkBalls(50);

mState = () => {
        player.style.setProperty('--state', aud.paused ? 'paused' : 'running');
        ssvg.style.setProperty('--state', aud.paused ? 'paused' : 'running');
};
aud.onplaying = aud.onpause = () => mState();
player.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>

小辣椒 发表于 2024-10-15 21:48

@马黑黑

黑黑套用玩一个{:4_205:}

起个网名好难 发表于 2024-10-15 21:57

https://5b0988e595225.cdn.sohucs.com/images/20170929/062e8b7bb79942b3ad2b0868bd570947.gif

小辣椒 发表于 2024-10-15 22:04

起个网名好难 发表于 2024-10-15 21:57


难难晚上好,谢谢欣赏{:4_187:}

红影 发表于 2024-10-15 22:22

这个漂亮,还有飘飞落叶和闪烁的圆点点,和svg粒子如此相配。
欣赏亲爱的好帖{:4_199:}

樵歌 发表于 2024-10-16 07:09

江南名曲,柔美的。好听。
这次没弄动图图,把那个弹琴的小美女的眉毛弄得一眨一眨的?{:4_189:}

梦江南 发表于 2024-10-16 07:47

好漂亮的图图,把黑黑老师的代码发挥到极致了。{:4_187:}

梦油 发表于 2024-10-16 09:17

古筝的音色真美。

小文 发表于 2024-10-16 10:17

喜欢

醉美水芙蓉 发表于 2024-10-16 11:40

马黑黑 发表于 2024-10-16 22:52

小辣椒 发表于 2024-10-15 21:48
@马黑黑

黑黑套用玩一个

美美哒
页: [1]
查看完整版本: 纯音欣赏---古筝演奏 (套用黑黑和光同尘播放器效果)