diff --git a/_sass/_custom.scss b/_sass/_custom.scss index 0e2a08b..6653bb2 100644 --- a/_sass/_custom.scss +++ b/_sass/_custom.scss @@ -209,7 +209,7 @@ body{ .download-item { background-color: white; - color: 44A886; + color: #44A886; font-size: 0.9em; font-family: 'Open Sans', Helvetica, Arial, sans-serif; border: 2px solid #53b985; @@ -294,11 +294,51 @@ body{ margin: 0px !important; } +.map-clipboard-button { + width: 100%; + height: 50px; + font-size: 14px; + line-height: 20px; + border-radius: 0 0 3px 3px; + border: none; + background-color: #44A886; + color: white; + font-weight: bold; + display: flex; + display: -webkit-flex; /* Safari */ + flex-direction: row; + -webkit-flex-direction: row; + align-items: center; + justify-content: center; +} + +.map-clipboard-button:hover { + cursor: pointer; + background-color: #59C39F; +} + +.map-clipboard-img { + height: 15px; + width: 15px; + margin: 0px !important; + margin-right: 7px !important; +} + #country, #city { display: none; padding: 0px 0px !important; } -#basic, #streets { +#basic, #streets, #dark, #light { display: none; } + +.gist-meta { + display: none; +} + +.gist-file { + margin-bottom: 0 !important; + border-bottom: 0 !important; + border-radius: 0 !important; +} diff --git a/downloads.md b/downloads.md index e280fd2..c34c05c 100644 --- a/downloads.md +++ b/downloads.md @@ -51,7 +51,7 @@ the [Open Database License](https://tldrlegal.com/license/odc-open-database-lice
@@ -65,7 +65,7 @@ the [Open Database License](https://tldrlegal.com/license/odc-open-database-lice
diff --git a/img/clippy.svg b/img/clipboard-black.svg similarity index 100% rename from img/clippy.svg rename to img/clipboard-black.svg diff --git a/img/clipboard-white.svg b/img/clipboard-white.svg new file mode 100644 index 0000000..0385241 --- /dev/null +++ b/img/clipboard-white.svg @@ -0,0 +1,3 @@ + + + diff --git a/js/index.js b/js/index.js index 4a17378..cd10909 100644 --- a/js/index.js +++ b/js/index.js @@ -59,7 +59,7 @@ function init() { var country = document.querySelector('#country'); if(country) { - var template = '
{{ title }}
{{ size }}
'; + var template = '
{{ title }}
{{ size }}
'; Mustache.parse(template); d3.tsv("https://raw.githubusercontent.com/osm2vectortiles/osm2vectortiles/master/src/create-extracts/country_extracts.tsv", function(error, data) { if (error) throw error; @@ -97,7 +97,7 @@ function init() { var city = document.querySelector('#city'); if(city) { - var template = '
{{ title }}
{{ size }}
'; + var template = '
{{ title }}
{{ size }}
'; Mustache.parse(template); d3.tsv("https://raw.githubusercontent.com/osm2vectortiles/osm2vectortiles/master/src/create-extracts/city_extracts.tsv", function(error, data) { if (error) throw error; @@ -116,7 +116,7 @@ function init() { }); } - // instantiate clipboard + // instantiate download clipboard new Clipboard('.clipboard-button'); } window.onload = init; diff --git a/maps/index.md b/maps/index.md index b506e86..69f0b36 100644 --- a/maps/index.md +++ b/maps/index.md @@ -30,6 +30,7 @@ published: true zoom: 11 }).addControl(new mapboxgl.Navigation()); vectorMap.scrollZoom.disable(); + var selectedStyle = 0; } var bright = document.getElementById("vector-bright"); @@ -42,6 +43,7 @@ published: true document.querySelector("#streets").style.display = "none"; document.querySelector("#dark").style.display = "none"; document.querySelector("#light").style.display = "none"; + selectedStyle = 0; } var basic = document.getElementById("vector-basic"); basic.onclick = function(e) { @@ -53,6 +55,7 @@ published: true document.querySelector("#streets").style.display = "none"; document.querySelector("#dark").style.display = "none"; document.querySelector("#light").style.display = "none"; + selectedStyle = 1; } var streets = document.getElementById("vector-streets"); streets.onclick = function(e) { @@ -64,6 +67,7 @@ published: true document.querySelector("#streets").style.display = "block"; document.querySelector("#dark").style.display = "none"; document.querySelector("#light").style.display = "none"; + selectedStyle = 2; } var dark = document.getElementById("vector-dark"); dark.onclick = function(e) { @@ -75,6 +79,7 @@ published: true document.querySelector("#streets").style.display = "none"; document.querySelector("#dark").style.display = "block"; document.querySelector("#light").style.display = "none"; + selectedStyle = 3; } var light = document.getElementById("vector-light"); light.onclick = function(e) { @@ -86,7 +91,14 @@ published: true document.querySelector("#streets").style.display = "none"; document.querySelector("#dark").style.display = "none"; document.querySelector("#light").style.display = "block"; + selectedStyle = 4; } + // instantiate map clipboard + new Clipboard('.map-clipboard-button', { + text: function(trigger) { + return document.getElementsByClassName("gist-data")[selectedStyle].innerText; + } + });
@@ -105,3 +117,9 @@ published: true
+
+ +