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

东方神韵精选(二)转自马黑黑博客有代码

[复制链接]

1415

主题

3035

回帖

1万

积分

管理员

积分
12174
发表于 昨天 22:39 | 显示全部楼层 |阅读模式
转自马黑黑博客:https://mahei.ccccocccc.cc/art/?st=0&id=1780997288
播放/暂停(Alt+X)

1415

主题

3035

回帖

1万

积分

管理员

积分
12174
 楼主| 发表于 昨天 22:40 | 显示全部楼层

<style>
    @import 'https://638183.freep.cn/638183/web/api/audioplayer.css';
    .pa { --offsetX: 81px; --bg: url('https://638183.freep.cn/638183/t24/w8/dsfh.jpg') no-repeat center/cover; color: snow; }
    .player { width: 480px; bottom: 10px; }
    .btnFs { top: 25px; right: 20px; }
    #msvg { position: absolute; width: 12vw; heighht: 12vw; top: 20%; right: 16%; opacity: 1; cursor: pointer; }
    #msvg path { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 2s var(--delay) forwards, fill 0.75s calc(var(--delay) + 2s) forwards; }
    @keyframes draw { to { stroke-dashoffset: 0; } }
    @keyframes fill { to {fill: url(#grd); } }
</style>


<div id="pa" class="pa">
    <video class="pd-vid" src="https://img2.tukuppt.com/video_show/2269348/00/14/92/5e67af3447155.mp4" autoplay loop muted></video>
    <svg id="msvg" xmlns="http://www.w3.org/2000/svg" viewBox="-200 -200 400 400">
        <title>播放/暂停(Alt+X)</title>
        <defs>
            <linearGradient id="grd" x1="0" x2="0" y1="0" y2="1">
                <stop offset="0%" stop-color="white"></stop>
                <stop offset="50%" stop-color="magenta"></stop>
                <stop offset="100" stop-color="red"></stop>
            </linearGradient>
        </defs>
        <g id="g1"></g>
    </svg>
</div>


<script>
    var options = {
        pa: '.pa',
        urls: [
            ['https://music.163.com/song/media/outer/url?id=5275056', '心神合一-洞箫/中音笙'],
            ['https://music.163.com/song/media/outer/url?id=5275057', '海上碧波-竹笛/古筝'],
            ['https://music.163.com/song/media/outer/url?id=5275058', '片片枫叶红-埙/扬琴'],
            ['https://music.163.com/song/media/outer/url?id=5275059', '思绪-中音笙/二胡'],
            ['https://music.163.com/song/media/outer/url?id=5275060', '眷恋-二胡/洞箫'],
            ['https://music.163.com/song/media/outer/url?id=5275061', '月落乌啼-曲笛/扬琴'],
            ['https://music.163.com/song/media/outer/url?id=5275062', '月光-二胡/中音笙'],
            ['https://music.163.com/song/media/outer/url?id=5275063', '梦幻-琵琶/女声/二胡'],
            ['https://music.163.com/song/media/outer/url?id=5275064', '相思对花眠-二胡/中音笙'],
            ['https://music.163.com/song/media/outer/url?id=5275065', '感悟-女声/二胡/扬琴']
        ],
        btns: [msvg]
    };


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


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


        var dr = _dr(msvg);
        dr.path('M0 0 L-40 -190Q0 -100,40 -190 L0 0', 'transparent', 'snow', 3).addTo(g1).rotates(9);
        setProperties();


        function setProperties() {
            const paths = msvg.querySelectorAll('path');
            paths.forEach((path, idx) => {
                path.style.cssText += `
                    --len: ${path.getTotalLength()};
                    --delay: ${idx * 2.75}s;
                `;
            });
            paths[paths.length - 1].onanimationend = () => {
                setTimeout(() => { g1.classList.add('rotate'); }, 750);
            };
        }
    }


    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-6-11 02:20 , Processed in 0.084735 second(s), 25 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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