可以编辑粒子特效的编辑器,可导出json
代码语言:html
所属分类:粒子
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> particleEditor.json</title> <style> html, body { margin: 0; background: #131417; color: #FFF; font-family: 'Inconsolata', monospace; height: 100%; } body { box-sizing: border-box; padding: 1em; font-size: 18px; display: flex; } @media (max-width: 650px) { body { font-size: 16px; } } @media (max-width: 500px) { body { font-size: 14px; } } .container { margin: auto; width: 30em; } .container * { box-sizing: border-box; } .container .title { margin-bottom: 0.5em; opacity: 0; -webkit-animation: inDown 0.25s forwards; animation: inDown 0.25s forwards; -webkit-animation-delay: 0.5s; animation-delay: 0.5s; } .container .scene { padding-top: 50%; position: relative; -webkit-animation: inUp 0.25s; animation: inUp 0.25s; } .container .scene .info { position: absolute; z-index: 100; top: 0.5em; left: 0.5em; opacity: 0; pointer-events: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .container .scene:hover .info { opacity: 1; } .container .scene canvas { background: #333; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 3px; image-rendering: optimizeSpeed; /* Legal fallback */ image-rendering: -moz-crisp-edges; /* Firefox */ image-rendering: -o-crisp-edges; /* Opera */ image-rendering: -webkit-optimize-contrast; /* Safari */ image-rendering: optimize-contrast; /* CSS3 Proposed */ image-rendering: crisp-edges; /* CSS4 Proposed */ image-rendering: pixelated; /* CSS4 Proposed */ -ms-interpolation-mode: nearest-neighbor; /* IE8+ */ } .container .scene .scale { position: absolute; bottom: 0; right: 0; display: flex; } .container .scene .scale .btn, .container .scene .scale .label { min-width: 1.5em; height: 1.5em; line-height: 1.5em; text-align: center; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .container .scene .scale .btn { cursor: pointer; } .container .scene .scale .btn:hover { background: rgba(255, 255, 255, 0.1); } .container .settings { margin-top: 1em; margin-bottom: 1em; padding: 1em; background: #333; border-radius: 3px; height: 15em; opacity: 0; -webkit-animation: inDown 0.25s forwards; animation: inDown 0.25s forwards; -webkit-animation-delay: 0.25s; animation-delay: 0.25s; } .container .settings textarea { font-family: 'Inconsolata', monospace; width: 100%; height: 100%; font-size: 0.9em; padding: 0; resize: none; color: #FFF; border: none; background: none; outline: none; color: #4d7; letter-spacing: 0.05em; line-height: 1.5em; } @-webkit-keyframes inUp { from { -webkit-transform: translateY(-100%); transform: translateY(-100%); opacity: 0; } to { -webkit-transform: translateY(0%); transform: translateY(0%); opacity: 1; } } @keyframes inUp { from { -webkit-transform: translateY(-100%); transform: translateY(-100%); opacity: 0; } to { -webkit-transform: translateY(0%); transform: translateY(0%); opacity: 1; } } @-webkit-keyframes inDown { from { -webkit-transform: translateY(100%); transform: translateY(100%); opacity: 0; } to { -webkit-transform: translateY(0%); transform: translateY(0%); opacity: 1; } } @keyframes inDown { from { -webkit-transform: translateY(100%); transform: translateY(100%); opacity: 0; } to { -webkit-transform: translateY(0%); transform: translateY(0%); opacity: 1; } } </style> </head> <body translate="no"> <div class="container"> <div class="scene"> <canvas></canvas> <div class="info">move mouse/click to burst</div> <div class="scale"> <div class="btn scale-down">-</div> <div class="label">1</div> <div class="btn scale-up">+</div> </div> </div> <div class="settings"> <textarea></textarea> </div> </div> <script> // console.clear() var canvas = document.querySelector('canvas') var particleSystem = new ParticleSystem(canvas) var settings = JSON.parse(`{ "width": 90, "height": 0, "co.........完整代码请登录后点击上方下载按钮下载查看
网友评论0