Skip to content

Instantly share code, notes, and snippets.

@andersonbosa
Created August 2, 2024 22:53
Show Gist options
  • Save andersonbosa/973e8c14902fb4b44378f9468122bfad to your computer and use it in GitHub Desktop.
Save andersonbosa/973e8c14902fb4b44378f9468122bfad to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name animeszone.net upgrader
// @match https://animeszone.net/*
// @version 99
// @author https://twitter.com/t4inha
// @description 8/21/2023, 1:52:49 PM
// ==/UserScript==
const CUSTOM_CSS = `
#tt-wp > header > header > nav {
background-color: #241841 !important;
}
div.content main div.paginadorplay a {
font-size: 32px !important;
}
.dtsingle .content {
width: 100% !important;
}
.dtsingle .content.right {
margin-right: 360px !important
}
#playeroptionsul {
display: flex;
column-gap: 24px;
}
#playeroptionsul .dooplay_player_option {
background-image: linear-gradient(45deg, #241841, #241841) !important;
}
.video-buttons.secondary i {
font-size: 32px;
}
`
function injectCustomCSSTag() {
// Create a new <style> element
var styleTag = document.createElement('style');
// Add CSS rules to the <style> element
styleTag.innerHTML = CUSTOM_CSS;
// Append the <style> element to the <head> of the document
document.head.appendChild(styleTag);
}
// Função para verificar se o elemento existe na página
function waitForElementToExist(selector, callback) {
const interval = setInterval(() => {
const element = document.querySelector(selector);
if (element) {
clearInterval(interval);
callback(element);
}
}, 100);
}
function removeHTMLElement(selector) {
document.querySelector(selector).remove()
}
function deleteClass (selector, className) {
document.querySelector(selector).classList.remove(className)
}
function addClass (selector, className) {
document.querySelector(selector).classList.add(className)
}
function toggleClass (selector, className) {
document.querySelector(selector).classList.toggle(className)
}
function main () {
const playerSel = "div.anime__video__player > div.content"
function centralizeVideoPlayer(playerSel) {
deleteClass(playerSel, 'right')
addClass(playerSel, 'center')
removeHTMLElement('div.anime__video__player > div.sidebar.right.scrolling')
}
waitForElementToExist(playerSel, () => centralizeVideoPlayer(playerSel))
removeHTMLElement('#show_adblock')
}
// main
setTimeout(injectCustomCSSTag, 10)
waitForElementToExist("div.bodyc", () => removeHTMLElement("div.bodyc"));
waitForElementToExist("#tt-wp > header > header > nav", () => deleteClass("#tt-wp > header > header > nav", 'transparent'))
setTimeout(main, 500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment