Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
css
body { margin: 0; overflow: hidden; background-color: #1a1a1a; } .center { position: absolute; margin: auto; top: 0; bottom: 0; left: 0; right: 0; } canvas { position: absolute; } .gooeys { width: 100%; height: 100%; -webkit-filter: url('#filter'); filter: url('#filter'); } .bg { width: 390px; height: 390px; background-color: white; border-radius: 50%; -webkit-transition: all 0.5s; transition: all 0.5s; } .pot { box-sizing: border-box; width: 250px; height: 120px; top: 100px; background: -webkit-radial-gradient(#121, #111 45%); background: radial-gradient(#121, #111 45%); border-radius: 25px 25px 80px 80px; } .pot-top { box-sizing: border-box; width: 250px; height: 40px; background-color: #111; top: -50px; border-radius: 20px 20px 80px 80px; box-shadow: #4f4 0 10px 45px -17px inset; } .highlight{ content: ""; top: 20px; bottom: auto; background-color: rgba(68,255,68,0.3); width: 150px; height: 0; border-radius: 0 0 50% 50%; box-shadow: #4f4 0 0 35px 2px; } .glow { top: -100px; width: 0px; height: 0px; border-radius: 50%; color: rgba(68,255,68,0.4); box-shadow: 0 0 150px 50px; -webkit-animation: glow 0.5s linear infinite alternate; animation: glow 0.5s linear infinite alternate; } .shadow { top: 210px; width: 220px; height: 20px; background-color: #111; border-radius: 50%; } @-webkit-keyframes glow { to{ box-shadow: 0 0 120px 50px; } } @keyframes glow { to{ box-shadow: 0 0 120px 50px; } }
JavaScript
canvas = document.getElementById("canvas"); var context = canvas.getContext('2d'); W = canvas.width = window.innerWidth; H = canvas.height = window.innerHeight; generatorStock = []; generatorStock.push(new particleGenerator( 2, 3, 30, 30)); function randomInt(min, max) { return Math.floor(min + Math.random() * (max - min + 1)); } function clamp(value, min, max) { return Math.min(Math.max(value, Math.min(min, max)), Math.max(min, max)); } function particle(vx, vy, size) { this.radius = randomInt(0, size); this.x = W/2; this.y = H/2; this.alpha = 1; this.vx = randomInt(-vx, vx); if(Math.random() < 0.1){ this.vy = randomInt(-vy, -vy-3); } else{ this.vy = randomInt(0, -vy); } this.lifetime = 100; } particle.prototype.update = function() { this.lifetime -= 2; this.x += this.vx; this.y += this.vy; if (this.lifetime < 20){ this.radius -= 2; } context.beginPath(); context.arc(this.x, this.y, this.radius, Math.PI * 2, false); context.fillStyle = "rgba(255,255,255,0.5)"; context.strokeStyle = "#2f2"; context.lineWidth = 10; context.fill(); context.stroke(); context.closePath(); } function particleGenerator(vx, vy, size, maxParticles) { this.size = size; this.vx = vx; this.vy = vy; this.maxParticles = maxParticles; this.particles = []; } var freq = 0.5; particleGenerator.prototype.animate = function() { if (this.particles.length < this.maxParticles && Math.random() < freq) { this.particles.push(new particle(this.vx, this.vy, this.size)); if(this.particles.length == this.maxParticles/2){ freq = 0.1; } } for (var i = 0; i < this.particles.length; i++) { p = this.particles[i]; p.update(); if (p.radius < 10) { this.particles[i] = new particle(this.vx, this.vy, this.size); } } } function update() { context.clearRect(0, 0, W, H); for (var i = 0; i < generatorStock.length; i++) { generatorStock[i].animate(); } requestAnimationFrame(update); } update(); window.addEventListener('resize', function(e) { W = window.innerWidth; H = window.innerHeight; }, false);
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>火焰效果-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号