-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
70 lines (56 loc) · 1.91 KB
/
app.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
const sd_wrapper = document.querySelector(".sd_wrapper")
const manifest_sd = document.querySelector(".manifest-sd")
function add_list(text,caption) {
const list = document.createElement("div")
list.setAttribute("class","list")
const tag = document.createElement("div")
tag.setAttribute("class","list_tag")
tag.textContent = caption.toString()
const vlist = document.createElement("div")
vlist.setAttribute("class","view_list")
vlist.textContent = "#"
vlist.addEventListener("click",() => {
// start_activity(text)
location.replace(`./fetch/${text}`)
})
list.appendChild(tag)
list.appendChild(vlist)
sd_wrapper.appendChild(list)
}
function start_activity(activity_text) {
const body = document.body
const activity = document.createElement("div")
activity.setAttribute("class","activity")
const remove = document.createElement("div")
remove.setAttribute("class","remove")
remove.textContent = "hide"
remove.addEventListener("click",() => {
remove.remove()
clipboard.remove()
activity.remove()
})
const clipboard = document.createElement("div")
clipboard.setAttribute("class","clipboard")
clipboard.textContent = "copy"
clipboard.addEventListener("click",async () => {
await navigator.clipboard.writeText(JSON.stringify(activity_text,null,4))
})
body.appendChild(remove)
body.appendChild(clipboard)
activity.textContent = JSON.stringify(activity_text,null,4)
body.appendChild(activity)
}
let mf_sd = true
function manif_sd() {
if(mf_sd){
sd_wrapper.style.animation = "manif_in .7s forwards"
mf_sd = false
}
else {
sd_wrapper.style.animation = "manif_out .7s forwards"
mf_sd = true
}
}
manifest_sd.addEventListener("click",manif_sd)
add_list("kawaiinyahn.json","kawaiinyahn")
add_list("kawaiinyeow.json","kawaiinyeow")