Skip to content

Commit

Permalink
Bright mode (#1459)
Browse files Browse the repository at this point in the history
* first steps light reskin

* ui work

* first revision color and UI changes

* new arrows test

* overflow side panel fix, searchbar background

* left-panel adjustments

* fixed collapsed box shadow on left panel

* added brightmode tooltip

* layer button toggle animation

* added inverse color toggle watermark and logo

* initial onboarding changes

* tooltip style update

* new tooltip on countryhover

* new arrow design finished

* timeslider style and brightmode corrections

* wip, oceancolor

* reverted package-lock

* fixed backgorund bug, introduced new mapbox layer background

* fixed loading bug

* no data overlay style fixes

* logo svg fix, ui and mobile ui fixes

* loading animation gif

* removed live from mobile view

* changed onboarding images

* social button fix & meta image added

* twitter og image replace

* social link watermark fix

* slider style changes

* fixed colorblind bug

* commented out unused arrow outline step and reverted to original

* hardcoded onboarding title electricitymap and removed field from translations

* removed unused ms icon

* code cleanup

* slight colorchange darkmode, removed watermark social icons

* data temporary unavailable style fix

* replaced catamaran with Open Sans

* typo Font css

* bottom section style change

* fixed gauge errors

* outline slider thumb + mobile legend padidng

* removed manuallyselected state from timeslider

* social handles updates

* removed unused image, cleaned up scales.js

* mobile info line height fix
  • Loading branch information
ovbm authored and corradio committed Jun 27, 2018
1 parent 926ee62 commit fc0308d
Show file tree
Hide file tree
Showing 103 changed files with 923 additions and 417 deletions.
2 changes: 1 addition & 1 deletion mockserver/update_state.py
Expand Up @@ -112,7 +112,7 @@
# Update production
production['datetime'] = arrow.get(production['datetime']).isoformat()
# Set random co2 value
production['co2intensity'] = random() * 500
production['co2intensity'] = random() * 800
# Set aggregates
production['maxProduction'] = max([x or 0 for x in production['production'].values()])
production['totalProduction'] = sum([x or 0 for x in production['production'].values()])
Expand Down
57 changes: 33 additions & 24 deletions web/generate-arrows.js
@@ -1,18 +1,27 @@
// Requires `brew install imagemagick`
// import themes from './helpers/themes'

const child_process = require('child_process');
const fs = require('fs');
const d3 = require('d3');
const d3 = Object.assign(
{},
require('d3-array'),
require('d3-collection'),
require('d3-scale'),
);

const { themes } = require('./src/helpers/themes');

const numTicks = 11;
const co2color = d3.scaleLinear()
.domain([0, 375, 725, 800])
.range(['green', 'orange', 'rgb(26,13,0)']);
.domain(themes.dark.co2Scale.steps)
.range(themes.dark.co2Scale.colors);
const keys = d3.range(0, 800 + 80, 80);
const colors = {};
keys.forEach((k) => { colors[k] = co2color(k) });
colors['nan'] = '#A9A9A9';

for(let co2value in colors) {
for (let co2value in colors) {
// generate specific color
console.log([
'public/images/arrow-template.png',
Expand All @@ -29,29 +38,29 @@ for(let co2value in colors) {
return;
}

// make an outline
const outlineSize = 2;
const whiteArrowAfterCo2Intensity = 640;
child_process.spawn('convert', [
`public/images/arrow-${co2value}.png`,
'-bordercolor', 'none',
'-border', outlineSize,
'\(', '-clone', '0', '-alpha', 'off', '-fill', co2value >= whiteArrowAfterCo2Intensity ? 'white' : 'black', '-colorize', '100%', '\)',
'\(', '-clone', '0', '-alpha', 'extract', '-morphology', 'edgeout', 'octagon:'+outlineSize, '\)',
'-compose', 'over',
'-composite', `public/images/arrow-${co2value}-outline.png`
]).on('close', code => {
if(code !== 0) {
console.log('child exited with code', code);
return;
}
// make an outline (NOT being currently used with new arrow shape)
// const outlineSize = 2;
// const whiteArrowAfterCo2Intensity = 640;
// child_process.spawn('convert', [
// `public/images/arrow-${co2value}.png`,
// '-bordercolor', 'none',
// '-border', outlineSize,
// '\(', '-clone', '0', '-alpha', 'off', '-fill', co2value >= whiteArrowAfterCo2Intensity ? 'white' : 'black', '-colorize', '100%', '\)',
// '\(', '-clone', '0', '-alpha', 'extract', '-morphology', 'edgeout', 'octagon:'+outlineSize, '\)',
// '-compose', 'over',
// '-composite', `public/images/arrow-${co2value}-outline.png`
// ]).on('close', code => {
// if(code !== 0) {
// console.log('child exited with code', code);
// return;
// }

// Apply highlight and generate GIF
[10, 6, 2].forEach((speed, index) => {
const args = [
'-dispose', 'none',
'-delay', '0',
`public/images/arrow-${co2value}-outline.png`,
`public/images/arrow-${co2value}.png`,
'-dispose', 'previous',
'-delay', `${speed}`,
'-loop', '0',
Expand All @@ -70,14 +79,14 @@ for(let co2value in colors) {

fs.unlink(`public/images/arrow-${co2value}.png`, () => {});
fs.unlink(`public/images/arrow-${co2value}-outline.png`, () => {});
})
});

child.stderr.on('data', (data) => {
console.log('stderr:', data);
});
});
})
});
});
// });
}
// echo $color;
// #convert demo-arrow.png +level-colors transparent,"$color" mod-arrow.png
Expand Down
1 change: 0 additions & 1 deletion web/locales/de.json
Expand Up @@ -13,7 +13,6 @@
},
"onboarding-modal": {
"view1": {
"header": "Electricity Map",
"subtitle": "Visualisierung der klimarelevanten Emissionen der Stromerzeugung"
},
"view2": {
Expand Down
1 change: 0 additions & 1 deletion web/locales/en.json
Expand Up @@ -8,7 +8,6 @@
},
"onboarding-modal": {
"view1": {
"header": "The Electricity Map",
"subtitle": "Mapping the climate impact of electricity"
},
"view2": {
Expand Down
1 change: 0 additions & 1 deletion web/locales/pl.json
Expand Up @@ -8,7 +8,6 @@
},
"onboarding-modal": {
"view1": {
"header": "Electricity Map",
"subtitle": "Obrazujemy wpływ produkcji energii elektrycznej na klimat"
},
"view2": {
Expand Down
1 change: 0 additions & 1 deletion web/locales/sv.json
Expand Up @@ -8,7 +8,6 @@
},
"onboarding-modal": {
"view1": {
"header": "Electricity Map",
"subtitle": "Kartlägger klimatpåverkan från elkonsumtion"
},
"view2": {
Expand Down
6 changes: 0 additions & 6 deletions web/public/css/CatamaranFont.css

This file was deleted.

17 changes: 17 additions & 0 deletions web/public/css/OpenSansFont.css
@@ -0,0 +1,17 @@
@font-face {
font-family: 'Open Sans';
src: local('OpenSans'),
local('Open Sans'),
local('OpenSans-Regular'),
url(../fonts/OpenSans-Regular.ttf) format('truetype');
font-weight: normal;
}

@font-face {
font-family: 'Open Sans';
src: local('OpenSans Bold'),
local('Open Sans Bold'),
local('OpenSans-Bold'),
url(../fonts/OpenSans-Bold.ttf) format('truetype');
font-weight: bold;
}
Binary file removed web/public/fonts/Catamaran-Regular.ttf
Binary file not shown.
Binary file added web/public/fonts/OpenSans-Bold.ttf
Binary file not shown.
Binary file added web/public/fonts/OpenSans-Regular.ttf
Binary file not shown.
Binary file modified web/public/images/arrow-0-animated-0.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-0-animated-1.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-0-animated-2.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-160-animated-0.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-160-animated-1.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-160-animated-2.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-240-animated-0.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-240-animated-1.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-240-animated-2.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-320-animated-0.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-320-animated-1.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-320-animated-2.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-400-animated-0.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-400-animated-1.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-400-animated-2.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-480-animated-0.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-480-animated-1.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-480-animated-2.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-560-animated-0.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-560-animated-1.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-560-animated-2.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-640-animated-0.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-640-animated-1.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-640-animated-2.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-720-animated-0.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/public/images/arrow-720-animated-1.gif
Binary file modified web/public/images/arrow-720-animated-2.gif
Binary file modified web/public/images/arrow-80-animated-0.gif
Binary file modified web/public/images/arrow-80-animated-1.gif
Binary file modified web/public/images/arrow-80-animated-2.gif
Binary file modified web/public/images/arrow-800-animated-0.gif
Binary file modified web/public/images/arrow-800-animated-1.gif
Binary file modified web/public/images/arrow-800-animated-2.gif
Binary file modified web/public/images/arrow-highlights/10.png
Binary file modified web/public/images/arrow-highlights/15.png
Binary file modified web/public/images/arrow-highlights/20.png
Binary file modified web/public/images/arrow-highlights/25.png
Binary file modified web/public/images/arrow-highlights/27.png
Binary file modified web/public/images/arrow-highlights/30.png
Binary file modified web/public/images/arrow-highlights/35.png
Binary file modified web/public/images/arrow-highlights/40.png
Binary file modified web/public/images/arrow-highlights/45.png
Binary file modified web/public/images/arrow-highlights/50.png
Binary file modified web/public/images/arrow-highlights/55.png
Binary file modified web/public/images/arrow-highlights/60.png
Binary file modified web/public/images/arrow-highlights/65.png
Binary file modified web/public/images/arrow-highlights/70.png
Binary file modified web/public/images/arrow-highlights/75.png
Binary file modified web/public/images/arrow-highlights/80.png
Binary file modified web/public/images/arrow-highlights/85.png
Binary file modified web/public/images/arrow-highlights/90.png
Binary file modified web/public/images/arrow-highlights/95.png
Binary file modified web/public/images/arrow-highlights/97.png
Binary file modified web/public/images/arrow-highlights/99.png
Binary file modified web/public/images/arrow-highlights/highlight-template.psd
Diff not rendered.
Binary file modified web/public/images/arrow-nan-animated-0.gif
Binary file modified web/public/images/arrow-nan-animated-1.gif
Binary file modified web/public/images/arrow-nan-animated-2.gif
Binary file added web/public/images/arrow-new.sketch
Binary file not shown.
Binary file modified web/public/images/arrow-template.png
13 changes: 13 additions & 0 deletions web/public/images/brightmode.svg
13 changes: 13 additions & 0 deletions web/public/images/brightmode_active.svg
File renamed without changes

0 comments on commit fc0308d

Please sign in to comment.