From b0a4de04760bf7d5316d7006ef91a78db3387016 Mon Sep 17 00:00:00 2001 From: Antal Orcsik Date: Fri, 4 Aug 2023 13:43:36 +0200 Subject: [PATCH] fancy console log (from website v2) --- src/js/careers.js | 3 +++ src/js/common.js | 13 ++++++++++++- src/js/integrations.js | 3 +++ src/js/steps.js | 6 ++++-- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/js/careers.js b/src/js/careers.js index 0ff7f43..d115f7d 100644 --- a/src/js/careers.js +++ b/src/js/careers.js @@ -1,9 +1,12 @@ import BambooHRService from "./careers/BambooHRService"; import JobDepartmentList from "./careers/JobDepartmentList"; +import { fancyConsoleLog } from "./common"; const jobDepartmentList = new JobDepartmentList(); const bamboo = new BambooHRService(); bamboo.getJobs().then(jobs => { jobDepartmentList.render(jobs); + + fancyConsoleLog("Bitrise.io Careers"); }); \ No newline at end of file diff --git a/src/js/common.js b/src/js/common.js index eb174d4..bcf40ee 100644 --- a/src/js/common.js +++ b/src/js/common.js @@ -72,4 +72,15 @@ function setMetaContent(options, content) { getMetaTag(options).content = content; } -export {capitalize, icaseEqual, icaseIncludes, getElementTextContent, getFirstElementByClassname, getMetaTag, setMetaContent}; \ No newline at end of file +/** + * @param {string} text + */ +function fancyConsoleLog(text) { + const tpl = + 'border-radius: 4px;' + + 'background-image: linear-gradient(318deg, #0dd3c5, #652ec3 48%, #760fc3 84%, #990fc3); ' + + 'font-size:16px; font-weight: 100;padding:3px 5px;color:'; + console.log('%c' + text, tpl + 'white'); +} + +export {capitalize, icaseEqual, icaseIncludes, getElementTextContent, getFirstElementByClassname, getMetaTag, setMetaContent, fancyConsoleLog}; \ No newline at end of file diff --git a/src/js/integrations.js b/src/js/integrations.js index e5fe4b0..c37a2f9 100644 --- a/src/js/integrations.js +++ b/src/js/integrations.js @@ -1,6 +1,7 @@ import IntegrationsService from "./integrations/IntegrationsService"; import StepListSection from "./integrations/StepListSection"; import SidebarSection from "./integrations/SidebarSection"; +import { fancyConsoleLog } from "./common"; const style = document.createElement("style"); document.getElementsByTagName("head")[0].appendChild(style); @@ -41,4 +42,6 @@ IntegrationsService.loadIntegrations().then(integrations => { window.location.hash = "category-" + match[1]; }, 500); } + + fancyConsoleLog("Bitrise.io Integrations"); }); \ No newline at end of file diff --git a/src/js/steps.js b/src/js/steps.js index 413b72c..3e30e2a 100644 --- a/src/js/steps.js +++ b/src/js/steps.js @@ -1,4 +1,4 @@ -import { setMetaContent } from "./common"; +import { fancyConsoleLog, setMetaContent } from "./common"; import DetailsSection from "./integrations/DetailsSection"; import HeaderSection from "./integrations/HeaderSection"; import IntegrationsService from "./integrations/IntegrationsService"; @@ -43,5 +43,7 @@ IntegrationsService.loadIntegrations().then(integrations => { header.render(integrations, step); details.render(integrations, step); - } + + fancyConsoleLog('Bitrise.io Integrations: ' + step.title); + } });