forked from SheepTester/sheeptester.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsheep3.js
More file actions
19 lines (19 loc) · 756 Bytes
/
sheep3.js
File metadata and controls
19 lines (19 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
document.addEventListener("DOMContentLoaded", function(e) {
var homeButton = document.createElement("sheep-btn");
homeButton.setAttribute('tabindex', 0);
homeButton.setAttribute('aria-label', 'Go to SheepTester directory');
homeButton.addEventListener('click', function(e) {
document.body.classList.add('sheep-blockscreen');
homeButton.addEventListener('transitionend', function(e) {
window.requestAnimationFrame(function() {
// Try forcing repaint
homeButton.getBoundingClientRect();
window.location = '/?from=sheep3';
});
});
});
homeButton.addEventListener('keydown', function(e) {
if (e.keyCode === 13) homeButton.click();
});
document.body.appendChild(homeButton);
}, {once: true});