Skip to content

Instantly share code, notes, and snippets.

@bell
Last active January 23, 2018 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bell/aac3b4567e747755d9728d213ae23d6f to your computer and use it in GitHub Desktop.
Save bell/aac3b4567e747755d9728d213ae23d6f to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name vg-beutyfier
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Make VG.no look better
// @author You
// @match https://www.vg.no/
// @grant none
// ==/UserScript==
(function() {
'use strict';
['', '-ms-', '-webkit-', '-o-', '-moz-'].map(function(prefix){
Array.prototype.slice.call(document.querySelectorAll('img')).map(function(el){
let choice = Math.trunc(Math.random()*100);
if (choice >= 95) {
el.src = '//codebox.org.uk/graphics/bieber.jpg';
} else if (choice < 10) {
el.style[prefix + 'transform'] = 'rotate(180deg)';
}
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment