开发者

Shard SVG image into pieces

Say you have a SVG image such as this:

Shard SVG image into pieces

Each card is its own svg group, but cont开发者_运维问答ains other groups of subelements.

How can you split it up into 52 different images?


Assuming each card is in it's own group (<g> element) with no dependencies outside the group then:

  • copy the root svg element of the original file to 52 files (<svg ...></svg>)
  • for each card:
    • append the group belonging to the card as a child of the root svg element in one of the new svg files created in step 1.
    • update the viewBox attribute (or width and height) on the root svg element to fit the card (can probably be done automatically by svg scour)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜