Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

是否需要光敏性癫痫警告? #22

Open
nkh0472 opened this issue May 7, 2021 · 1 comment
Open

是否需要光敏性癫痫警告? #22

nkh0472 opened this issue May 7, 2021 · 1 comment

Comments

@nkh0472
Copy link
Contributor

nkh0472 commented May 7, 2021

这个项目目前在快速切换场景时,偶尔会有快速闪过的高亮度白屏。
本现象通过快速滑动鼠标或触摸可稳定复现,现象在本项目各版本、及原作者网站均有发生,原因不明。或许是切换background-color的函数有bug。
不知是否需要加上光敏性癫痫警告。


背景颜色相关的函数内容(已反混淆):

this.play = function() {
	!function() {
		/** @type {number} */
		_turnType = turnType;
		var iLetter = test();
		c = letters[iLetter];
		$("#about").css("background-color", "#" + c.toString(16));
		if (Math.random() < .3) {
			w.flash(index);
		}
		auth0_time = iLetter;
		g.clear();
		/** @type {boolean} */
		g.visible = true;
		/** @type {number} */
		index = container.children.length - 1 - Math.floor(2 * Math.random());
		container.setChildIndex(g, index);
		/** @type {boolean} */
		var v = Math.random() < .5;
		/** @type {number} */
		var b = Math.floor(4 * Math.random()) + 1;
		data.pos = {};
		/** @type {number} */
		var y = 0;
		if (v) {
			/** @type {number} */
			y = height / b;
			data.pos.b0 = {
				x : 0,
				y : 0
			};
			data.pos.b1 = {
				x : 0,
				y : height
			};
		} else {
			/** @type {number} */
			y = width / b;
			data.pos.b0 = {
				x : 0,
				y : 0
			};
			data.pos.b1 = {
				x : width,
				y : 0
			};
		}
		if (Math.random() < .5) {
			/** @type {number} */
			g.rotation = 0;
			/** @type {number} */
			g.x = 0;
			/** @type {number} */
			g.y = 0;
		} else {
			/** @type {number} */
			g.rotation = Math.PI;
			g.x = width;
			g.y = height;
		}
		/** @type {number} */
		var a = expected_dates = 0;
		for (; a <= b; a++) {
			var layout = {
				x : 0,
				y : 0
			};
			/** @type {number} */
			var yOffset = 0;
			if (0 != a && a != b) {
				/** @type {number} */
				yOffset = y / 4 * Math.random() - y / 8;
			}
			if (v) {
				/** @type {number} */
				layout.y = y * a + yOffset;
			} else {
				/** @type {number} */
				layout.x = y * a + yOffset;
			}
			data.pos["p" + a] = layout;
			var properties;
			/** @type {number} */
			var chargeTime = .4 * Math.random() + .3;
			/** @type {number} */
			expected_dates = 2;
			/** @type {({x: ?}|{y: ?})} */
			properties = v ? {
				x : width
			} : {
				y : height
			};
			gsap.to(data.pos["p" + a], chargeTime, properties);
		}
		/** @type {number} */
		data.progress = 0;
		gsap.to(data, expected_dates, {
			progress : 1,
			ease : Power0.easeNone,
			onUpdate : init,
			onComplete : callback
		});
	}();
};
@y377
Copy link

y377 commented May 22, 2021

好东西要传递下去,感谢你为优秀作品的努力。
我也来搭建一个...
另外,这个可有?这个慢嗨性的我个人很喜欢

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants