shader-doodles实现音频波纹视觉效果
代码语言:html
所属分类:动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> audio visualizer (shader-doodle)</title> <style> body { display: flex; height: 100vh; align-items: center; justify-content: center; background: #000; margin: 0; padding: 0; font-size: 20px; color: #fff; font-family: sans-serif; } shader-doodle { display: block; width: 100vw; height: 0; padding-bottom: 56.25%; } .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: #fff; } </style> </head> <body translate="no"> <shader-doodle> <sd-audio src="http://repo.bfw.wiki/bfwrepo/sound/5c89fd22dea6948307.mp3" autoplay loop crossorigin="anonymous"></sd-audio> <script type="x-shader/x-fragment"> uniform sampler2D u_audio0; float amplitude(sampler2D.........完整代码请登录后点击上方下载按钮下载查看
网友评论0