Chưởng Môn Khiêm Tốn Chút
Xuyên không tới Thiên Huyền Giới, thân phận là chưởng môn dởm của Mạc môn, Đô Thành Khắc Kim tái sinh ở trong thế giới trò chơi, không để người chơi vào mắt, thu nhận nhân vật chính của thế giới này làm tiểu đệ, giả dạng làm thiên hạ đệ nhất!
#snowflakeContainer {
position: absolute;
left: 0px;
top: 0px;
}
.snowflake {
padding-left: 15px;
font-size: 14px;
line-height: 24px;
position: fixed;
color: #ebebeb;
user-select: none;
z-index: 1000;
-moz-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
}
.snowflake img {
width: 20px;
}
.snowf000 {
padding-left: 15px;
font-size: 14px;
line-height: 24px;
position: fixed;
color: #ebebeb;
user-select: none;
z-index: 1000;
-moz-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
}
.snowf000 img {
width: 20px;
}
.snowfmaple {
padding-left: 15px;
font-size: 14px;
line-height: 24px;
position: fixed;
color: #ebebeb;
user-select: none;
z-index: 1000;
-moz-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
}
.snowfmaple img {
width: 20px;
}
.snowflake:hover {
cursor: default;
}
.snowf000:hover {
cursor: default;
}
.snowfmaple:hover {
cursor: default;
}
var requestAnimati || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
var transforms = ["transform", "msTransform", "webkitTransform", "mozTransform", "oTransform"];
var transformProperty = getSupportedPropertyName(transforms);
var snowflakes = [];
var snowf000 = [];
var snowfmaple = []; // Thêm mảng snowfmaple
var browserWidth;
var browserHeight;
var numberOfSnowflakes = 3;
var resetPosition = false;
function setup() {
window.addEventListener("DOMContentLoaded", generateSnowflakes, false);
window.addEventListener("resize", setResetFlag, false);
}
setup();
function getSupportedPropertyName(b) {
for (var a = 0; a < b.length; a++) {
if (typeof document.body.style[b[a]] != "undefined") {
return b[a];
}
}
return null;
}
function Snowflake(element, radius, speed, xPos, yPos) {
this.element = element;
this.radius = radius;
this.speed = speed;
this.xPos = xPos;
this.yPos = yPos;
this.counter = 0;
this.sign = Math.random() < 0.5 ? 1 : -1;
this.element.style.opacity = 0.5 + Math.random();
this.element.style.f + Math.random() * 20 + "px";
}
Snowflake.prototype.update = function () {
this.counter += this.speed / 5000;
this.xPos += this.sign * this.speed * Math.cos(this.counter) / 40;
this.yPos += Math.sin(this.counter) / 40 + this.speed / 30;
setTranslate3DTransform(this.element, Math.round(this.xPos), Math.round(this.yPos));
if (this.yPos > browserHeight) {
this.yPos = -50;
}
};
function Snowf000(element, radius, speed, xPos, yPos) {
this.element = element;
this.radius = radius;
this.speed = speed;
this.xPos = xPos;
this.yPos = yPos;
this.counter = 0;
this.sign = Math.random() < 0.5 ? 1 : -1;
this.element.style.opacity = 0.5 + Math.random();
this.element.style.f + Math.random() * 20 + "px";
}
Snowf000.prototype.update = function () {
this.counter += this.speed / 5000;
this.xPos += this.sign * this.speed * Math.cos(this.counter) / 40;
this.yPos += Math.sin(this.counter) / 40 + this.speed / 30;
setTranslate3DTransform(this.element, Math.round(this.xPos), Math.round(this.yPos));
if (this.yPos > browserHeight) {
this.yPos = -50;
}
};
// Hàm tạo ra các bông tuyết maple mới
function Snowfmaple(element, radius, speed, xPos, yPos) {
this.element = element;
this.radius = radius;
this.speed = speed;
this.xPos = xPos;
this.yPos = yPos;
this.counter = 0;
this.sign = Math.random() < 0.5 ? 1 : 1;
this.element.style.opacity = 0.5 + Math.random();
this.element.style.f + Math.random() * 20 + "px";
}
Snowfmaple.prototype.update = function () {
this.counter += this.speed / 5000;
this.xPos += this.sign * this.speed * Math.cos(this.counter) / 40;
this.yPos += Math.sin(this.counter) / 40 + this.speed / 30;
setTranslate3DTransform(this.element, Math.round(this.xPos), Math.round(this.yPos));
if (this.yPos > browserHeight) {
this.yPos = -50;
}
};
function setTranslate3DTransform(a, c, b) {
var d = "translate3d(" + c + "px, " + b + "px, 0)";
a.style[transformProperty] = d;
}
function generateSnowflakes() {
var b = document.querySelector(".snowflake");
var h = b.parentNode;
browserWidth = document.documentElement.clientWidth;
browserHeight = document.documentElement.clientHeight;
// Tạo các đối tượng Snowflake
for (var d = 0; d < numberOfSnowflakes; d++) {
var j = b.cloneNode(true);
h.appendChild(j);
var e = getPosition(50, browserWidth);
var a = getPosition(50, browserHeight);
var c = 5 + Math.random() * 40;
var g = 4 + Math.random() * 10;
var f = new Snowflake(j, g, c, e, a);
snowflakes.push(f);
}
h.removeChild(b);
// Tạo các đối tượng Snowf000
var b_f000 = document.querySelector(".snowf000");
var h_f000 = b_f000.parentNode;
for (var d_f000 = 0; d_f000 < numberOfSnowflakes; d_f000++) {
var j_f000 = b_f000.cloneNode(true);
h_f000.appendChild(j_f000);
var e_f000 = getPosition(50, browserWidth);
var a_f000 = getPosition(50, browserHeight);
var c_f000 = 5 + Math.random() * 40;
var g_f000 = 4 + Math.random() * 10;
var f_f000 = new Snowf000(j_f000, g_f000, c_f000, e_f000, a_f000);
snowf000.push(f_f000);
}
h_f000.removeChild(b_f000);
// Tạo các đối tượng Snowfmaple
var b_maple = document.querySelector(".snowfmaple");
var h_maple = b_maple.parentNode;
for (var d_maple = 0; d_maple < numberOfSnowflakes; d_maple++) {
var j_maple = b_maple.cloneNode(true);
h_maple.appendChild(j_maple);
var e_maple = getPosition(50, browserWidth);
var a_maple = getPosition(50, browserHeight);
var c_maple = 5 + Math.random() * 40;
var g_maple = 4 + Math.random() * 10;
var f_maple = new Snowfmaple(j_maple, g_maple, c_maple, e_maple, a_maple);
snowfmaple.push(f_maple);
}
h_maple.removeChild(b_maple);
moveSnowflakes();
}
function moveSnowflakes() {
for (var b = 0; b < snowflakes.length; b++) {
var a = snowflakes[b];
a.update();
}
for (var b_f000 = 0; b_f000 < snowf000.length; b_f000++) {
var a_f000 = snowf000[b_f000];
a_f000.update();
}
for (var b_maple = 0; b_maple < snowfmaple.length; b_maple++) {
var a_maple = snowfmaple[b_maple];
a_maple.update();
}
if (resetPosition) {
browserWidth = document.documentElement.clientWidth;
browserHeight = document.documentElement.clientHeight;
for (var b = 0; b < snowflakes.length; b++) {
var a = snowflakes[b];
a.xPos = getPosition(50, browserWidth);
a.yPos = getPosition(50, browserHeight);
}
for (var b_f000 = 0; b_f000 < snowf000.length; b_f000++) {
var a_f000 = snowf000[b_f000];
a_f000.xPos = getPosition(50, browserWidth);
a_f000.yPos = getPosition(50, browserHeight);
}
for (var b_maple = 0; b_maple < snowfmaple.length; b_maple++) {
var a_maple = snowfmaple[b_maple];
a_maple.xPos = getPosition(50, browserWidth);
a_maple.yPos = getPosition(50, browserHeight);
}
resetPosition = false;
}
requestAnimationFrame(moveSnowflakes);
}
function getPosition(b, a) {
return Math.round(-1 * b + Math.random() * (a + 2 * b));
}
function setResetFlag(a) {
resetPosition = true;
}
110 lượt thích (Hãy bình chọn cho truyện bạn nhé)
Tình trạng
Đang tiến hành