-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
89 lines (76 loc) · 2.32 KB
/
script.js
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
79
80
81
82
83
84
85
86
87
88
89
function copy(el) {
let element = document.createElement("textarea");
element.value = el.textContent;
element.style.height = "0px";
element.style.width = "0px";
element.style.opacity = "0";
document.body.appendChild(element);
element.select();
document.execCommand("copy");
document.body.removeChild(element);
Toastify({
text: el.textContent,
duration: 1000,
gravity: "top", // `top` or `bottom`
position: "right", // `left`, `center` or `right`
stopOnFocus: false, // Prevents dismissing of toast on hover
style: {
background: "#222",
border: "0",
outline: "0",
},
onClick: function () {}, // Callback after click
}).showToast();
}
/*
document.getElementById("howto").style.display = "none";
var input = document.getElementById("inputcoba");
var out = document.getElementById("output");
function coba() {
out.innerHTML = input.value;
}
var inputnama = document.getElementById("inputcoba-nama");
var inputukuran = document.getElementById("inputcoba-ukuran");
var inputwarna = document.getElementById("inputcoba-warna");
var outguide = document.getElementById("output-guided");
function cobaGuided() {
outguide.innerHTML =
"<div class='" +
inputnama.value +
inputukuran.value +
inputwarna.value +
"'></div>";
}
*/
function myFunction() {
// Declare variables
var input, filter, ul, li, a, i, txtValue;
input = document.getElementById("input");
filter = input.value.toUpperCase();
ul = document.getElementById("ic");
li = ul.getElementsByTagName("li");
// Loop through all list items, and hide those who don't match the search query
for (i = 0; i < li.length; i++) {
a = li[i].getElementsByTagName("a")[0];
txtValue = a.textContent || a.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
li[i].style.display = "";
} else {
li[i].style.display = "none";
}
console.log(a.count);
}
}
var list = document.getElementById("ic");
var jumlah = list.getElementsByTagName("li");
setInterval(function () {
document.getElementById("total-icon").innerHTML =
"<i>Total Icons: " + jumlah.length + "</i>";
}, 1000);
///
setTimeout(function () {
var ul = document.getElementById("acak");
for (var i = ul.children.length; i >= 0; i--) {
ul.appendChild(ul.children[(Math.random() * i) | 0]);
}
}, 1200);