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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<svg | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:cc="http://creativecommons.org/ns#" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:svg="http://www.w3.org/2000/svg" | |
xmlns="http://www.w3.org/2000/svg" | |
version="1.1" | |
id="Layer_1" | |
x="0px" | |
y="0px" | |
width="115" | |
height="115" | |
viewBox="0 0 115 115" | |
enable-background="new 0 0 792 612" | |
xml:space="preserve"><metadata | |
id="metadata413"><rdf:RDF><cc:Work | |
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type | |
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs | |
id="defs411" /><circle | |
style="fill:none;stroke:#ffffff;stroke-width:3.26600003" | |
id="circle315" | |
r="54.798" | |
cy="485.431" | |
cx="260.83099" | |
clip-path="url(#SVGID_26_)" | |
transform="translate(-203.33099,-427.931)" /><path | |
style="fill:#d3540f;fill-opacity:0.94117647;stroke:#ffffff;stroke-opacity:1" | |
id="path313" | |
d="m 260.831,540.229 c -30.264,0 -54.798,-24.534 -54.798,-54.798 0,-30.266 24.534,-54.798 54.798,-54.798 30.264,0 54.798,24.532 54.798,54.798 -0.001,30.263 -24.534,54.798 -54.798,54.798" | |
clip-path="url(#SVGID_26_)" | |
transform="translate(-203.33099,-427.931)" /><path | |
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" | |
id="path4225" | |
d="m 61.056246,61.027347 c 0.146054,0.225966 -0.09952,0.480814 -0.304795,0.543223 -0.515698,0.156789 -0.962467,-0.330519 -1.037837,-0.800918 -0.143451,-0.895311 0.680557,-1.601287 1.511833,-1.668677 1.363174,-0.110509 2.390738,1.142165 2.430472,2.425335 0.05936,1.917159 -1.710348,3.325665 -3.533019,3.319105 -2.555172,-0.0092 -4.401917,-2.381408 -4.331238,-4.828515 0.0946,-3.275328 3.152422,-5.616054 6.306725,-5.464075 4.075964,0.196385 6.965151,4.020982 6.71522,7.963415 -0.314161,4.955613 -4.985048,8.446679 -9.794975,8.082584 -5.912973,-0.447593 -10.058414,-6.042852 -9.564315,-11.798269 0.596385,-6.946875 7.192839,-11.798376 13.970524,-11.15876 8.056267,0.760278 13.664786,8.433626 12.864422,16.309269 -0.939036,9.240189 -9.763962,15.656027 -18.81227,14.679937 C 46.979233,77.498551 39.706371,67.448285 40.872938,57.153507 42.213265,45.325334 53.56179,37.146294 65.176019,38.517887 78.406695,40.080376 87.540559,52.7993 85.94958,65.805197 84.150806,80.509771 69.990065,90.646633 55.52099,88.822077 39.271777,86.773044 28.084181,71.09974 30.156347,55.09664 32.469471,37.232656 49.725457,24.947004 67.332811,27.280668 86.881122,29.871585 100.31176,48.77978 97.702852,68.061036 94.820563,89.362689 74.191186,103.98489 53.166928,101.0871 30.043434,97.899979 14.183446,75.480972 17.383613,52.645133 20.888931,27.631784 45.165519,10.488113 69.88103,14.004053 c 6.423103,0.91373 12.640502,3.144994 18.19101,6.501899" /></svg> |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<svg | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:cc="http://creativecommons.org/ns#" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:svg="http://www.w3.org/2000/svg" | |
xmlns="http://www.w3.org/2000/svg" | |
version="1.1" | |
id="Layer_1" | |
x="0px" | |
y="0px" | |
width="115" | |
height="115" | |
viewBox="0 0 115 115" | |
enable-background="new 0 0 792 612" | |
xml:space="preserve"><metadata | |
id="metadata413"><rdf:RDF><cc:Work | |
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type | |
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs | |
id="defs411" /><circle | |
style="fill:none;stroke:#ffffff;stroke-width:3.26600003" | |
id="circle315" | |
r="54.798" | |
cy="485.431" | |
cx="260.83099" | |
clip-path="url(#SVGID_26_)" | |
transform="translate(-203.33099,-427.931)" /><path | |
style="fill:#d3540f;fill-opacity:0.94117647;stroke:#ffffff;stroke-opacity:1" | |
id="path313" | |
d="m 260.831,540.229 c -30.264,0 -54.798,-24.534 -54.798,-54.798 0,-30.266 24.534,-54.798 54.798,-54.798 30.264,0 54.798,24.532 54.798,54.798 -0.001,30.263 -24.534,54.798 -54.798,54.798" | |
clip-path="url(#SVGID_26_)" | |
transform="translate(-203.33099,-427.931)" /><path | |
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" | |
id="path4225" | |
d="m 61.056246,61.027347 c 0.146054,0.225966 -0.09952,0.480814 -0.304795,0.543223 -0.515698,0.156789 -0.962467,-0.330519 -1.037837,-0.800918 -0.143451,-0.895311 0.680557,-1.601287 1.511833,-1.668677 1.363174,-0.110509 2.390738,1.142165 2.430472,2.425335 0.05936,1.917159 -1.710348,3.325665 -3.533019,3.319105 -2.555172,-0.0092 -4.401917,-2.381408 -4.331238,-4.828515 0.0946,-3.275328 3.152422,-5.616054 6.306725,-5.464075 4.075964,0.196385 6.965151,4.020982 6.71522,7.963415 -0.314161,4.955613 -4.985048,8.446679 -9.794975,8.082584 -5.912973,-0.447593 -10.058414,-6.042852 -9.564315,-11.798269 0.596385,-6.946875 7.192839,-11.798376 13.970524,-11.15876 8.056267,0.760278 13.664786,8.433626 12.864422,16.309269 -0.939036,9.240189 -9.763962,15.656027 -18.81227,14.679937 C 46.979233,77.498551 39.706371,67.448285 40.872938,57.153507 42.213265,45.325334 53.56179,37.146294 65.176019,38.517887 78.406695,40.080376 87.540559,52.7993 85.94958,65.805197 84.150806,80.509771 69.990065,90.646633 55.52099,88.822077 39.271777,86.773044 28.084181,71.09974 30.156347,55.09664 32.469471,37.232656 49.725457,24.947004 67.332811,27.280668 86.881122,29.871585 100.31176,48.77978 97.702852,68.061036 94.820563,89.362689 74.191186,103.98489 53.166928,101.0871 30.043434,97.899979 14.183446,75.480972 17.383613,52.645133 20.888931,27.631784 45.165519,10.488113 69.88103,14.004053 c 6.423103,0.91373 12.640502,3.144994 18.19101,6.501899" /></svg> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment