forked from max-mapper/screencat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.js
47 lines (40 loc) · 1.43 KB
/
ui.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
var ui = {}
module.exports = ui
ui.show = show
ui.hide = hide
ui.containers = {
share: document.querySelector('.share-container'),
join: document.querySelector('.join-container'),
content: document.querySelector('.content-container'),
choose: document.querySelector('.choose-container'),
capturer: document.querySelector('.capturer-container'),
multimedia: document.querySelector('.multimedia-container'),
sharing: document.querySelector('.sharing-container'),
viewing: document.querySelector('.viewing-container'),
mdns: document.querySelector('.code-mdns')
}
ui.buttons = {
share: document.querySelector('.share-button'),
join: document.querySelector('.join-button'),
copy: document.querySelector('.code-copy-button'),
paste: document.querySelector('.code-paste-button'),
quit: document.querySelector('.quit-button'),
back: document.querySelector('.back-button'),
destroy: document.querySelector('.sharing-container .destroy-button'),
stopViewing: document.querySelector('.viewing-container .destroy-button'),
show: document.querySelector('.viewing-container .show-button'),
mdns: document.querySelector('.code-mdns-button')
}
ui.inputs = {
copy: document.querySelector('.code-copy-input'),
paste: document.querySelector('.code-paste-input')
}
function show (ele) {
if (!ele) return
ele.classList.remove('dn')
}
function hide (ele) {
if (!ele) return
ele.classList.add('dn')
ele.classList.remove('db')
}