diff --git a/Gruntfile.js b/Gruntfile.js
index 29b891e..4e0b45e 100755
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -38,6 +38,17 @@ module.exports = function(grunt) {
}
},
+ json: {
+ main: {
+ options: {
+ namespace: 'justiceTheme',
+ includePath: false
+ },
+ src: ['src/theme.json'],
+ dest: 'src/js/justice.theme.js'
+ }
+ },
+
includes: {
js: {
options: {
@@ -105,7 +116,22 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-includes');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-shell');
+ grunt.loadNpmTasks('grunt-json');
+
+ grunt.registerTask('compileTheme', 'compileTheme', function() {
+ var done = this.async();
+ var fs = require('fs');
+ var jsonSass = require('json-sass');
+
+ fs.createReadStream('src/theme.json')
+ .pipe(jsonSass({
+ prefix: '$theme: ',
+ }))
+ .pipe(fs.createWriteStream('src/scss/theme.scss'));
+
+ done();
+ });
- grunt.registerTask('build', ['clean', 'sass', 'autoprefixer', 'css2js:main', 'includes:js', 'uglify:min', 'uglify:minMapped', 'shell:logSize']);
+ grunt.registerTask('build', ['clean', 'compileTheme', 'sass', 'autoprefixer', 'css2js:main', 'json', 'includes:js', 'uglify:min', 'uglify:minMapped', 'shell:logSize']);
grunt.registerTask('default', ['build', 'watch']);
};
\ No newline at end of file
diff --git a/build/justice.mapped.min.js b/build/justice.mapped.min.js
index 22b5d8b..b285a5f 100644
--- a/build/justice.mapped.min.js
+++ b/build/justice.mapped.min.js
@@ -1,2 +1,2 @@
-"use strict";!function(){var a=".justice{position:fixed;bottom:0;left:0;right:0;background:black;padding:0 10px 10px 10px;box-sizing:border-box;font-size:12px;font-family:monospace;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;z-index:2147483647;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media (min-width: 1235px){.justice{padding-bottom:10px;}}.justice.closed{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%)}.justice .justice-metric-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:wrap;-ms-flex-flow:wrap;flex-flow:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.justice .justice-metric{height:40px;display:inline-block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin:10px 10px 0 0}.justice .justice-metric.chart{width:300px}.justice .justice-title{text-transform:uppercase;padding:3px 0.5em 3px 3px;color:#dfdfdf}.justice .justice-text{color:#dfdfdf;font-weight:600}.justice .justice-text.pass{color:#419ba3}.justice .justice-text.warn{color:#d4ca3d}.justice .justice-text.fail{color:#ce452d}.justice .justice-toggle{width:20px;height:20px;background-color:black;position:absolute;right:0;top:-20px;opacity:0.5;border-top-left-radius:50%;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media only screen and (min-device-pixel-ratio: 1.1){.justice .justice-toggle{width:40px;height:40px;top:-40px;}}.justice .justice-toggle:after{content:'';position:absolute;width:50%;height:50%;border-radius:100%;margin:5px;background-color:#dfdfdf;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media only screen and (min-device-pixel-ratio: 1.1){.justice .justice-toggle:after{margin:10px;}}.justice.closed .justice-toggle{opacity:1}.justice.closed .justice-toggle:after{background-color:#419ba3}",b=document.createElement("style");if(document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet)b.styleSheet.disabled||(b.styleSheet.cssText=a);else try{b.innerHTML=a}catch(c){b.innerText=a}}();var Justice=function(){function a(a){var b={},a=a||{};for(var c in W)b[c]=W[c];for(var c in a)b[c]=a[c];return b}function b(a,b,c){for(var d in a.metrics)b[d]=c[d]}function c(){return O.loadEventStart-O.navigationStart}function d(){return O.domComplete-O.domLoading}function e(){return O.domInteractive-O.domLoading}function f(){var a=0;return window.chrome&&window.chrome.loadTimes?(a=1e3*window.chrome.loadTimes().firstPaintTime,a-=1e3*window.chrome.loadTimes().startLoadTime,a.toFixed(0)):"number"==typeof window.performance.timing.msFirstPaint?(a=window.performance.timing.msFirstPaint,a-=window.performance.timing.navigationStart,a.toFixed(0)):"¯\\_(ツ)_/¯"}function g(){return performance.getEntries?performance.getEntries().length:"¯\\_(ツ)_/¯"}function h(){return O.responseStart-O.connectEnd}function i(a){if(T){var b=(a-T)/1e3,c=1/b,d=Math.floor(c>60?60:c);R=d,S.push([d,d]),S.length>L&&S.shift(),T=a}else T=a}function j(a,b){var c="";return c=a>b?"fail":a>b*X.warnThreshold?"warn":"pass"}function k(a,b,c){var d=b.collector(),e=j(d,c);return['
',''+b.label+": ",''+d+b.unitLabel+"","
"].join("")}function l(a){var b=[];for(var c in Z){var d=k(c,Z[c],X.metrics[c].budget);b.push(d)}return''+b.join("")+"
"}function m(){var a=X.showFPS?['','FPS: ','',"
"].join(""):"";return a}function n(a,b){a.clearRect(0,0,b.width,b.height),q(a),o(a),p(a)}function o(a){var b=10;a.font="600 "+b+"px sans-serif",a.fillStyle=D,a.fillText(0,0,I),a.fillStyle=E,a.fillText(30,0,I/2+b/2),a.fillStyle=F,a.fillText(60,0,0+b)}function p(a){var b=a.createLinearGradient(0,I,0,0);b.addColorStop(0,D),b.addColorStop(.25,D),b.addColorStop(.5,E),b.addColorStop(1,F),a.strokeStyle=b,a.fillStyle=b}function q(a){for(var b=0;3>b;b++){var c=I/2*b+.5-(2===b?1:0);a.beginPath(),a.moveTo(.5+K,c),a.lineTo(H+.5,c),a.lineWidth=1,a.strokeStyle=C,a.stroke()}}function r(a){var b=null;return"spline"===a?b=t:"dots"===a&&(b=s),b}function s(a,b,c){n(a,b);for(var d=0;d0?c[c.length]:0;a.moveTo(0,d);for(var e=0;e',l(),m()].join(""),X.showFPS&&u(),x()}function w(){var a=l(Z),b=document.getElementById(G+"-text-metrics");b.innerHTML=a}function x(){document.getElementById(G+"-toggle").onclick=function(){var a=document.getElementById(G);a.className.match(" closed")?(a.className=a.className.replace(" closed",""),y("open")):(a.className+=" closed",y("closed"))}}function y(a){window.localStorage&&window.localStorage.setItem(G+"-state",a)}function z(){return window.localStorage?window.localStorage.getItem(G+"-state")||"open":void 0}function A(a){N++,X.showFPS&&(i(a),Q(V,U,S)),null===M?M=a:a-M>3e3&&(M=a,w()),window.requestAnimationFrame(A)}function B(c){O=window.performance.timing,X=a(c),b(X,Z,Y),v(),Q=r(X.chartType),window.requestAnimationFrame(A)}var C="rgb(48, 48, 48)",D="rgb(206, 69, 45)",E="rgb(212, 202, 61)",F="rgb(65, 155, 163)",G="justice",H=300,I=40,J=I/60,K=20,L=H-K,M=0,N=0,O=null,P=null,Q=null,R=0,S=[],T=null,U=null,V=null,W={metrics:{TTFB:{budget:200},domInteractive:{budget:250},domComplete:{budget:800},firstPaint:{budget:1e3},pageLoad:{budget:2e3},requests:{budget:6}},"interface":{position:"fixed",placement:"bottom"},warnThreshold:.8,chartType:"spline",showFPS:!0},X={},Y={pageLoad:{id:G+"-load",label:"Load",unitLabel:"ms",collector:c},firstPaint:{id:G+"-paint",label:"Paint",unitLabel:"ms",collector:f},TTFB:{id:G+"-ttfb",label:"TTFB",unitLabel:"ms",collector:h},domComplete:{id:G+"-complete",label:"Complete",unitLabel:"ms",collector:d},domInteractive:{id:G+"-interactive",label:"Interactive",unitLabel:"ms",collector:e},requests:{id:G+"-requests",label:"Requests",unitLabel:"",collector:g}},Z={};return{init:function(a){"performance"in window&&"timing"in window.performance?"complete"===document.readyState?B(a,"already loaded"):window.onload=function(){B(a)}:console.log("Justice: performance api not supported in this browser, initialization stopped.")}}}();
+"use strict";!function(){var a=".justice{position:fixed;bottom:0;left:0;right:0;background:black;padding:0 10px 10px 10px;box-sizing:border-box;font-size:12px;font-family:monospace;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;z-index:2147483647;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media (min-width: 1235px){.justice{padding-bottom:10px;}}.justice.closed{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%)}.justice .justice-metric-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:wrap;-ms-flex-flow:wrap;flex-flow:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.justice .justice-metric{height:40px;display:inline-block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin:10px 10px 0 0}.justice .justice-metric.chart{width:300px}.justice .justice-title{text-transform:uppercase;padding:3px 0.5em 3px 3px;color:#dfdfdf}.justice .justice-text{color:#dfdfdf;font-weight:600}.justice .justice-text.pass{color:#419ba3}.justice .justice-text.warn{color:#d4ca3d}.justice .justice-text.fail{color:#ce452d}.justice .justice-toggle{width:20px;height:20px;background-color:black;position:absolute;right:0;top:-20px;opacity:0.5;border-top-left-radius:50%;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media only screen and (min-device-pixel-ratio: 1.1){.justice .justice-toggle{width:40px;height:40px;top:-40px;}}.justice .justice-toggle:after{content:'';position:absolute;width:50%;height:50%;border-radius:100%;margin:5px;background-color:#dfdfdf;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media only screen and (min-device-pixel-ratio: 1.1){.justice .justice-toggle:after{margin:10px;}}.justice.closed .justice-toggle{opacity:1}.justice.closed .justice-toggle:after{background-color:#419ba3}",b=document.createElement("style");if(document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet)b.styleSheet.disabled||(b.styleSheet.cssText=a);else try{b.innerHTML=a}catch(c){b.innerText=a}}();var Justice=function(){function a(a){var b={},a=a||{};for(var c in X)b[c]=X[c];for(var c in a)b[c]=a[c];return b}function b(a,b,c){for(var d in a.metrics)b[d]=c[d]}function c(){return P.loadEventStart-P.navigationStart}function d(){return P.domComplete-P.domLoading}function e(){return P.domInteractive-P.domLoading}function f(){var a=0;return window.chrome&&window.chrome.loadTimes?(a=1e3*window.chrome.loadTimes().firstPaintTime,a-=1e3*window.chrome.loadTimes().startLoadTime,a.toFixed(0)):"number"==typeof window.performance.timing.msFirstPaint?(a=window.performance.timing.msFirstPaint,a-=window.performance.timing.navigationStart,a.toFixed(0)):"¯\\_(ツ)_/¯"}function g(){return performance.getEntries?performance.getEntries().length:"¯\\_(ツ)_/¯"}function h(){return P.responseStart-P.connectEnd}function i(a){if(U){var b=(a-U)/1e3,c=1/b,d=Math.floor(c>60?60:c);S=d,T.push([d,d]),T.length>M&&T.shift(),U=a}else U=a}function j(a,b){var c="";return c=a>b?"fail":a>b*Y.warnThreshold?"warn":"pass"}function k(a,b,c){var d=b.collector(),e=j(d,c);return['',''+b.label+": ",''+d+b.unitLabel+"","
"].join("")}function l(a){var b=[];for(var c in $){var d=k(c,$[c],Y.metrics[c].budget);b.push(d)}return''+b.join("")+"
"}function m(){var a=Y.showFPS?['','FPS: ','',"
"].join(""):"";return a}function n(a,b){a.clearRect(0,0,b.width,b.height),q(a),o(a),p(a)}function o(a){var b=10;a.font="600 "+b+"px sans-serif",a.fillStyle=E,a.fillText(0,0,J),a.fillStyle=F,a.fillText(30,0,J/2+b/2),a.fillStyle=G,a.fillText(60,0,0+b)}function p(a){var b=a.createLinearGradient(0,J,0,0);b.addColorStop(0,E),b.addColorStop(.25,E),b.addColorStop(.5,F),b.addColorStop(1,G),a.strokeStyle=b,a.fillStyle=b}function q(a){for(var b=0;3>b;b++){var c=J/2*b+.5-(2===b?1:0);a.beginPath(),a.moveTo(.5+L,c),a.lineTo(I+.5,c),a.lineWidth=1,a.strokeStyle=D,a.stroke()}}function r(a){var b=null;return"spline"===a?b=t:"dots"===a&&(b=s),b}function s(a,b,c){n(a,b);for(var d=0;d0?c[c.length]:0;a.moveTo(0,d);for(var e=0;e',l(),m()].join(""),Y.showFPS&&u(),x()}function w(){var a=l($),b=document.getElementById(H+"-text-metrics");b.innerHTML=a}function x(){document.getElementById(H+"-toggle").onclick=function(){var a=document.getElementById(H);a.className.match(" closed")?(a.className=a.className.replace(" closed",""),y("open")):(a.className+=" closed",y("closed"))}}function y(a){window.localStorage&&window.localStorage.setItem(H+"-state",a)}function z(){return window.localStorage?window.localStorage.getItem(H+"-state")||"open":void 0}function A(a){O++,Y.showFPS&&(i(a),R(W,V,T)),null===N?N=a:a-N>3e3&&(N=a,w()),window.requestAnimationFrame(A)}function B(c){P=window.performance.timing,Y=a(c),b(Y,$,Z),v(),R=r(Y.chartType),window.requestAnimationFrame(A)}var C=C||{};C.theme={"bg-color":"rgb(0, 0, 0)","label-color":"rgb(223, 223, 223)","pass-color":"rgb(65, 155, 163)","warn-color":"rgb(212, 202, 61)","fail-color":"rgb(206, 69, 45)"};var D="rgb(48, 48, 48)",E=C.theme["fail-color"],F=C.theme["warn-color"],G=C.theme["pass-color"],H="justice",I=300,J=40,K=J/60,L=20,M=I-L,N=0,O=0,P=null,Q=null,R=null,S=0,T=[],U=null,V=null,W=null,X={metrics:{TTFB:{budget:200},domInteractive:{budget:250},domComplete:{budget:800},firstPaint:{budget:1e3},pageLoad:{budget:2e3},requests:{budget:6}},"interface":{position:"fixed",placement:"bottom"},warnThreshold:.8,chartType:"spline",showFPS:!0},Y={},Z={pageLoad:{id:H+"-load",label:"Load",unitLabel:"ms",collector:c},firstPaint:{id:H+"-paint",label:"Paint",unitLabel:"ms",collector:f},TTFB:{id:H+"-ttfb",label:"TTFB",unitLabel:"ms",collector:h},domComplete:{id:H+"-complete",label:"Complete",unitLabel:"ms",collector:d},domInteractive:{id:H+"-interactive",label:"Interactive",unitLabel:"ms",collector:e},requests:{id:H+"-requests",label:"Requests",unitLabel:"",collector:g}},$={};return{init:function(a){"performance"in window&&"timing"in window.performance?"complete"===document.readyState?B(a,"already loaded"):window.onload=function(){B(a)}:console.log("Justice: performance api not supported in this browser, initialization stopped.")}}}();
//# sourceMappingURL=justice.mapped.min.js.map
\ No newline at end of file
diff --git a/build/justice.mapped.min.js.map b/build/justice.mapped.min.js.map
index 38ec5e1..781f826 100644
--- a/build/justice.mapped.min.js.map
+++ b/build/justice.mapped.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"justice.mapped.min.js","sources":["../tmp/justice.all.js","../tmp/justice.css.js"],"names":["cssText","styleEl","document","createElement","getElementsByTagName","appendChild","styleSheet","disabled","innerHTML","e","innerText","Justice","mergeOptions","userOpts","mergedOptions","k","defaultOptions","setActiveMetrics","options","activeMetrics","availableMetrics","metrics","getLoadTime","timing","loadEventStart","navigationStart","getDomComplete","domComplete","domLoading","getDomInteractive","domInteractive","getFirstPaint","firstPaint","window","chrome","loadTimes","firstPaintTime","startLoadTime","toFixed","performance","msFirstPaint","getNumRequests","getEntries","length","getTTFB","responseStart","connectEnd","trackFPS","time","dataFpsLastTime","delta","fps","fpsClipped","Math","floor","dataFpsCurrent","dataFpsHistory","push","maxHistory","shift","getMetricRatingClass","metricValue","metricBudget","rating","warnThreshold","getSingleTextMetricHTML","metricKey","metric","budget","collector","ratingClass","prefix","id","label","unitLabel","join","getAllTextMetricsHTML","textMetricsHTML","html","getAllChartMetricsHTML","metricHTML","showFPS","maxHeight","maxWidth","renderChartReset","ctx","canvas","clearRect","width","height","renderChartLines","renderChartLabels","renderChartGradient","fontSize","font","fillStyle","failColor","fillText","warnColor","passColor","grad","createLinearGradient","addColorStop","strokeStyle","i","top","beginPath","moveTo","chartLabelOffset","lineTo","lineWidth","secondaryColor","stroke","getFpsRenderer","chartType","chartRenderer","renderChartSplineType","renderChartDotsType","data","scaledHeight","fpsHeightScale","fillRect","startHeight","left","cacheLookups","domDisplayChartFpsCanvas","getElementById","domDisplayChartFpsCanvasCtx","getContext","renderUI","stateClass","getState","wrap","classList","add","body","attachListeners","renderText","textWrapper","onclick","className","match","replace","setState","state","localStorage","setItem","getItem","tick","tickCount","fpsRenderer","lastTextUpdate","requestAnimationFrame","seriouslyInit","opts","TTFB","pageLoad","requests","interface","position","placement","init","readyState","onload","console","log"],"mappings":"AAAA,cCAC,WAEG,GAAIA,GAAU,irEAIVC,EAAUC,SAASC,cAAc,QAErC,IADAD,SAASE,qBAAqB,QAAQ,GAAGC,YAAYJ,GACjDA,EAAQK,WACHL,EAAQK,WAAWC,WACpBN,EAAQK,WAAWN,QAAUA,OAGjC,KACIC,EAAQO,UAAYR,EACtB,MAAMS,GACJR,EAAQS,UAAYV,KDfhC,IAAIW,SAAU,WA+EZ,QAASC,GAAaC,GACpB,GAAIC,MACAD,EAAWA,KAEf,KAAK,GAAIE,KAAKC,GACZF,EAAcC,GAAKC,EAAeD,EAGpC,KAAK,GAAIA,KAAKF,GACZC,EAAcC,GAAKF,EAASE,EAG9B,OAAOD,GAIT,QAASG,GAAiBC,EAASC,EAAeC,GAChD,IAAK,GAAIL,KAAKG,GAAQG,QACpBF,EAAcJ,GAAKK,EAAiBL,GASxC,QAASO,KACP,MAAOC,GAAOC,eAAiBD,EAAOE,gBAIxC,QAASC,KACP,MAAOH,GAAOI,YAAcJ,EAAOK,WAIrC,QAASC,KACP,MAAON,GAAOO,eAAiBP,EAAOK,WAGxC,QAASG,KACP,GAAIC,GAAa,CACjB,OAAIC,QAAOC,QAAUD,OAAOC,OAAOC,WAEjCH,EAAwD,IAA3CC,OAAOC,OAAOC,YAAYC,eACvCJ,GAAmE,IAAxCC,OAAOC,OAAOC,YAAYE,cAC9CL,EAAWM,QAAQ,IACiC,gBAA3CL,QAAOM,YAAYhB,OAAOiB,cAC1CR,EAAaC,OAAOM,YAAYhB,OAAOiB,aACvCR,GAA0BC,OAAOM,YAAYhB,OAAOE,gBAC7CO,EAAWM,QAAQ,IAEnB,aAIX,QAASG,KAEP,MAAIF,aAAYG,WACPH,YAAY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L,UAAWzB,GACrGjB,aAAoB6C,GAAID,EAAS,YAAiBE,MAAO,WAAeC,UAAW,KAAOL,UAAW3C,GACrGI,gBAAoB0C,GAAID,EAAS,eAAiBE,MAAO,cAAeC,UAAW,KAAOL,UAAWxC,GACrGgI,UAAoBrF,GAAID,EAAS,YAAiBE,MAAO,WAAeC,UAAW,GAAOL,UAAW5B,IAGnGtB,IA+VJ,QACE8I,KAAM,SAASP,GACT,eAAiBzH,SAAU,UAAYA,QAAOM,YACpB,aAAxBrC,SAASgK,WACXT,EAAcC,EAAM,kBAEpBzH,OAAOkI,OAAS,WAAaV,EAAcC,IAG7CU,QAAQC,IAAI"}
\ No newline at end of file
+{"version":3,"file":"justice.mapped.min.js","sources":["../tmp/justice.all.js","../tmp/justice.css.js"],"names":["cssText","styleEl","document","createElement","getElementsByTagName","appendChild","styleSheet","disabled","innerHTML","e","innerText","Justice","mergeOptions","userOpts","mergedOptions","k","defaultOptions","setActiveMetrics","options","activeMetrics","availableMetrics","metrics","getLoadTime","timing","loadEventStart","navigationStart","getDomComplete","domComplete","domLoading","getDomInteractive","domInteractive","getFirstPaint","firstPaint","window","chrome","loadTimes","firstPaintTime","startLoadTime","toFixed","performance","msFirstPaint","getNumRequests","getEntries","length","getTTFB","responseStart","connectEnd","trackFPS","time","dataFpsLastTime","delta","fps","fpsClipped","Math","floor","dataFpsCurrent","dataFpsHistory","push","maxHistory","shift","getMetricRatingClass","metricValue","metricBudget","rating","warnThreshold","getSingleTextMetricHTML","metricKey","metric","budget","collector","ratingClass","prefix","id","label","unitLabel","join","getAllTextMetricsHTML","textMetricsHTML","html","getAllChartMetricsHTML","metricHTML","showFPS","maxHeight","maxWidth","renderChartReset","ctx","canvas","clearRect","width","height","renderChartLines","renderChartLabels","renderChartGradient","fontSize","font","fillStyle","failColor","fillText","warnColor","passColor","grad","createLinearGradient","addColorStop","strokeStyle","i","top","beginPath","moveTo","chartLabelOffset","lineTo","lineWidth","secondaryColor","stroke","getFpsRenderer","chartType","chartRenderer","renderChartSplineType","renderChartDotsType","data","scaledHeight","fpsHeightScale","fillRect","startHeight","left","cacheLookups","domDisplayChartFpsCanvas","getElementById","domDisplayChartFpsCanvasCtx","getContext","renderUI","stateClass","getState","wrap","classList","add","body","attachListeners","renderText","textWrapper","onclick","className","match","replace","setState","state","localStorage","setItem","getItem","tick","tickCount","fpsRenderer","lastTextUpdate","requestAnimationFrame","seriouslyInit","opts","justiceTheme","bg-color","label-color","pass-color","warn-color","fail-color","theme","TTFB","pageLoad","requests","interface","position","placement","init","readyState","onload","console","log"],"mappings":"AAAA,cCAC,WAEG,GAAIA,GAAU,irEAIVC,EAAUC,SAASC,cAAc,QAErC,IADAD,SAASE,qBAAqB,QAAQ,GAAGC,YAAYJ,GACjDA,EAAQK,WACHL,EAAQK,WAAWC,WACpBN,EAAQK,WAAWN,QAAUA,OAGjC,KACIC,EAAQO,UAAYR,EACtB,MAAMS,GACJR,EAAQS,UAAYV,KDfhC,IAAIW,SAAU,WAkFZ,QAASC,GAAaC,GACpB,GAAIC,MACAD,EAAWA,KAEf,KAAK,GAAIE,KAAKC,GACZF,EAAcC,GAAKC,EAAeD,EAGpC,KAAK,GAAIA,KAAKF,GACZC,EAAcC,GAAKF,EAASE,EAG9B,OAAOD,GAIT,QAASG,GAAiBC,EAASC,EAAeC,GAChD,IAAK,GAAIL,KAAKG,GAAQG,QACpBF,EAAcJ,GAAKK,EAAiBL,GASxC,QAASO,KACP,MAAOC,GAAOC,eAAiBD,EAAOE,gBAIxC,QAASC,KACP,MAAOH,GAAOI,YAAcJ,EAAOK,WAIrC,QAASC,KACP,MAAON,GAAOO,eAAiBP,EAAOK,WAGxC,QAASG,KACP,GAAIC,GAAa,CACjB,OAAIC,QAAOC,QAAUD,OAAOC,OAAOC,WAEjCH,EAAwD,IAA3CC,OAAOC,OAAOC,YAAYC,eACvCJ,GAAmE,IAAxCC,OAAOC,OAAOC,YAAYE,cAC9CL,EAAWM,QAAQ,IACiC,gBAA3CL,QAAOM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AAoB/F,OAAQ,KAC5BgG,UAAoBhG,OAAQ,IAG9BiG,aACEC,SAAU,QACVC,UAAW,UAGbvG,cAAe,GACfkD,UAAW,SACXjC,SAAS,GAGP/D,KAIAE,GACF+I,UAAoB3F,GAAID,EAAS,QAAiBE,MAAO,OAAeC,UAAW,KAAOL,UAAW/C,GACrGU,YAAoBwC,GAAID,EAAS,SAAiBE,MAAO,QAAeC,UAAW,KAAOL,UAAWtC,GACrGmI,MAAoB1F,GAAID,EAAS,QAAiBE,MAAO,OAAeC,UAAW,KAAOL,UAAWzB,GACrGjB,aAAoB6C,GAAID,EAAS,YAAiBE,MAAO,WAAeC,UAAW,KAAOL,UAAW3C,GACrGI,gBAAoB0C,GAAID,EAAS,eAAiBE,MAAO,cAAeC,UAAW,KAAOL,UAAWxC,GACrGuI,UAAoB5F,GAAID,EAAS,YAAiBE,MAAO,WAAeC,UAAW,GAAOL,UAAW5B,IAGnGtB,IA+VJ,QACEqJ,KAAM,SAASd,GACT,eAAiBzH,SAAU,UAAYA,QAAOM,YACpB,aAAxBrC,SAASuK,WACXhB,EAAcC,EAAM,kBAEpBzH,OAAOyI,OAAS,WAAajB,EAAcC,IAG7CiB,QAAQC,IAAI"}
\ No newline at end of file
diff --git a/build/justice.min.js b/build/justice.min.js
index 61b9e5e..abcf6e7 100644
--- a/build/justice.min.js
+++ b/build/justice.min.js
@@ -1 +1 @@
-"use strict";!function(){var a=".justice{position:fixed;bottom:0;left:0;right:0;background:black;padding:0 10px 10px 10px;box-sizing:border-box;font-size:12px;font-family:monospace;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;z-index:2147483647;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media (min-width: 1235px){.justice{padding-bottom:10px;}}.justice.closed{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%)}.justice .justice-metric-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:wrap;-ms-flex-flow:wrap;flex-flow:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.justice .justice-metric{height:40px;display:inline-block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin:10px 10px 0 0}.justice .justice-metric.chart{width:300px}.justice .justice-title{text-transform:uppercase;padding:3px 0.5em 3px 3px;color:#dfdfdf}.justice .justice-text{color:#dfdfdf;font-weight:600}.justice .justice-text.pass{color:#419ba3}.justice .justice-text.warn{color:#d4ca3d}.justice .justice-text.fail{color:#ce452d}.justice .justice-toggle{width:20px;height:20px;background-color:black;position:absolute;right:0;top:-20px;opacity:0.5;border-top-left-radius:50%;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media only screen and (min-device-pixel-ratio: 1.1){.justice .justice-toggle{width:40px;height:40px;top:-40px;}}.justice .justice-toggle:after{content:'';position:absolute;width:50%;height:50%;border-radius:100%;margin:5px;background-color:#dfdfdf;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media only screen and (min-device-pixel-ratio: 1.1){.justice .justice-toggle:after{margin:10px;}}.justice.closed .justice-toggle{opacity:1}.justice.closed .justice-toggle:after{background-color:#419ba3}",b=document.createElement("style");if(document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet)b.styleSheet.disabled||(b.styleSheet.cssText=a);else try{b.innerHTML=a}catch(c){b.innerText=a}}();var Justice=function(){function a(a){var b={},a=a||{};for(var c in W)b[c]=W[c];for(var c in a)b[c]=a[c];return b}function b(a,b,c){for(var d in a.metrics)b[d]=c[d]}function c(){return O.loadEventStart-O.navigationStart}function d(){return O.domComplete-O.domLoading}function e(){return O.domInteractive-O.domLoading}function f(){var a=0;return window.chrome&&window.chrome.loadTimes?(a=1e3*window.chrome.loadTimes().firstPaintTime,a-=1e3*window.chrome.loadTimes().startLoadTime,a.toFixed(0)):"number"==typeof window.performance.timing.msFirstPaint?(a=window.performance.timing.msFirstPaint,a-=window.performance.timing.navigationStart,a.toFixed(0)):"¯\\_(ツ)_/¯"}function g(){return performance.getEntries?performance.getEntries().length:"¯\\_(ツ)_/¯"}function h(){return O.responseStart-O.connectEnd}function i(a){if(T){var b=(a-T)/1e3,c=1/b,d=Math.floor(c>60?60:c);R=d,S.push([d,d]),S.length>L&&S.shift(),T=a}else T=a}function j(a,b){var c="";return c=a>b?"fail":a>b*X.warnThreshold?"warn":"pass"}function k(a,b,c){var d=b.collector(),e=j(d,c);return['',''+b.label+": ",''+d+b.unitLabel+"","
"].join("")}function l(a){var b=[];for(var c in Z){var d=k(c,Z[c],X.metrics[c].budget);b.push(d)}return''+b.join("")+"
"}function m(){var a=X.showFPS?['','FPS: ','',"
"].join(""):"";return a}function n(a,b){a.clearRect(0,0,b.width,b.height),q(a),o(a),p(a)}function o(a){var b=10;a.font="600 "+b+"px sans-serif",a.fillStyle=D,a.fillText(0,0,I),a.fillStyle=E,a.fillText(30,0,I/2+b/2),a.fillStyle=F,a.fillText(60,0,0+b)}function p(a){var b=a.createLinearGradient(0,I,0,0);b.addColorStop(0,D),b.addColorStop(.25,D),b.addColorStop(.5,E),b.addColorStop(1,F),a.strokeStyle=b,a.fillStyle=b}function q(a){for(var b=0;3>b;b++){var c=I/2*b+.5-(2===b?1:0);a.beginPath(),a.moveTo(.5+K,c),a.lineTo(H+.5,c),a.lineWidth=1,a.strokeStyle=C,a.stroke()}}function r(a){var b=null;return"spline"===a?b=t:"dots"===a&&(b=s),b}function s(a,b,c){n(a,b);for(var d=0;d0?c[c.length]:0;a.moveTo(0,d);for(var e=0;e',l(),m()].join(""),X.showFPS&&u(),x()}function w(){var a=l(Z),b=document.getElementById(G+"-text-metrics");b.innerHTML=a}function x(){document.getElementById(G+"-toggle").onclick=function(){var a=document.getElementById(G);a.className.match(" closed")?(a.className=a.className.replace(" closed",""),y("open")):(a.className+=" closed",y("closed"))}}function y(a){window.localStorage&&window.localStorage.setItem(G+"-state",a)}function z(){return window.localStorage?window.localStorage.getItem(G+"-state")||"open":void 0}function A(a){N++,X.showFPS&&(i(a),Q(V,U,S)),null===M?M=a:a-M>3e3&&(M=a,w()),window.requestAnimationFrame(A)}function B(c){O=window.performance.timing,X=a(c),b(X,Z,Y),v(),Q=r(X.chartType),window.requestAnimationFrame(A)}var C="rgb(48, 48, 48)",D="rgb(206, 69, 45)",E="rgb(212, 202, 61)",F="rgb(65, 155, 163)",G="justice",H=300,I=40,J=I/60,K=20,L=H-K,M=0,N=0,O=null,P=null,Q=null,R=0,S=[],T=null,U=null,V=null,W={metrics:{TTFB:{budget:200},domInteractive:{budget:250},domComplete:{budget:800},firstPaint:{budget:1e3},pageLoad:{budget:2e3},requests:{budget:6}},"interface":{position:"fixed",placement:"bottom"},warnThreshold:.8,chartType:"spline",showFPS:!0},X={},Y={pageLoad:{id:G+"-load",label:"Load",unitLabel:"ms",collector:c},firstPaint:{id:G+"-paint",label:"Paint",unitLabel:"ms",collector:f},TTFB:{id:G+"-ttfb",label:"TTFB",unitLabel:"ms",collector:h},domComplete:{id:G+"-complete",label:"Complete",unitLabel:"ms",collector:d},domInteractive:{id:G+"-interactive",label:"Interactive",unitLabel:"ms",collector:e},requests:{id:G+"-requests",label:"Requests",unitLabel:"",collector:g}},Z={};return{init:function(a){"performance"in window&&"timing"in window.performance?"complete"===document.readyState?B(a,"already loaded"):window.onload=function(){B(a)}:console.log("Justice: performance api not supported in this browser, initialization stopped.")}}}();
\ No newline at end of file
+"use strict";!function(){var a=".justice{position:fixed;bottom:0;left:0;right:0;background:black;padding:0 10px 10px 10px;box-sizing:border-box;font-size:12px;font-family:monospace;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;z-index:2147483647;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media (min-width: 1235px){.justice{padding-bottom:10px;}}.justice.closed{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%)}.justice .justice-metric-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:wrap;-ms-flex-flow:wrap;flex-flow:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.justice .justice-metric{height:40px;display:inline-block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin:10px 10px 0 0}.justice .justice-metric.chart{width:300px}.justice .justice-title{text-transform:uppercase;padding:3px 0.5em 3px 3px;color:#dfdfdf}.justice .justice-text{color:#dfdfdf;font-weight:600}.justice .justice-text.pass{color:#419ba3}.justice .justice-text.warn{color:#d4ca3d}.justice .justice-text.fail{color:#ce452d}.justice .justice-toggle{width:20px;height:20px;background-color:black;position:absolute;right:0;top:-20px;opacity:0.5;border-top-left-radius:50%;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media only screen and (min-device-pixel-ratio: 1.1){.justice .justice-toggle{width:40px;height:40px;top:-40px;}}.justice .justice-toggle:after{content:'';position:absolute;width:50%;height:50%;border-radius:100%;margin:5px;background-color:#dfdfdf;-webkit-transition:400ms ease-in-out;transition:400ms ease-in-out}@media only screen and (min-device-pixel-ratio: 1.1){.justice .justice-toggle:after{margin:10px;}}.justice.closed .justice-toggle{opacity:1}.justice.closed .justice-toggle:after{background-color:#419ba3}",b=document.createElement("style");if(document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet)b.styleSheet.disabled||(b.styleSheet.cssText=a);else try{b.innerHTML=a}catch(c){b.innerText=a}}();var Justice=function(){function a(a){var b={},a=a||{};for(var c in X)b[c]=X[c];for(var c in a)b[c]=a[c];return b}function b(a,b,c){for(var d in a.metrics)b[d]=c[d]}function c(){return P.loadEventStart-P.navigationStart}function d(){return P.domComplete-P.domLoading}function e(){return P.domInteractive-P.domLoading}function f(){var a=0;return window.chrome&&window.chrome.loadTimes?(a=1e3*window.chrome.loadTimes().firstPaintTime,a-=1e3*window.chrome.loadTimes().startLoadTime,a.toFixed(0)):"number"==typeof window.performance.timing.msFirstPaint?(a=window.performance.timing.msFirstPaint,a-=window.performance.timing.navigationStart,a.toFixed(0)):"¯\\_(ツ)_/¯"}function g(){return performance.getEntries?performance.getEntries().length:"¯\\_(ツ)_/¯"}function h(){return P.responseStart-P.connectEnd}function i(a){if(U){var b=(a-U)/1e3,c=1/b,d=Math.floor(c>60?60:c);S=d,T.push([d,d]),T.length>M&&T.shift(),U=a}else U=a}function j(a,b){var c="";return c=a>b?"fail":a>b*Y.warnThreshold?"warn":"pass"}function k(a,b,c){var d=b.collector(),e=j(d,c);return['',''+b.label+": ",''+d+b.unitLabel+"","
"].join("")}function l(a){var b=[];for(var c in $){var d=k(c,$[c],Y.metrics[c].budget);b.push(d)}return''+b.join("")+"
"}function m(){var a=Y.showFPS?['','FPS: ','',"
"].join(""):"";return a}function n(a,b){a.clearRect(0,0,b.width,b.height),q(a),o(a),p(a)}function o(a){var b=10;a.font="600 "+b+"px sans-serif",a.fillStyle=E,a.fillText(0,0,J),a.fillStyle=F,a.fillText(30,0,J/2+b/2),a.fillStyle=G,a.fillText(60,0,0+b)}function p(a){var b=a.createLinearGradient(0,J,0,0);b.addColorStop(0,E),b.addColorStop(.25,E),b.addColorStop(.5,F),b.addColorStop(1,G),a.strokeStyle=b,a.fillStyle=b}function q(a){for(var b=0;3>b;b++){var c=J/2*b+.5-(2===b?1:0);a.beginPath(),a.moveTo(.5+L,c),a.lineTo(I+.5,c),a.lineWidth=1,a.strokeStyle=D,a.stroke()}}function r(a){var b=null;return"spline"===a?b=t:"dots"===a&&(b=s),b}function s(a,b,c){n(a,b);for(var d=0;d0?c[c.length]:0;a.moveTo(0,d);for(var e=0;e',l(),m()].join(""),Y.showFPS&&u(),x()}function w(){var a=l($),b=document.getElementById(H+"-text-metrics");b.innerHTML=a}function x(){document.getElementById(H+"-toggle").onclick=function(){var a=document.getElementById(H);a.className.match(" closed")?(a.className=a.className.replace(" closed",""),y("open")):(a.className+=" closed",y("closed"))}}function y(a){window.localStorage&&window.localStorage.setItem(H+"-state",a)}function z(){return window.localStorage?window.localStorage.getItem(H+"-state")||"open":void 0}function A(a){O++,Y.showFPS&&(i(a),R(W,V,T)),null===N?N=a:a-N>3e3&&(N=a,w()),window.requestAnimationFrame(A)}function B(c){P=window.performance.timing,Y=a(c),b(Y,$,Z),v(),R=r(Y.chartType),window.requestAnimationFrame(A)}var C=C||{};C.theme={"bg-color":"rgb(0, 0, 0)","label-color":"rgb(223, 223, 223)","pass-color":"rgb(65, 155, 163)","warn-color":"rgb(212, 202, 61)","fail-color":"rgb(206, 69, 45)"};var D="rgb(48, 48, 48)",E=C.theme["fail-color"],F=C.theme["warn-color"],G=C.theme["pass-color"],H="justice",I=300,J=40,K=J/60,L=20,M=I-L,N=0,O=0,P=null,Q=null,R=null,S=0,T=[],U=null,V=null,W=null,X={metrics:{TTFB:{budget:200},domInteractive:{budget:250},domComplete:{budget:800},firstPaint:{budget:1e3},pageLoad:{budget:2e3},requests:{budget:6}},"interface":{position:"fixed",placement:"bottom"},warnThreshold:.8,chartType:"spline",showFPS:!0},Y={},Z={pageLoad:{id:H+"-load",label:"Load",unitLabel:"ms",collector:c},firstPaint:{id:H+"-paint",label:"Paint",unitLabel:"ms",collector:f},TTFB:{id:H+"-ttfb",label:"TTFB",unitLabel:"ms",collector:h},domComplete:{id:H+"-complete",label:"Complete",unitLabel:"ms",collector:d},domInteractive:{id:H+"-interactive",label:"Interactive",unitLabel:"ms",collector:e},requests:{id:H+"-requests",label:"Requests",unitLabel:"",collector:g}},$={};return{init:function(a){"performance"in window&&"timing"in window.performance?"complete"===document.readyState?B(a,"already loaded"):window.onload=function(){B(a)}:console.log("Justice: performance api not supported in this browser, initialization stopped.")}}}();
\ No newline at end of file
diff --git a/package.json b/package.json
old mode 100755
new mode 100644
index 3524936..cf53d6b
--- a/package.json
+++ b/package.json
@@ -16,8 +16,10 @@
"grunt-contrib-watch": "~0.6.1",
"grunt-css2js": "~0.2.4",
"grunt-includes": "~0.4.5",
+ "grunt-json": "^0.1.5",
"grunt-sass": "^0.18.1",
- "grunt-shell": "~1.1.1"
+ "grunt-shell": "~1.1.1",
+ "json-sass": "^1.3.5"
},
"author": "Jason Ormand",
"license": "MIT"
diff --git a/src/js/justice.cache.js b/src/js/justice.cache.js
index 4b5df26..2f5abdf 100755
--- a/src/js/justice.cache.js
+++ b/src/js/justice.cache.js
@@ -1,9 +1,9 @@
// these should all be in a settings hash
var primaryColor = "rgb(241, 250, 195)";
var secondaryColor = "rgb(48, 48, 48)";
-var failColor = "rgb(206, 69, 45)";
-var warnColor = "rgb(212, 202, 61)";
-var passColor = "rgb(65, 155, 163)";
+var failColor = justiceTheme.theme['fail-color'];
+var warnColor = justiceTheme.theme['warn-color'];
+var passColor = justiceTheme.theme['pass-color'];
// need to get a better waying of syncing these values with css
var prefix = "justice";
diff --git a/src/js/justice.js b/src/js/justice.js
index 96e9216..6112a2c 100755
--- a/src/js/justice.js
+++ b/src/js/justice.js
@@ -1,6 +1,7 @@
'use strict';
var Justice = (function() {
+ include "justice.theme.js"
include "justice.cache.js"
include "justice.mungers.js"
include "justice.collectors.js"
diff --git a/src/js/justice.theme.js b/src/js/justice.theme.js
new file mode 100644
index 0000000..372ace5
--- /dev/null
+++ b/src/js/justice.theme.js
@@ -0,0 +1,2 @@
+var justiceTheme = justiceTheme || {};
+justiceTheme["theme"] = { "bg-color": "rgb(0, 0, 0)", "label-color": "rgb(223, 223, 223)", "pass-color": "rgb(65, 155, 163)", "warn-color": "rgb(212, 202, 61)", "fail-color": "rgb(206, 69, 45)"};
\ No newline at end of file
diff --git a/src/scss/justice.scss b/src/scss/justice.scss
index 5d95e9b..87c319e 100755
--- a/src/scss/justice.scss
+++ b/src/scss/justice.scss
@@ -1,10 +1,6 @@
-$prefix: '.justice';
+@import "theme";
-$bg-color: rgb(0, 0, 0);
-$label-color: rgb(223, 223, 223);
-$pass-color: rgb(65, 155, 163);
-$warn-color: rgb(212, 202, 61);
-$fail-color: rgb(206, 69, 45);
+$prefix: '.justice';
$container-padding: 10px;
$metric-height: 40px;
@@ -15,7 +11,7 @@ $metric-width: 150px;
bottom: 0;
left: 0;
right: 0;
- background: $bg-color;
+ background: map-get($theme, 'bg-color');
padding: 0 10px 10px 10px;
box-sizing: border-box;
font-size: 12px;
@@ -55,30 +51,30 @@ $metric-width: 150px;
#{$prefix}-title {
text-transform: uppercase;
padding: 3px 0.5em 3px 3px;
- color: $label-color;
+ color: map-get($theme, label-color);
}
#{$prefix}-text {
- color: $label-color;
+ color: map-get($theme, label-color);
font-weight: 600;
}
#{$prefix}-text.pass {
- color: $pass-color;
+ color: map-get($theme, pass-color);
}
#{$prefix}-text.warn {
- color: $warn-color;
+ color: map-get($theme, warn-color);
}
#{$prefix}-text.fail {
- color: $fail-color;
+ color: map-get($theme, fail-color);
}
#{$prefix}-toggle {
width: 20px;
height: 20px;
- background-color: $bg-color;
+ background-color: map-get($theme, bg-color);
position: absolute;
right: 0;
top: -20px;
@@ -99,7 +95,7 @@ $metric-width: 150px;
height: 50%;
border-radius: 100%;
margin: 5px;
- background-color: $label-color;
+ background-color: map-get($theme, label-color);
transition: 400ms ease-in-out;
@@ -114,7 +110,7 @@ $metric-width: 150px;
opacity: 1;
&:after {
- background-color: $pass-color;
+ background-color: map-get($theme, pass-color);
}
}
}
diff --git a/src/scss/theme.scss b/src/scss/theme.scss
new file mode 100644
index 0000000..ba3bce3
--- /dev/null
+++ b/src/scss/theme.scss
@@ -0,0 +1,7 @@
+$theme: (
+ bg-color: rgb(0, 0, 0),
+ label-color: rgb(223, 223, 223),
+ pass-color: rgb(65, 155, 163),
+ warn-color: rgb(212, 202, 61),
+ fail-color: rgb(206, 69, 45)
+);
\ No newline at end of file
diff --git a/src/theme.json b/src/theme.json
new file mode 100644
index 0000000..023feb5
--- /dev/null
+++ b/src/theme.json
@@ -0,0 +1,7 @@
+{
+ "bg-color": "rgb(0, 0, 0)",
+ "label-color": "rgb(223, 223, 223)",
+ "pass-color": "rgb(65, 155, 163)",
+ "warn-color": "rgb(212, 202, 61)",
+ "fail-color": "rgb(206, 69, 45)"
+}
\ No newline at end of file