Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Rabbit unfuckerupper
- // @namespace Acevpd3 + Lucci Gang
- // @version 0.0.1
- // @description keeps joining a new lobby until it gets in the right one thhats such a shitty description but ok.
- // @author Acevpd3 + Lucci Gang
- // @match *://www.rabb.it/*
- // @grant none
- // ==/UserScript==
- let styleElement;
- let hidden;
- window.addEventListener('click', clickHandler);
- window.addEventListener("fullscreenchange", fsHandler);
- function clickHandler(e) {
- let classList = Array.prototype.slice.call(e.target.classList, 0);
- if (classList.includes('enter')) hideTheStuff();
- if (classList.includes('exit')) unhideTheStuff();
- }
- function hideTheStuff() {
- document.querySelector('div.tray.screencast').style.display = 'none';
- document.querySelector('.normalControls').style.display = 'none';
- window.addEventListener('mousemove', mousemoveHandler);
- hidden = true;
- }
- function unhideTheStuff() {
- document.querySelector('div.tray.screencast').style.display = '';
- document.querySelector('.normalControls').style.display = '';
- window.removeEventListener('mousemove', mousemoveHandler);
- hidden = false;
- }
- function mousemoveHandler(e) {
- let mouseAtBottom = Boolean(window.innerHeight - e.clientY < window.innerHeight / 10);
- let mouseAtTopRight = Boolean(e.clientY < window.innerHeight / 10 && e.clientX > window.innerWidth / 30);
- document.querySelector('.normalControls').style.display = mouseAtBottom ? '' : 'none';
- styleElement.innerHTML = mouseAtTopRight ? '' : '.rightToggle {display: none !important;}';
- }
- function fsHandler(e) {
- if (!document.webkitIsFullScreen && !document.mozFullScreen && !document.msFullscreenElement && hidden) {
- unhideTheStuff();
- }
- }
- function stylize() {
- let style = document.createElement('style');
- style.innerHTML = '.rightToggle {display: none !important;}';
- let ref = document.querySelector('script');
- ref.parentNode.insertBefore(style, ref);
- styleElement = style;
- let style_ = document.createElement('style');
- style_.innerHTML = '.desktop .roomLayout .mainRoom .videoChatView.chatOpen.fullscreen .chatLayout{height: 100%; background-color: transparent; background-image: linear-gradient(90deg,#000000a8,#000);}';
- style_.innerHTML += '.screencastRequestPopup .popup{display: none;}'
- ref.parentNode.insertBefore(style_, ref);
- }
- stylize();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement