Skip to content

Instantly share code, notes, and snippets.

@keif
Created December 11, 2019 15:20
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 keif/c353011632bff0fd4aa2aa9d0eeec395 to your computer and use it in GitHub Desktop.
Save keif/c353011632bff0fd4aa2aa9d0eeec395 to your computer and use it in GitHub Desktop.
A simple script to add a colored console message.
const sayHello = () => {
if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
var args = ['\n %c Made with ♥ by <name> %c %c %c http://www.dogstudio.co/ %c %c \n', 'color: #fff; background: #e43333; padding:5px 0;', 'background: #131419; padding:5px 0;', 'background: #131419; padding:5px 0;', 'color: #fff; background: #1c1c1c; padding:5px 0;', 'background: #fff; padding:5px 0;', 'color: #e43333; background: #fff; padding:5px 0;']
window.console.log.apply(console, args)
} else if (window.console) {
window.console.log('Made with love ♥ <name> - http://www.dogstudio.co/')
}
}
export default sayHello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment