Skip to content

HollowMan6/canvas-ball.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

canvas-ball.js

last-commit Node.js Package

Followers watchers stars forks

Open Source Love GPL Licence Repo-Size

Total alerts Language grade: JavaScript

(English version is down below.)

sample

: V1.0.5: 增加对IE 11的支持。

: V1.0.3: 除去小球跟随鼠标移动功能,请移步 https://github.com/HollowMan6/Staggered-Mouse-Balls 查看更炫酷的解决方案。

: V1.0.2: 修复了小球初始移动方向只为右下角,导致短时间内左上角出现空白,右下角过密的情况。

彩球运动背景插件。

此项目改编自我的项目 https://github.com/HollowMan6/canvas-nest.js

示例网页 预览效果:http://practice.hollowman.ml/🔴%20canvas-ball.js/sample.html

观看在我的主页上的应用效果:https://hollowman6.github.io/

使用

将下面的代码插入到 <body> 和 </body> 之间.

<script type="text/javascript" src="canvas-ball.js"></script>

强烈建议在 </body>标签上方. 例如下面的代码结构:

<html>
<head>
	...
</head>
<body>
	...
	...
	<script type="text/javascript" src="canvas-ball.js"></script>
</body>
</html>

然后就完成了,打开网页即可看到效果!请注意不要将代码置于 <head> </head>里面.

canvas-ball.js

NEW: V1.0.5: Add support for IE 11.

NEW: V1.0.3: Remove ball follows with the mouse, please go to https://github.com/HollowMan6/Staggered-Mouse-Balls and check a cool solution.

NEW: V1.0.2: Fix the BUG relating to balls' initial moving direction only to down-right, leading to temporarily blank in top-left corner and too dense in down-right corner.

A colourful ball background drawn on canvas.

This project is derived from my project https://github.com/HollowMan6/canvas-nest.js

Sample Page real-time watching: http://practice.hollowman.ml/🔴%20canvas-ball.js/sample.html

Watch the effect on my Home Page: https://hollowman6.github.io/

Usage

Insert the code below between <body> and </body>.

<script src="canvas-ball.js"></script>

Strongly suggest to insert before the tag </body>, as the following:

<html>
<head>
	...
</head>
<body>
	...
	...
	<script src="canvas-ball.js"></script>
</body>
</html>

Then ok! Please do not add the code in the <head> </head>.

About

A colourful ball background drawn on canvas.(彩球运动背景插件)

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors