-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
51 lines (38 loc) · 1.33 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
import AppData from "./AppData.js"
import generateMessage from "./GenerateMessage.js"
import { openModal, closeModal } from "./ModalController.js"
import { $ } from "./shortHand.js"
const App = () => {
generateMessage()
const respawnToggler = $("#__respawn")
const brandElement = $(".__brand")
const creditElement = $(".__credits #--name")
const magicElement = $("#__magic")
const closeModalElement = $("#__close-modal")
const shareTextElement = $("#__share-text")
respawnToggler.onclick = e => {
const context = e.currentTarget
context.classList.add("loading")
setTimeout(() => {
context.classList.remove("loading")
generateMessage()
}, 1000)
}
brandElement.innerText = AppData.name
brandElement.onclick = () => location.assign(AppData.githubRepositoryUrl)
creditElement.onclick = () => location.assign(AppData.authorUrl)
const tempMagicElementOnclick = magicElement.onclick
magicElement.onclick = () => {
openModal()
}
closeModalElement.onclick = closeModal
shareTextElement.value = AppData.shareText
}
document.body.onload = () => {
App()
$("body").classList.add("loaded")
new ClipboardJS('#__magic');
}
function gonative_library_ready(){
gonative_match_statusbar_to_body_background_color();
}