alvinquach / svg-minifier Goto Github PK
View Code? Open in Web Editor NEWMinifies Illustrator SVG files for use in GT Sport
Home Page: http://svg-minifier.alvinquach.com/
Minifies Illustrator SVG files for use in GT Sport
Home Page: http://svg-minifier.alvinquach.com/
Example:
Gradient has ID of AAAAAA
. The reference to the ID would be url(#AAAAAA)
. However the #AAAAAA
is being simplified to #AAA
as if it were a color code.
Example Output:
<linearGradient id="AAAAAA" gradientUnits="userSpaceOnUse" x1="771.1634" y1="344.4857" x2="814.1547" y2="319.6647">
<stop offset="0" stop-opacity="0"/>
<stop offset=".02" stop-opacity=".7"/>
<stop offset=".1" stop-opacity=".7"/>
<stop offset=".15"/>
</linearGradient>
<path fill="url(#AAA)" d="M776.58,342.75c1.49-1.09,3.1-2.3,4.64-3.31c3.84-2.52,7.73-4.66,11.52-7.25c3.8-2.6,7.5-5.33,11.22-8.03c3.03-2.13,6.71-4.19,9.32-5.95l0.28,0.42c-6.2,4.18-8.67,5.31-11.38,7.33c-1.86,1.39-3.66,2.89-5.53,4.28c-6.36,4.73-13.01,8.88-19.81,12.94c-1.71,0.04-3.43,0.98-5.03,1.84c-0.15,0.08-0.33,0.03-0.41-0.12c-0.08-0.15-0.03-0.33,0.12-0.41C773.26,343.54,775.1,342.77,776.58,342.75z"/>```
Currently, if a path item with a gradient stroke and/or fill is hidden, the item is removed after minfication, but its gradient definition(s) still remain. The stray gradient definitions do not contain an ID. These definitions need to be removed also.
As of a recent update, the radial gradients are now being displayed properly for all SVG aspect ratios.
Test files:
radial-gradient-test.zip
rounded and bevel linejoins do not need miterlimit; remove miterlimit property if the path has one of these linejoins
GT Sport does not use the gradientUnits property; it will always default to userSpaceOnUse
(butnot objectBoundingBox
, which is actually the standard default). This applies to both linear and radial gradients.
Add an option to remove the gradientUnits properties when minifying.
Test files:
gradientUnits-test.zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.