-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
78 lines (67 loc) · 2 KB
/
script.js
File metadata and controls
78 lines (67 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
var page_loaded = false;
loading_in()
var delay_load = Math.floor(Math.random() * 0)
async function loaded() {
page_loaded = true;
//wait intill loading animate done
await wait_for(delay_load + 350 + 40 *6 + 350)
let loading_page = document.getElementById("loading_tag")
loading_page.classList.add("loaded_w")
let wrapper = document.getElementById("wrapper_main")
wrapper.classList.add("shown")
}
async function get_it_until_not_null(id) {
let result = null
let ms = 10
do {
await wait_for(ms)
result = document.getElementById(id)
if (ms < 100) ms=+5
console.log(id + " is null")
} while (result == null)
}
get_it_until_not_null('main')
async function loading_in() {
let loading_t = document.getElementById("loading_t")
let txt = loading_t.innerText
// for(var i =0 ; i < 9 ; i++){
while(!page_loaded){
await wait_for(350)
let res = txt.slice(-3);
console.log(res)
if (res != "...") {
txt = txt + "."
loading_t.innerText = txt
}
else{
txt = "Loading"
await wait_for(550)
loading_t.innerText = txt
}
}
await wait_for(200)
let t_ = 40;
txt = ""
txt = txt + "L"
loading_t.innerText = txt
await wait_for(t_)
txt = txt + "o"
loading_t.innerText = txt
await wait_for(t_)
txt = txt + "a"
loading_t.innerText = txt
await wait_for(t_)
txt = txt + "d"
loading_t.innerText = txt
await wait_for(t_)
txt = txt + "e"
loading_t.innerText = txt
await wait_for(t_)
txt = txt + "d"
loading_t.innerText = txt
await wait_for(t_)
txt = txt + "."
loading_t.innerText = txt
}
//timer function
function wait_for(ms) { return new Promise(resolve => setInterval(resolve, ms)); }