mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 16:57:58 +01:00
add mouse thingy lol
This commit is contained in:
parent
40d8fd4b60
commit
e15695a0d9
1 changed files with 26 additions and 0 deletions
|
@ -1805,6 +1805,32 @@ const urlParams = new URLSearchParams(window.location.search);
|
||||||
if (!urlParams.has('hl') && !urlParams.has('region') && languageCode && regionCode) {
|
if (!urlParams.has('hl') && !urlParams.has('region') && languageCode && regionCode) {
|
||||||
location.href = currentURL + `®ion=${regionCode}&hl=${languageCode}`;
|
location.href = currentURL + `®ion=${regionCode}&hl=${languageCode}`;
|
||||||
}
|
}
|
||||||
|
let isMiddleButtonPressed = false;
|
||||||
|
|
||||||
|
// Function to change video speed
|
||||||
|
function changeVideoSpeed() {
|
||||||
|
if (isMiddleButtonPressed) {
|
||||||
|
video.playbackRate = 2; // Set the video speed to 2x
|
||||||
|
} else {
|
||||||
|
video.playbackRate = 1; // Set the video speed to 1x
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event listener for mouse button press
|
||||||
|
document.addEventListener('mousedown', function (event) {
|
||||||
|
if (event.button === 1) {
|
||||||
|
isMiddleButtonPressed = true;
|
||||||
|
changeVideoSpeed();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Event listener for mouse button release
|
||||||
|
document.addEventListener('mouseup', function (event) {
|
||||||
|
if (event.button === 1) {
|
||||||
|
isMiddleButtonPressed = false;
|
||||||
|
changeVideoSpeed();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var anchor = document.getElementById("sub");
|
var anchor = document.getElementById("sub");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue