变换色彩的旋转图形----背景效果
来源:互联网 发布:网络监控app都有哪些 编辑:程序博客网 时间:2024/05/01 21:40
html代码:
<canvas id = 'canv'></canvas>
css代码:
body{ width:100%; overflow:hidden; margin:0;}
js代码:
var c = document.getElementById('canv'), $ = c.getContext('2d'), w = c.width = window.innerWidth, h = c.height = window.innerHeight, t = 0, num = 550, u = 0, s, a, b, x, y, _x, _y, _t = 1 / 60;var anim = function() { $.globalCompositeOperation = 'source-over'; window.requestAnimationFrame(anim); $.fillStyle = 'hsla(0, 0%, 0%, .35)'; $.fillRect(0, 0, w, h); $.globalCompositeOperation = 'lighter'; for (var i = 0; i < 1; i++) { x = 0; $.beginPath(); for (var j = 0; j < num; j++) { x += .45 * Math.sin(11); y = x * Math.sin(i + 3.0 * t + x / 15) / 15; _x = x * Math.cos(b) + y * Math.sin(i); _y = x * Math.sin(b) + y * Math.cos(i); b = (j * 2.66) * Math.PI / 4; $.lineWidth = 0.040; $.arc(w / 2 + _x, h / 2 + _y, 0.0, 0, 2 * Math.PI); } var g = $.createLinearGradient(w / 2 + _x, h / 2 + _y, 1, w / 2 + _x, h / 2 + _y); g.addColorStop(0.1, 'hsla(' + (u + i) + ',95%,50%,1)'); g.addColorStop(0.5, 'hsla(0,0%,10%,1)'); g.addColorStop(1, 'hsla(0,0%,0%,1)'); $.strokeStyle = g; $.stroke(); } t += _t; u -= .2;};anim();window.addEventListener('resize', function() { c.width = w = window.innerWidth; c.height = h = window.innerHeight;}, false);
0 0
- 变换色彩的旋转图形----背景效果
- TD单元格背景颜色的变换效果
- 怎样画旋转效果的图形
- html5绘制变换图形-旋转图形
- VML之带背景的3D图形任意旋转
- CSS3D变换/立方体旋转效果
- CSS3D变换/立方体旋转效果
- WPF-画刷、绘图、几何绘图、图形的效果与滤镜、图形变换和动画
- 图像的旋转变换
- Canvas的图形变换
- 图形的几何变换
- 图形的变换
- PS 图形的变换
- WPF/Silverlight中图形的平移,缩放,旋转,倾斜变换演示
- 旋转的星空背景
- D3.JS实例,旋转的色彩方块
- opencv 3.0 仿射变换 图形旋转 getRotationMatrix2D warpAffine
- 第四节 WebGL中的图形变换:旋转、平移和缩放
- java socket编程入门讲解
- 【React Native】iOS离线打包
- HTML第七章上机题3---------北大青鸟视频宣传
- 2.for循环的3种写法
- 循环结构(for循环和while循环的区别)
- 变换色彩的旋转图形----背景效果
- CentOS 6.7 安装KVM
- 1.2.1 工作流管理系统参考模型
- unity 相机选择物体沿射线相机平移到物体周围
- log4j2如何根据配置的配置文件选取配置文件处理类的(ConfigurationFactory源码分析)
- struts 的基本用法
- linux使用yum安装MySQL5.6及Unknown/unsupported storage engine: InnoDB处理
- Job作业提交源码分析
- 深度学习中的数学与技巧(2):《Batch Normalization Accelerating Deep Network Training by Reducing Interna