Last active
December 19, 2018 16:11
-
-
Save Renari/9e27906b74428c4da0104b49e1b62102 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Plex Background Art | |
// @namespace com.arimil.renari.plexbackgroundart | |
// @version 0.5 | |
// @description Sets the artwork image at the background in Plex. | |
// @author Renari | |
// @match YOURPLEXDOMAINHERE* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js | |
// @require https://greasyfork.org/scripts/1003-wait-for-key-elements/code/Wait%20for%20key%20elements.js?version=2765 | |
// @grant none | |
// ==/UserScript== | |
waitForKeyElements('div.PrePlayArtwork-imageContainer-3dXG6 > div[style*="blob"]', moveArtwork); | |
function moveArtwork(node) { | |
var gradientCss = 'linear-gradient( rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75) ),'; | |
var background = node[0].style.backgroundImage; | |
background = gradientCss + background; | |
var backgroundReplacement = document.getElementsByClassName('PageContent-pageContent-16mK6'); | |
if(backgroundReplacement !== undefined) { | |
backgroundReplacement[0].style.backgroundImage = background; | |
backgroundReplacement[0].style.backgroundSize = 'cover'; | |
} | |
node[0].parentNode.parentNode.removeChild(node[0].parentNode); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I somewhat achieved the same feel with more blur and clunky code ;-)