Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Click on the Canvas for new Colors :)
css
html, body{ overflow: hidden; background: #000; padding: 0px; margin: 0px; } #canvas{ cursor: crosshair; z-index: 2; position: absolute; top: 0; left: 0; } #overlay{ background: radial-gradient(ellipse at center, rgba(0,0,0,.0) 10%, rgba(0,0,0,.8) 80%, rgba(0,0,0,1) 90%, rgba(0,0,0,1) 100%); z-index: 3; position: absolute; top:0;left:0; height: 100%; width: 100%; } #bg_glow{ z-index: 1; position: absolute; top:0;left:0; height: 100%; width: 100%; } #info{ z-index: 4; position: absolute; color: #fff; top: 0px; left: 0px; background: rgba(60,60,60,.6); padding: 5px; } #overlay:hover{ cursor: pointer; } #fps{ position: absolute; top: 0px; right: 0px; z-index: 5; }
JavaScript
var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var bgg = document.getElementById("bg_glow"); w = ctx.canvas.width = window.innerWidth; h = ctx.canvas.height = window.innerHeight; window.onresize = function() { w = ctx.canvas.width = window.innerWidth; h = ctx.canvas.height = window.innerHeight; maxHeight = h*.9 minHeight = h*.5; dots = []; pushDots(); ctx.globalCompositeOperation = "lighter"; }; document.getElementById("overlay").onclick = function(){ hue = Math.random()*360; bgg.style.background = "radial-gradient(ellipse at center, hsla("+hue+",50%,50%,.8) 0%,rgba(0,0,0,0) 100%)"; dots = []; pushDots(); } dots=[{}]; mx = 0; my = 0; md = 100; maxWidth = 15; minWidth = 2; maxHeight = h*.9 minHeight = h*.5; maxSpeed = 35; minSpeed = 6; hue = 230; hueDif = 50; // Hue +/- glow = 10; // Turn this off for better performance ctx.globalCompositeOperation = "lighter"; function pushDots(num){ for(i=1; i
w+maxWidth){ dots.splice(i,1); dots.push({ x:0, y:Math.random()*h, h:Math.random()*(maxHeight-minHeight)+minHeight, w:Math.random()*(maxWidth-minWidth)+minWidth, c:Math.random()*(280-200)+200, m:Math.random()*(maxSpeed-minSpeed)+minSpeed }); } }window.requestAnimationFrame(render); } bgg.style.background = "radial-gradient(ellipse at center, hsla("+hue+",50%,50%,.8) 0%,rgba(0,0,0,0) 100%)"; render();
粒子
时间
文字
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号