Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use viewbox so svg is not a fixed size (easier to animate) #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

evanfuture
Copy link

Using width and height on an svg element defeats the purpose of using svg. It is better to use the viewbox. I applied the scale to the viewbox instead of the polygons to simplify future animations. (This article explains it nicely: https://css-tricks.com/scale-svg/ )

Also, I added a conditional to only apply fill-opacity to individual elements if they are different from the 1st shape's alpha channel (maybe there's a better way to do this than array[0]).

Also, only apply opacity to individual elements if they are different (maybe there's a better way to do this)
bmaltais added a commit to bmaltais/primitive that referenced this pull request Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant