-
Notifications
You must be signed in to change notification settings - Fork 2
/
consoleBuddy.min.js
1 lines (1 loc) · 1.67 KB
/
consoleBuddy.min.js
1
var $consoleBuddy={log:function(e,t){var n="";var r="";var i="";if(!e){console.log("Please make sure you enter a message (e.g $consoleBuddy.log('Hello World');");return false}if(t==="uppercase"){n="text-transform: uppercase"}if(t==="success"){n="color: #ffffff; background: #9dcf24; border: 1px solid #7eae0c;"}if(t==="warning"){n="color: #ffffff; background: #de8e0f; border: 1px solid #b8760e;"}if(t==="error"){n="color: #ffffff; background: #d93625; border: 1px solid #a71c0d;"}if(t==="info"){n="color: #ffffff; background: #1d69db; border: 1px solid #0f4ba6;"}if(t==="pink"){n="color: #ffffff; background: #db178a; border: 1px solid #ae0c6b;"}if(t==="chalkboard"){n="color: #ffffff; background: #000000; border: 1px solid #000000;"}if(t==="tiger"){n="color: #ffffff; background: repeating-linear-gradient(-45deg, #e5910d, #e5910d 10px, #000000 10px, #000000 20px); border: 1px solid #000000;"}if(t==="rainbow"){n="color: #000000; background-image: linear-gradient(90deg, #ff0000 0%, #ffff00 15%, #00ff00 30%, #00ffff 50%, #0000ff 65%, #ff00ff 80%, #ff0000 100%); border: 1px solid #000000;"}if(e.search(/<(\/?b>)/img)>-1){r+="font-weight: bold;";i+="font-weight: normal;"}if(e.search(/<(\/?i>)/img)>-1){r+="font-style: italic;";i+="font-style: normal;"}if(e.search(/<(\/?u>)/img)>-1){r+="text-decoration: underline;";i+="text-decoration: none;"}if(n&&r){console.log("%c "+e.replace(/(<\/?[uib]>)+/img,"%c")+" ",n+"border-right: none; border-radius: 3px 0 0 3px;",n+r+"border-left: none; border-right: none;",n+i+"border-left: none; border-radius: 0 3px 3px 0;")}else if(n){console.log("%c "+e+" ",n+"border-radius: 3px;")}else if(r){console.log(e.replace(/(<\/?[uib]>)+/img,"%c"),r,i)}else{console.log(e)}}}