-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen.js
More file actions
55 lines (50 loc) · 1.87 KB
/
Copy pathscreen.js
File metadata and controls
55 lines (50 loc) · 1.87 KB
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
let info = document.getElementById('screen-info')
updateInfo()
addEventListener("resize", updateInfo);
function updateInfo() {
let Wwidth = window.innerWidth;
let Wheight = window.innerHeight;
let Swidth = screen.width;
let Sheigth = screen.height;
let text = document.getElementById('screen-text');
if (Wheight != 1080 || Wwidth != 1920) {
if (Sheigth == 1080 && Swidth == 1920) {
text.innerHTML =
"Your screen will be this size when you enter full screen mode. <span style=\"color: aqua;\">Press F11</span>"
} else if (Swidth == Wwidth && Sheigth == Wheight) {
text.innerHTML =
`Your screen has a size of ${Swidth} x ${Sheigth}px. This isn't optimal! <br>
Display errors may occur in the presentation!`
} else {
text.innerHTML =
`Your screen has in full screen mode a size of ${Swidth} x ${Sheigth}px and <br>
in this screen a size of ${Wwidth} x ${Wheight} px.This isn't optimal! <br>
Display errors may occur in the presentation!`
}
if (info.getAttribute('visible') == 'false') {
info.setAttribute('visible', 'show')
info.animate([
{ transform: "translateY(calc(-100% + 10px))" },
], {
duration: 1000,
iterations: 1,
fill: 'forwards',
easing: 'ease'
})
}
} else {
if (info.getAttribute('visible') == 'show') disapear_info()
}
}
function disapear_info() {
info.animate([
{ transform: "none" },
], {
duration: 1000,
iterations: 1,
fill: 'forwards',
easing: 'ease'
}).onfinish = () => {
info.setAttribute('visible', 'shown')
};
}