Skip to content

Instantly share code, notes, and snippets.

@zivc
Forked from LeaVerou/RAINBOWlog.js
Last active January 14, 2016 21:51
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save zivc/9519022 to your computer and use it in GitHub Desktop.
Save zivc/9519022 to your computer and use it in GitHub Desktop.
(function(){
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;';
var args = Array.prototype.slice.call(arguments);
args[0] = '%c' + args[0];
args.splice(1,0,css);
var speech = new SpeechSynthesisUtterance();
speech.text = str;
window.speechSynthesis.speak(speech);
return log.apply(console, args);
}
})();
@kentaromiura
Copy link

I'll add some font-family:Comic Sans MS;font-size:13pt; like in my https://twitter.com/kentaromiura/status/443900362597351424, you know, for readability as the CERN tought us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment