Skip to content

Commit

Permalink
fancy console log (from website v2)
Browse files Browse the repository at this point in the history
  • Loading branch information
aorcsik committed Aug 4, 2023
1 parent 2723445 commit b0a4de0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/js/careers.js
Original file line number Diff line number Diff line change
@@ -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");
});
13 changes: 12 additions & 1 deletion src/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,15 @@ function setMetaContent(options, content) {
getMetaTag(options).content = content;
}

export {capitalize, icaseEqual, icaseIncludes, getElementTextContent, getFirstElementByClassname, getMetaTag, setMetaContent};
/**
* @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};
3 changes: 3 additions & 0 deletions src/js/integrations.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -41,4 +42,6 @@ IntegrationsService.loadIntegrations().then(integrations => {
window.location.hash = "category-" + match[1];
}, 500);
}

fancyConsoleLog("Bitrise.io Integrations");
});
6 changes: 4 additions & 2 deletions src/js/steps.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -43,5 +43,7 @@ IntegrationsService.loadIntegrations().then(integrations => {

header.render(integrations, step);
details.render(integrations, step);
}

fancyConsoleLog('Bitrise.io Integrations: ' + step.title);
}
});

0 comments on commit b0a4de0

Please sign in to comment.