Last active
October 9, 2021 19:15
-
-
Save unitycoder/96d8168286c067c3e1b1dad9f2e0e1d0 to your computer and use it in GitHub Desktop.
GreaseMonkey plugin : better pixel art image viewer for itch.io
This file contains 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 itch.io full screen image viewer | |
// @namespace https://unitycoder.com | |
// @description better image viewer lightbox for pixel art images | |
// @version 1.0 | |
// @include https://*.itch.io/* | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
// http://greasemonkey.win-start.de/patterns/add-css.html | |
function addGlobalStyle(css) | |
{ | |
var head, style; | |
head = document.getElementsByTagName('head')[0]; | |
if (!head) { return; } | |
style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.innerHTML = css; | |
head.appendChild(style); | |
} | |
// set custom styles for these elements | |
addGlobalStyle('#lightbox_container .lightbox.screenshot_lightbox.animated { width:100%; height:100%;}'); | |
addGlobalStyle('.lightbox.screenshot_lightbox .screenshot_container { width:100%; height:100%;display: flex;}'); | |
addGlobalStyle('.lightbox.screenshot_lightbox .screenshot_container .lb_screenshot { width:100%; height:auto; image-rendering: pixelated; image-rendering: -moz-crisp-edges; object-fit:contain;}'); | |
addGlobalStyle('body.lightbox_open { overflow:auto; !important;}'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
info https://unitycoder.com/blog/2021/10/09/greasemonkey-better-pixel-art-viewer-for-itch-io/