用户讨论:Kaltes Eis/Kaltes Eis的代码字典:修订间差异

来自Limbo Wiki Mirror
无编辑摘要
第13行: 第13行:


来帮忙(死)这玩意到底怎么用{{用户:Kaltes Eis/Eine Unterschrift}} 2022年4月6日 (三) 03:31 (UTC)
来帮忙(死)这玩意到底怎么用{{用户:Kaltes Eis/Eine Unterschrift}} 2022年4月6日 (三) 03:31 (UTC)
body,html{undefined
overflow: hidden;
}
var snowflakes = {undefined
arr:[],
snowflake : [
'❉',
'❈',
'*',
'✲',
'❀',
'❃'
],
snowflakeColor : [
"red",
"green",
"#ccc123",
"#345232",
"#231111",
"#ab2322"
],
random : function (num){undefined
return Math.floor(Math.random()*num);
},
init : function (num){undefined
this.maxlength = num;
this.maxWidth = (document.documentElement.clientWidth || document.body.clientWidth) + 20;
this.maxHeight = (document.documentElement.clientHeight || document.body.clientHeight) + 20;
this.create();
this.move();
},
create : function (){undefined
var that = this;
setInterval(function (){undefined
if( that.arr.length < that.maxlength){undefined
var d = document.createElement("div");
d.innerHTML = that.snowflake[that.random(that.snowflake.length)];
d.style.color = that.snowflakeColor[that.random(that.snowflakeColor.length)];
d.style.position = "absolute";
top(0- -99) left (0 - that.maxWidth*2/3-1)
d.style.left = that.random(that.maxWidth*2/3) + "px";
d.style.top = -that.random(100) + "px";
d.vx = 2+that.random(10);
d.vy = 3+that.random(10);
document.body.appendChild(d);
that.arr.push(d)
}
},20)
},
move : function (){undefined
var that = this;
var arr = that.arr;
setInterval(function (){undefined
for(var i = 0 ; i < arr.length ; i ++ ){undefined
arr[i].style.left = arr[i].offsetLeft + arr[i].vx + "px";
arr[i].style.top = arr[i].offsetTop + arr[i].vy + 'px';
if (arr[i].offsetTop >= that.maxHeight || arr[i].offsetLeft >= that.maxWidth) {undefined
document.body.removeChild(arr[i]);
arr.splice(i,1);
}
}
},30)
}
}
window.onload = function (){undefined
snowflakes.init(100);
}

2022年4月6日 (三) 12:01的版本

Hello world。。。又见信息魔怔人哎--Dorothy讨论) 2022年1月29日 (六) 11:07 (CST)

事信息课代表--【林泊数独兴趣协会会员】 Kaltes Eis 小冰 =讨论= | =贡献= 2022年1月29日 (六) 15:06 (CST)

信息学内卷日渐严重--Dorothy讨论) 2022年1月29日 (六) 16:49 (CST)

我觉得那个密码盘的bug修不好
但是可以当成一个特性来使用……
就是说你一次不能同时解两个密码盘,因为其中一个会消失--Goldenaxe留言) 2022年3月12日 (六) 13:35 (CST)

比如用在重要的选项上(?φBY:KALTES EIS【讨论】【贡献】 2022年3月12日 (六) 17:34 (CST)

代码试验区

来帮忙(死)这玩意到底怎么用φBY:KALTES EIS【讨论】【贡献】 2022年4月6日 (三) 03:31 (UTC)

body,html{undefined overflow: hidden; } var snowflakes = {undefined arr:[], snowflake : [ '❉', '❈', '*', '✲', '❀', '❃' ], snowflakeColor : [ "red", "green", "#ccc123", "#345232", "#231111", "#ab2322" ], random : function (num){undefined return Math.floor(Math.random()*num); }, init : function (num){undefined

this.maxlength = num;

this.maxWidth = (document.documentElement.clientWidth || document.body.clientWidth) + 20;

this.maxHeight = (document.documentElement.clientHeight || document.body.clientHeight) + 20; this.create(); this.move(); },

create : function (){undefined var that = this; setInterval(function (){undefined

if( that.arr.length < that.maxlength){undefined var d = document.createElement("div");

d.innerHTML = that.snowflake[that.random(that.snowflake.length)]; d.style.color = that.snowflakeColor[that.random(that.snowflakeColor.length)]; d.style.position = "absolute";

top(0- -99) left (0 - that.maxWidth*2/3-1) d.style.left = that.random(that.maxWidth*2/3) + "px"; d.style.top = -that.random(100) + "px";

d.vx = 2+that.random(10); d.vy = 3+that.random(10);

document.body.appendChild(d); that.arr.push(d) } },20) },

move : function (){undefined var that = this; var arr = that.arr; setInterval(function (){undefined

for(var i = 0 ; i < arr.length ; i ++ ){undefined

arr[i].style.left = arr[i].offsetLeft + arr[i].vx + "px"; arr[i].style.top = arr[i].offsetTop + arr[i].vy + 'px';

if (arr[i].offsetTop >= that.maxHeight || arr[i].offsetLeft >= that.maxWidth) {undefined document.body.removeChild(arr[i]); arr.splice(i,1); } } },30) } } window.onload = function (){undefined snowflakes.init(100); }