git.iko.soy/ilyakooo0.github.io
on cb06fb4 help sign in
57 lines 965 B history raw
1function update() {
2 let t = $("#kollokTheor").prop("checked")
3 let o = $("#kollokOpr").prop("checked")
4 let k1 = $("#kollok1").prop("checked")
5 let k2 = $("#kollok2").prop("checked")
6 let k3 = $("#kollok3").prop("checked")
7 let k4 = $("#kollok4").prop("checked")
9 let out = []
11 if (t) {
12 if (k1) {
13 out = out.concat(theor[0])
14 }
15 if (k2) {
16 out = out.concat(theor[1])
17 }
18 if (k3) {
19 out = out.concat(theor[2])
20 }
21 if (k4) {
22 out = out.concat(theor[3])
23 }
24 }
26 if (o) {
27 if (k1) {
28 out = out.concat(opr[0])
29 }
30 if (k2) {
31 out = out.concat(opr[1])
32 }
33 if (k3) {
34 out = out.concat(opr[2])
35 }
36 if (k4) {
37 out = out.concat(opr[3])
38 }
39 }
41 let tt = out[Math.floor(Math.random()*out.length)]
43 $("#kollokText").text(tt)
46var opr = []
47var theor = []
49window.onload = function() {
51 $.getJSON("/linal/kollok_/theory.json", function(result) {
52 opr = result["opr"]
53 theor = result["theor"]
54 });
56 $("#fightMeKollok").click(update);