[init] initial commit

This commit is contained in:
2023-06-16 09:39:28 +08:00
commit 860d5d351d
13 changed files with 605 additions and 0 deletions

36
js/typeWriter.js Normal file
View File

@@ -0,0 +1,36 @@
let i = 0;
let text1 = "你好啊,小扈同学,很高兴认识你!";
let text2 = "愿我们每一天都是值得纪念的,也是值得怀念的。"
let speed = 100;
function typeWriter(text, para){
if(ok == 2){
clearInterval(typeInterval);
}
if(i < text.length){
document.getElementById(para).innerHTML += text.charAt(i);
i++;
speed = Math.random() * 50 + 100;
}
else{
if(ok == 0){
i = 0;
}
ok += 1;
}
}
var typeInterval;
//window.onload = function() {
// window.onload = function(){};
typeInterval = setInterval(function(){
if(ok == 0){
typeWriter(text1, "txt1");
}
else if(ok == 1){
typeWriter(text2, "txt2");
}
}, 300);
//};