找回密码
 立即注册
搜索
查看: 9|回复: 1

[特效音画] 短兵相接(有代码) 转自马黑作品

[复制链接]

1490

主题

3178

回帖

1万

积分

管理员

积分
12789
发表于 昨天 14:45 | 显示全部楼层 |阅读模式

1490

主题

3178

回帖

1万

积分

管理员

积分
12789
 楼主| 发表于 昨天 14:45 | 显示全部楼层
<style>
    @import 'https://638183.freep.cn/638183/web/api/audioplayer.css';
    .pa { --offsetX: 81px; --bg: url('https://638183.freep.cn/638183/t24/7/dbxj.jpg') no-repeat center/cover; color: lightgreen; }
    .player { width: 480px; bottom: 10px; }
    .btnFs { top: 25px; right: 20px; }
    .mpic { width: 50px; offset-anchor: 100% 50%; animation: offset-distance 3s linear infinite alternate var(--state), rot 3s linear infinite var(--state); }
</style>

<div id="pa" class="pa"></div>

<script>
    var options = {
        pa: '.pa',
        urls: [['https://music.163.com/song/media/outer/url?id=1371760676', '短兵相接']],
    };

    loadJs('https://638183.freep.cn/638183/web/api/audioplayer.min.js', tzRun);

    function tzRun() {
        var aud = new AudPlayer(options);

        const frg = new DocumentFragment(), num = 20;
        for (let i = 0; i <= num; i ++) {
            const img = document.createElement('img');
            img.src = 'https://638183.freep.cn/638183/web/svg/clover4.svg';
            img.alt = '';
            img.className = 'mpic';
            img.style.filter = `hue-rotate(${Math.random() * 360}deg)`;
            img.style.offsetPath = `ray(${180 / num * i - 90}deg sides at 50% 95%)`;
            img.style.animationDuration = `${Math.random() * 8 + 8}s`;
            img.style.animationDelay = `${-10 * Math.random()}s`;
            frg.appendChild(img);
        }
        pa.appendChild(frg);
    }

    function loadJs(url, callback) {
        var script = document.createElement('script');
        script.charset = 'utf-8';
        script.src = url;
        script.onload = function() {
            if (callback) callback();
        };
        document.head.appendChild(script);
    }
</script>

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

协同嘉业科技有限公司 ( 京ICP备2024053108号-1 )

GMT+8, 2026-8-2 05:06 , Processed in 0.084266 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表