andrews/sheep/3.js

24 lines
906 B
JavaScript
Raw Permalink Normal View History

2023-01-23 18:43:56 +01:00
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();
2023-01-23 18:44:56 +01:00
window.location = '/?from=sheep3';
2023-01-23 18:43:56 +01:00
});
});
});
homeButton.addEventListener('keydown', function(e) {
if (e.keyCode === 13) homeButton.click();
});
document.body.appendChild(homeButton);
}, {once: true});
2023-02-08 21:27:32 +01:00
2023-02-08 22:42:01 +01:00
//var url = window.location.toString();
//window.location = url.replace('netlify.app', 'onrender.com');