Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Light mode for Corona-Data.ch (Greasemonkey script)
// ==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