-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.js
57 lines (47 loc) · 1.47 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
48
49
50
51
52
53
54
55
56
57
function toggleFade(checkboxElem) {
_setFade(checkboxElem.checked);
}
function changeSpeed(slider) {
if (!document.getElementById("pauseButton").checked)
_setSpeed(slider.value);
}
function togglePause(pause) {
_changePause(pause.checked, document.getElementById("speed").value);
if (pause.checked)
toPlay();
else
toPause();
}
function nextFrame() {
_nextFrame(document.getElementById("speed").value);
}
let playAnims = document.getElementsByClassName("toPlay");
let pauseAnims = document.getElementsByClassName("toPause");
var toPause = function() {
Array.prototype.filter.call(pauseAnims, function(pauseAnim) {
return pauseAnim.beginElement();
});
}
var toPlay = function() {
Array.prototype.filter.call(playAnims, function(playAnim) {
return playAnim.beginElement();
});
}
const element = document.getElementById('resetSpin')
function reset() {
element.classList.remove('resetAnim'); // reset animation
void(element.clientWidth); // trigger reflow
document.getElementById('resetSpin').classList.add('resetAnim'); // start animation
_restart();
}
var browser = bowser.getParser(window.navigator.userAgent);
var browserName = browser.getBrowser().name;
if (browserName == "Firefox") {
let chrome = document.getElementById("chrome");
chrome.innerHTML = "";
chrome.remove();
} else {
let firefox = document.getElementById("firefox");
firefox.innerHTML = "";
firefox.remove();
}