Created
October 6, 2020 16:37
-
-
Save loleg/a105f16cf7a8e1d9473e712a8abc1faf to your computer and use it in GitHub Desktop.
Light mode for Corona-Data.ch (Greasemonkey script)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Corona-Data.ch Light edition | |
// @description This adjusts the theme of the Swiss Covid-19 data visualization by Daniel Probst | |
// @version 0.0.1 | |
// @grant GM.xmlhttpRequest | |
// @grant GM.addStyle | |
// @include https://www.corona-data.ch/* | |
// @include https://corona-data.ch/* | |
// ==/UserScript== | |
/* Work in Progress .... | |
IDEA: adjust colors depending on the data | |
..... | |
(async ()=>{ | |
GM.xmlHttpRequest({ | |
method: "GET", | |
url: "https://data.corona-api.org/v1/countries", | |
data: { 'country': 'CHE' }, | |
onload: function(response) { | |
alert(response.responseText); | |
var j = JSON.parse(response.responseText); | |
console.log(j); | |
}, | |
onerror: function(reponse) { | |
console.log('Error in xmlHttpRequest', response); | |
} | |
}); | |
})(); | |
*/ | |
GM.addStyle(` | |
body { | |
background-color: #eee; | |
} | |
#main { | |
background-color: #fff; | |
color: black; | |
} | |
#date-container, .total-title, .update-title, .plot-title { | |
background-color: #eee; | |
} | |
.total-container, .update-container, .info-container { | |
background-color: #f6f6f6; | |
} | |
.update-container .update-content span, .plot-settings-container { | |
background-color: #ccc; | |
} | |
a, .total-container .total-content { | |
color: #900; | |
} | |
`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment