Skip to content

Instantly share code, notes, and snippets.

@bell
Created March 12, 2018 09:43
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/6094a497c7d8d04ada7c2cc3c22edf10 to your computer and use it in GitHub Desktop.
Save bell/6094a497c7d8d04ada7c2cc3c22edf10 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @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)';
}
});
});
// Your code here...
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment