根据音乐舞动振动效果

代码语言:html

所属分类:动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <style>
        body {
            background: #fff;
            font-size: 24px;
            color: #2c6dff;
            font-family: 'Dosis', sans-serif;
            text-transform: uppercase;
        }
        shader-doodle {
            position: fixed;
            top: 0;
            left: 0;
            height: 100vh;
            width: 100vw;
        }
        .credit {
            z-index: 1;
            position: fixed;
            top: 8px;
            left: 8px;
        }
        .sd {
            z-index: 1;
            position: fixed;
            right: 8px;
            bottom: 8px;
        }
        .help {
            z-index: 1;
            position: fixed;
            left: 8px;
            bottom: 8px;
        }
        a:hover,
        a:link,
        a:visited,
        a:active {
            color: inherit;
        }
    </style>

</head>
<body translate="no">
    <shader-doodle>
        <sd-audio src="http://repo.bfw.wiki/bfwrepo/sound/5e148aa3821f2.mp3" autoplay loop crossorigin="anonymous"></sd-audio>
        <script type="x-shader/x-fragment">
            uniform sampler2D u_audio0;

            float amplitude(sampler2D audio, float f) {
                return texture2D(audio, vec2(f, .25)).x;
            }

            float wave(sampler2D audio, float t) {
                return texture2D(audio, vec2(t, .75)).x;
            }

            void main() {
                vec2 uv = g.........完整代码请登录后点击上方下载按钮下载查看

网友评论0