/* ==UserStyle== @name Media Transformations @description Applies configurable transformations to images and/or videos. @version 2026.04.23.20.04 @author MetalTxus @namespace https://github.com/jesuscc1993/ @license CC BY-SA 4.0 @preprocessor stylus @advanced checkbox apply-to-images "Apply to images" 1 @advanced checkbox apply-to-videos "Apply to videos" 1 @advanced range rotation "Rotation" [0, -180, 180, 1, 'deg'] @advanced range scale "Scale" [100, 1, 1000, 1, '%'] @advanced number translation-x "Translation (x)" 0 @advanced number translation-y "Translation (y)" 0 @advanced text blur "Blur" unset @advanced text brightness "Brightness" unset @advanced text contrast "Contrast" unset @advanced text grayscale "Grayscale" unset @advanced text saturate "Saturate" unset @advanced text sepia "Sepia" unset @advanced text invert "Invert" unset @advanced text hue "Hue rotate" unset @advanced text opacity "Opacity" unset ==/UserStyle== */ @-moz-document regexp(".*") { apply() { transform: rotate(rotation) scale(scale) translate(translation-x + 0px, translation-y + 0px); filter = ''; if (blur !='unset') { filter +=' blur(' + blur + ')'; } if (brightness !='unset') { filter +=' brightness(' + brightness + ')'; } if (contrast !='unset') { filter +=' contrast(' + contrast + ')'; } if (grayscale !='unset') { filter +=' grayscale(' + grayscale + ')'; } if (saturate !='unset') { filter +=' saturate(' + saturate + ')'; } if (sepia !='unset') { filter +=' sepia(' + sepia + ')'; } if (invert !='unset') { filter +=' invert(' + invert + ')'; } if (hue !='unset') { filter +=' hue-rotate(' + hue + ')'; } if (opacity !='unset') { filter +=' opacity(' + opacity + ')'; } if (filter !='') { filter: unquote(filter) } } if (apply-to-images) { img { apply(); } } if (apply-to-videos) { video { apply(); } } }