🥚 Console banner

This commit is contained in:
Alicia Sykes 2021-07-31 18:53:12 +01:00
parent 3434bfacba
commit 122627f6ce
3 changed files with 20 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import Footer from '@/components/PageStrcture/Footer.vue';
import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue';
import { componentVisibility } from '@/utils/ConfigHelpers';
import ConfigAccumulator from '@/utils/ConfigAccumalator';
import { welcomeMsg } from '@/utils/CoolConsole';
import {
localStorageKeys,
splashScreenTime,
@ -103,6 +104,7 @@ export default {
const cleanedCss = this.appConfig.customCss.replace(/<\/?[^>]+(>|$)/g, '');
this.injectCustomStyles(cleanedCss);
}
welcomeMsg();
},
};
</script>

14
src/utils/CoolConsole.js Normal file
View File

@ -0,0 +1,14 @@
/* eslint no-console: ["error", { allow: ["log"] }] */
export const welcomeMsg = () => {
const v = process.env.VUE_APP_VERSION ? `V${process.env.VUE_APP_VERSION}` : '';
console.log(`%cDashy ${v} 🚀`, 'color:#00af87; background:#0b1021; font-size:36px; padding: 0.5rem 0.5rem 0; margin: 1rem auto; font-family: Rockwell; border: 2px solid #00af87; border-radius: 4px;font-weight: bold; text-shadow: 1px 1px 1px #00af87bf;');
};
export const warningMsg = () => {
console.log('%c⚠ Error ⚠️', "background:#21bbca; color:#0b1021; font-size:20px; padding:0.25rem 0.5rem; margin: 1rem auto 0.25rem; font-family: 'Trebuchet MS', Helvetica; border: 2px solid yellow; border-radius: 4px; font-weight: bold;");
};
export const raiseBug = () => {
console.log('%c🐛If you have found a bug, raise an issue on GitHub, at:\nhttps://git.io/JnqPR', "color:#dddd10; font-size: 14px; font-family: 'Trebuchet MS', Helvetica;");
};

View File

@ -1,11 +1,15 @@
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
import { warningMsg, raiseBug } from '@/utils/CoolConsole';
/**
* Function called when an error happens
* If you wish to use an error logging service, put code for it here
*/
const ErrorHandler = function handler(msg) {
warningMsg();
console.warn(msg);
raiseBug();
};
export default ErrorHandler;