Skip to content

Instantly share code, notes, and snippets.

@ravinggenius
Created March 17, 2014 04:16
Show Gist options
  • Save ravinggenius/9593906 to your computer and use it in GitHub Desktop.
Save ravinggenius/9593906 to your computer and use it in GitHub Desktop.
(function (global) {
global.awesomification = function (includeSpeech) {
var log = console.log;
console.log = function (str) {
var css = 'background: linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); color: white; font-weight: bold; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;';
var args = Array.prototype.slice.call(arguments);
args[0] = '%c' + args[0];
args.splice(1, 0, css);
if (includeSpeech) {
var speech = new SpeechSynthesisUtterance();
speech.text = str;
global.speechSynthesis.speak(speech);
}
return log.apply(console, args);
};
};
})(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment