Built with blockbuilder.org
Last active
January 18, 2018 20:41
-
-
Save mukhtyar/c14c1512e553d12a8eb0b348c01206d3 to your computer and use it in GitHub Desktop.
SVG Icons
This file contains 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
license: mit |
This file contains 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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<style> | |
.container, .container-new { | |
width: 100%; | |
height: 100%; | |
margin: 1rem; | |
background-color: #fafafa; | |
display: flex; | |
flex-direction: row; | |
flex-wrap: wrap; | |
justify-content: center; | |
} | |
.icon { | |
flex: 0 1 20%; | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
} | |
svg { | |
width: 50%; | |
height: 50%; | |
} | |
</style> | |
</head> | |
<body> | |
<h3>Existing Topic Icons</h3> | |
<div class="container"> | |
</div> | |
<h3>Options for New Topic Icons</h3> | |
<div class="container equity"></div> | |
<div class="container financing"></div> | |
<div class="container tribal"></div> | |
<script> | |
var existingIcons = [ | |
{ | |
color: '#479c6b', | |
topic: 'agriculture' | |
}, | |
{ | |
color: '#3c5882', | |
topic: 'biodiversity-and-habitat' | |
}, | |
{ | |
color: '#809530', | |
topic: 'parks-recreation-and-historic-and-cultural' | |
}, | |
{ | |
color: '#a73f3b', | |
topic: 'emergency-management' | |
}, | |
{ | |
color: '#ce8a34', | |
topic: 'energy' | |
}, | |
{ | |
color: '#1d6440', | |
topic: 'forestry' | |
}, | |
{ | |
color: '#815a54', | |
topic: 'land-use-and-community-development' | |
}, | |
{ | |
color: '#009290', | |
topic: 'ocean-and-coast' | |
}, | |
{ | |
color: '#bc3a6d', | |
topic: 'public-health' | |
}, | |
{ | |
color: '#7f5a79', | |
topic: 'transportation' | |
}, | |
{ | |
color: '#138db8', | |
topic: 'water' | |
} | |
]; | |
var equityIcons = [ | |
{ | |
color: '#479c6b', | |
topic: 'equity-and-environmental-justice1' | |
}, | |
{ | |
color: '#3c5882', | |
topic: 'equity-and-environmental-justice2' | |
}, | |
]; | |
var financingIcons = [ | |
{ | |
color: '#809530', | |
topic: 'financing1' | |
}, | |
{ | |
color: '#a73f3b', | |
topic: 'financing2' | |
}, | |
{ | |
color: '#a73f3b', | |
topic: 'financing3' | |
}, | |
]; | |
var tribalIcons = [ | |
{ | |
color: '#1d6440', | |
topic: 'tribal-and-indigenous-communities1' | |
}, | |
{ | |
color: '#1d6440', | |
topic: 'tribal-and-indigenous-communities2' | |
}, | |
]; | |
function loadSvgFile(filename, className) { | |
d3.xml(filename).mimeType('image/svg+xml').get(function(error, xml) { | |
if (error) throw error; | |
var icon = d3.select('.' + className) | |
.append('div') | |
.classed('icon', true) | |
.node(); | |
icon.appendChild(xml.documentElement); | |
var span = document.createElement('span'); | |
var topic = filename.split('.')[0]; | |
span.innerHTML = topic.split('topic-')[1]; | |
icon.appendChild(span) | |
}); | |
} | |
existingIcons.forEach(function(item){ | |
loadSvgFile('topic-' + item.topic + '.svg', 'container'); | |
}); | |
equityIcons.forEach(function(item){ | |
loadSvgFile('topic-' + item.topic + '.svg', 'equity'); | |
}); | |
financingIcons.forEach(function(item){ | |
loadSvgFile('topic-' + item.topic + '.svg', 'financing'); | |
}); | |
tribalIcons.forEach(function(item){ | |
loadSvgFile('topic-' + item.topic + '.svg', 'tribal'); | |
}); | |
</script> | |
</body> |
This file contains 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
<svg | |
xmlns="http://www.w3.org/2000/svg" | |
version="1.1" | |
viewBox="0 0 120 120"> | |
<circle | |
class="circle__filled" | |
fill="#bc3a6d" | |
stroke="none" | |
stroke-width="0" | |
r="55" | |
cy="60" | |
cx="60" /> | |
<g> | |
<path | |
d="m 30.50802,77.06 0,11.865 c 0,1.406 1.186,2.552 2.643,2.552 0.537,0 1.069,-0.16 1.499,-0.451 l 0.939,-0.64 0.943,0.638 c 0.435,0.296 0.951,0.453 1.491,0.453 1.455,0 2.642,-1.146 2.642,-2.552 l 0,-11.865 6.374,0 -3.358,-6.323 0.372,-0.719 c 0.653,-1.265 0.999,-2.68 0.999,-4.096 l 0,-9.288 c 0,-5.05 -4.245,-9.157 -9.462,-9.157 -5.223,0 -9.473,4.107 -9.473,9.157 l 0,9.288 c 0,1.416 0.347,2.831 1.005,4.095 l 0.376,0.72 -3.361,6.323 6.371,0 z m 5.082,-42.716 c -2.68,0 -4.861,2.106 -4.861,4.694 0,2.59 2.182,4.699 4.861,4.699 2.674,0 4.851,-2.109 4.851,-4.699 -0.001,-2.588 -2.177,-4.694 -4.851,-4.694 m -14.743,41.968 2.988,-5.62 c -0.655,-1.503 -0.998,-3.136 -0.998,-4.77 l 0,-9.288 c 0,-5.112 3.236,-9.504 7.83,-11.37 -1.941,-1.441 -3.216,-3.683 -3.216,-6.227 0,-4.337 3.65,-7.867 8.139,-7.867 4.482,0 8.129,3.53 8.129,7.867 0,2.544 -1.272,4.786 -3.211,6.225 4.59,1.868 7.823,6.26 7.823,11.372 l 0,9.288 c 0,1.631 -0.341,3.263 -0.99,4.765 l 2.991,5.63 c 0.434,0.827 0.396,1.833 -0.105,2.634 -0.513,0.804 -1.4,1.283 -2.374,1.283 l -3.908,0 0,8.691 c 0,3.155 -2.657,5.725 -5.921,5.725 -0.85,0 -1.676,-0.174 -2.434,-0.507 -0.759,0.333 -1.586,0.507 -2.439,0.507 -3.265,0 -5.922,-2.569 -5.922,-5.725 l 0,-8.691 -3.904,0 c -0.981,0 -1.868,-0.484 -2.359,-1.271 -0.518,-0.792 -0.562,-1.807 -0.119,-2.651 m 34.581,-0.91 c 0,1.703 0.808,3.273 2.213,4.307 l 0.648,0.476 0,10.187 c 10e-4,0.84 1.098,1.381 1.791,0.91 l 0.938,-0.632 0.938,0.63 c 0.703,0.473 1.797,-0.068 1.797,-0.908 l 0,-10.186 0.646,-0.475 c 1.385,-1.025 2.213,-2.635 2.213,-4.309 l 0,-6.046 c 0,-2.979 -2.51,-5.404 -5.593,-5.404 -3.082,0 -5.591,2.425 -5.591,5.404 l 0,6.046 z m 5.591,-21.068 c -1.424,0 -2.584,1.122 -2.584,2.5 0,1.38 1.16,2.503 2.584,2.503 1.426,0 2.585,-1.123 2.585,-2.503 0,-1.378 -1.16,-2.5 -2.585,-2.5 m -3.403,7.106 c -1.485,-1.032 -2.462,-2.707 -2.462,-4.605 0,-3.129 2.63,-5.673 5.864,-5.673 3.233,0 5.866,2.544 5.866,5.673 0,1.898 -0.978,3.573 -2.463,4.604 3.206,1.293 5.471,4.354 5.471,7.917 l 0,6.046 c 0,2.385 -1.057,4.688 -2.859,6.306 l 0,8.663 c 0,2.359 -1.985,4.279 -4.424,4.279 -0.55,0 -1.088,-0.096 -1.589,-0.284 -0.503,0.188 -1.04,0.284 -1.589,0.284 -2.438,0 -4.424,-1.92 -4.424,-4.279 l 0,-8.66 c -1.826,-1.621 -2.859,-3.878 -2.859,-6.309 l 0,-6.046 c 0,-3.563 2.261,-6.624 5.468,-7.916 m 17.394,4.332 c 0,2.905 1.373,5.581 3.771,7.342 l 0.646,0.478 0,15.311 c 0,1.419 1.194,2.574 2.659,2.574 0.548,0 1.071,-0.157 1.512,-0.454 l 0.94,-0.637 0.939,0.637 c 0.44,0.297 0.966,0.454 1.517,0.454 1.467,0 2.662,-1.155 2.662,-2.574 l 0,-15.31 0.645,-0.476 c 2.36,-1.743 3.77,-4.488 3.77,-7.345 l 0,-9.343 c 0,-5.081 -4.277,-9.213 -9.532,-9.213 -5.254,0 -9.529,4.132 -9.529,9.213 l 0,9.343 z m 9.529,-31.764 c -2.693,0 -4.886,2.121 -4.886,4.727 0,2.611 2.192,4.734 4.886,4.734 2.694,0 4.885,-2.123 4.885,-4.734 0,-2.606 -2.192,-4.727 -4.885,-4.727 m -4.924,10.993 c -1.955,-1.446 -3.241,-3.703 -3.241,-6.266 0,-4.357 3.662,-7.901 8.165,-7.901 4.503,0 8.165,3.544 8.165,7.901 0,2.563 -1.284,4.82 -3.241,6.266 4.628,1.87 7.888,6.286 7.888,11.429 l 0,9.343 c 0,3.57 -1.637,7.012 -4.415,9.357 l 0,13.772 c 0,3.17 -2.664,5.748 -5.94,5.748 -0.858,0 -1.693,-0.176 -2.456,-0.51 -0.764,0.334 -1.595,0.51 -2.452,0.51 -3.274,0 -5.937,-2.578 -5.937,-5.748 l 0,-13.768 c -2.818,-2.357 -4.42,-5.727 -4.42,-9.362 l 0,-9.343 c -0.001,-5.142 3.259,-9.558 7.884,-11.428" | |
stroke="none" | |
fill="#ffffff" | |
class="path__filled" /> | |
<path | |
d="m 534.693,285.448 -8.425,0 0,-7.441 -7.724,0 0,-8.118 7.724,0 0,-7.441 8.425,0 0,7.441 7.725,0 0,8.118 -7.725,0 z" | |
style="fill:none;stroke:#ffffff;stroke-width:2.5" | |
transform="translate(-471.62162,-248.64865)" /> | |
</g> | |
<circle | |
class="circle__outline" | |
fill="none" | |
stroke="#ffffff" | |
stroke-width="2" | |
r="55" | |
cy="60" | |
cx="60" /> | |
</svg> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment