Codeberg/GetItOnCodeberg
20
83
Fork
You've already forked GetItOnCodeberg
3

SVG Is broken and not suited for resizing and thus embedding in webpages #3

Closed
opened 2020年09月24日 18:44:01 +02:00 by martijndeb · 1 comment

I tried to use the SVG for my pages, but it's quite big, and not resizable. I'm not really an expert on SVG's but it should be set up to scale properly. Currently it has positions and width inside them. One would need an image editor to resize it properly now.

One can basically use it only at the size 564x168. Setting a size on the outside element in your page crops the viewport in all browser. (Using a size of 128x38 makes it ~25% cropped, not 75% smaller).

Problems with the SVG:

  • The root tag has a width/height set in pixels. That's not a scalable unit. SVG's should resize to their viewport. It should be set to '100vw' and '100vh', or '100vw' and 'auto'. I'm unsure as what to use here when maintaining aspect ratio. I think that setting 'auto' for the height should suffice and that the next point should fix it.
  • When setting vw/vh units, the coordinates in the SVG should be relative to those. Most likely when using auto for the height, one can use relative vw sizes for the height.

I'm too unfamiliar with Inkscape, so I don't know if it's able to do this automatically.

I'm not sure how to fix this properly but points above should help pinpointing it, so either someone more knowledgable can fix this or point me in the right direction.

I tried to use the SVG for my [pages](https://pages.codeberg.org/sexybiggetje/), but it's quite big, and not resizable. I'm not really an expert on SVG's but it should be set up to scale properly. Currently it has positions and width inside them. One would need an image editor to resize it properly now. One can basically use it only at the size 564x168. Setting a size on the outside element in your page crops the viewport in all browser. (Using a size of 128x38 makes it ~25% cropped, not 75% smaller). Problems with the SVG: - The root tag has a width/height set in pixels. That's not a scalable unit. SVG's should resize to their viewport. It should be set to '100vw' and '100vh', or '100vw' and 'auto'. I'm unsure as what to use here when maintaining aspect ratio. I *think* that setting 'auto' for the height should suffice and that the next point should fix it. - When setting vw/vh units, the coordinates in the SVG should be relative to those. Most likely when using auto for the height, one can use relative vw sizes for the height. I'm too unfamiliar with Inkscape, so I don't know if it's able to do this automatically. I'm not sure how to fix this properly but points above should help pinpointing it, so either someone more knowledgable can fix this or point me in the right direction.

It appears this repo is not being actively watched by the maintainer of the badge.
Try get-it-on/pages instead. The first time I tried in #1, I had to wait for a while before realizing that 🙈

See also get-it-on/pages#8

It appears this repo is not being actively watched by the maintainer of the badge. Try get-it-on/pages instead. The first time I tried in #1, I had to wait for a while before realizing that 🙈 See also get-it-on/pages#8
Sign in to join this conversation.
No Branch/Tag specified
main
redwerkz-patch-1
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/GetItOnCodeberg#3
Reference in a new issue
Codeberg/GetItOnCodeberg
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?