svg+js实现随机破碎效果代码
代码语言:html
所属分类:其他
代码描述:svg+js实现随机破碎效果代码,点击可更换破碎效果。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { width: 100vw; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #000; margin: 0; padding: 0; color: #999; font-family: sans-serif; } #controls { padding: 20px; } .row { margin-bottom: 10px; text-align: center; } .container { display: flex; flex-direction: column; filter: url(#goo); } </style> </head> <body> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="600" height="600" viewBox="0 0 600 600"> <defs> <linearGradient id="grad" x1="0%" y1="100%" x2="10%" y2="0%"> <stop offset="0%" style="stop-color:rgb(255,255,255);stop-opacity:0.2" /> <stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:0.1" /> </linearGradient> </defs> <rect x="0" y="0" width="600" height="600" fill="rgb(252,68,63)" /> <!-- filter="url(#goo)" --> <g id="content"> </g> </svg> <div id="controls"> <div class="row"> <button id="exportpng">Export PNG</button> <button id="exportsvg">Export SVG</button> </div> <div class="row"> <input type="checkbox" checked name=&q.........完整代码请登录后点击上方下载按钮下载查看
网友评论0