From 744f2ae921d21f20736ec8aa459d05cc1cc296eb Mon Sep 17 00:00:00 2001 From: Jason Long Date: Mon, 31 Mar 2014 08:52:21 -0400 Subject: [PATCH] ignore zip files --- .gitignore | 1 + chrome/iso.js | 36 +++++++++++++++++++++--------------- chrome/manifest.json | 2 +- 3 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a21be10 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +chrome.zip diff --git a/chrome/iso.js b/chrome/iso.js index c346aa0..56dd406 100644 --- a/chrome/iso.js +++ b/chrome/iso.js @@ -71,13 +71,6 @@ function renderIsometricChart() { var point = new obelisk.Point(87, 100); var pixelView = new obelisk.PixelView(canvas, point); - var color; - var color0 = new obelisk.CubeColor().getByHorizontalColor(0xeeeeee); - var color1 = new obelisk.CubeColor().getByHorizontalColor(0xd6e685); - var color2 = new obelisk.CubeColor().getByHorizontalColor(0x8cc665); - var color3 = new obelisk.CubeColor().getByHorizontalColor(0x44a340); - var color4 = new obelisk.CubeColor().getByHorizontalColor(0x1e6823); - var maxContributions = $('.js-calendar-graph').data("max-contributions"); var contribCount; @@ -91,14 +84,9 @@ function renderIsometricChart() { var dimension = new obelisk.CubeDimension(SIZE, SIZE, parseInt(MAX_HEIGHT/maxContributions * contribCount) + 3); - if (style == 'fill: rgb(238, 238, 238);') color = color0; - else if (style == 'fill: rgb(214, 230, 133);') color = color1; - else if (style == 'fill: rgb(140, 198, 101);') color = color2; - else if (style == 'fill: rgb(68, 163, 64);') color = color3; - else if (style == 'fill: rgb(30, 104, 35);') color = color4; - - var cube = new obelisk.Cube(dimension, color, false); - var p3d = new obelisk.Point3D(SIZE * x, SIZE * y, 0); + var color = getSquareColor(style); + var cube = new obelisk.Cube(dimension, color, false); + var p3d = new obelisk.Point3D(SIZE * x, SIZE * y, 0); pixelView.renderObject(cube, p3d); }); }); @@ -185,3 +173,21 @@ function loadStats() { $('
Longest streak' + countLongest + 'days' + datesLongest + 'Current streak' + countCurrent + 'days' + datesCurrent + '
').appendTo($('.ic-contributions-wrapper')); } + +function getSquareColor(style) { + var color; + var color0 = new obelisk.CubeColor().getByHorizontalColor(0xeeeeee); + var color1 = new obelisk.CubeColor().getByHorizontalColor(0xd6e685); + var color2 = new obelisk.CubeColor().getByHorizontalColor(0x8cc665); + var color3 = new obelisk.CubeColor().getByHorizontalColor(0x44a340); + var color4 = new obelisk.CubeColor().getByHorizontalColor(0x1e6823); + + if (style == 'fill: rgb(238, 238, 238);' || style == 'fill: #eeeeee;') color = color0; + else if (style == 'fill: rgb(214, 230, 133);' || style == 'fill: #d6e685;') color = color1; + else if (style == 'fill: rgb(140, 198, 101);' || style == 'fill: #8cc665;') color = color2; + else if (style == 'fill: rgb(68, 163, 64);' || style == 'fill: #44a340;') color = color3; + else if (style == 'fill: rgb(30, 104, 35);' || style == 'fill: #1e6823;') color = color4; + + return color; +} + diff --git a/chrome/manifest.json b/chrome/manifest.json index 0045d16..8bfd6f8 100644 --- a/chrome/manifest.json +++ b/chrome/manifest.json @@ -1,6 +1,6 @@ { "name": "Isometric Contributions", - "version": "0.8", + "version": "0.8.1", "description": "Renders an isometric pixel view of GitHub contribution graphs.", "content_scripts": [ { "css": [ "iso.css" ],