Using Upperdog Interactive’s CSS Twitter logo as reference, and I wrote some circle-circle intersection code (a.k.a. math) to specify the Twitter logo as sequence of elliptical arc segments. There are other versions of the Twitter logo in SVG, but as best I can tell, they use cubic Béziers. I found it mathematically unsettling to use Béziers when circular arcs would suffice.
-
-
Save mbostock/3094619 to your computer and use it in GitHub Desktop.
Twitter SVG Logo
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: gpl-3.0 |
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> | |
<meta charset="utf-8"> | |
<style> | |
svg { | |
display: block; | |
height: 400px; | |
margin: 50px auto; | |
} | |
</style> | |
<svg viewBox="328 355 335 276" xmlns="http://www.w3.org/2000/svg"> | |
<path d=" | |
M 630, 425 | |
A 195, 195 0 0 1 331, 600 | |
A 142, 142 0 0 0 428, 570 | |
A 70, 70 0 0 1 370, 523 | |
A 70, 70 0 0 0 401, 521 | |
A 70, 70 0 0 1 344, 455 | |
A 70, 70 0 0 0 372, 460 | |
A 70, 70 0 0 1 354, 370 | |
A 195, 195 0 0 0 495, 442 | |
A 67, 67 0 0 1 611, 380 | |
A 117, 117 0 0 0 654, 363 | |
A 65, 65 0 0 1 623, 401 | |
A 117, 117 0 0 0 662, 390 | |
A 65, 65 0 0 1 630, 425 | |
Z" | |
style="fill:#3BA9EE;"/> | |
</svg> |
Really good.
You can save a few characters by using the fill property, i.e. fill="#3BA9EE" instead of using the style property 😄
Awesome, thanks!
Thanks a lot, I needed this svg icon.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah, you beat me to it! :-)
It comes down to 367 bytes with relative coordinates: https://github.com/johan/svg-cleanups/blob/master/logos/twitter.svg - or a 220 byte svgz.
Pretty good, even by svg standards!