-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolor.js
40 lines (25 loc) · 825 Bytes
/
color.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
function getRandomColor() {
let letters = "0123456789ABCDEF";
let color = "#";
for(let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function setRandomColor() {
document.getElementById("colorCode").innerHTML = getRandomColor();
document.getElementById("colorBox").style.background = getRandomColor();
}
function copyFunc(){
let theText = document.getElementById("colorCode");
navigator.clipboard.writeText(theText.innerHTML);
document.getElementById("text").innerHTML= theText.innerHTML;
}
function myTimeAlert(){
let noti = document.getElementById("notice");
noti.style.display = "flex";
}
function myTimeAlertStop(){
let noti = document.getElementById("notice");
noti.style.display = "none";
}