-
Notifications
You must be signed in to change notification settings - Fork 59
/
sheep3.js
27 lines (26 loc) · 1.04 KB
/
sheep3.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
document.addEventListener("DOMContentLoaded", function(e) {
var homeButton = document.createElement("sheep-btn");
homeButton.setAttribute('tabindex', 0);
homeButton.setAttribute('aria-label', 'Go to SheepTester directory');
homeButton.setAttribute('role', 'button');
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});
// TODO: Remove after 2023-05-29
window.dataLayer = [['js', new Date()], ['config', 'G-9NWSPRKVS1']]
.map(args => function () { return arguments }(...args));
document.head.appendChild(Object.assign(document.createElement('script'), {
src: '/pensive.js'
}));