Created
March 12, 2018 09:43
-
-
Save bell/6094a497c7d8d04ada7c2cc3c22edf10 to your computer and use it in GitHub Desktop.
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 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