Giter VIP home page Giter VIP logo

rossmoody / svg-gobbler Goto Github PK

View Code? Open in Web Editor NEW
365.0 365.0 21.0 30.64 MB

Open source browser extension that makes designing and developing easier by finding, processing, exporting, optimizing, and managing SVG content.

Home Page: https://svggobbler.com

License: Apache License 2.0

JavaScript 1.48% HTML 0.34% TypeScript 96.59% CSS 1.59%
chrome-extension extension firefox-addon icon icons inline-svg javascript svg svg-export svg-grabber svg-icons svg2react svgo svgr typescript

svg-gobbler's Introduction

πŸ‘‹ Hi, my name is Ross

Check out rossmoody.com for a fun list of my side projects and favorite things.

πŸ”­ I’m currently working on...

My open-source side projects.

  • SVG Gobbler: A browser extension that finds vector content in the page and lets you download it or copy it to your clipboard for quick access during development and design.
  • Assembl: A dead simple window manager for macOS.
  • Link Roamer: A browser extension for finding, organizing, and inspecting all the links on a web page.

svg-gobbler's People

Contributors

d3ward avatar dependabot[bot] avatar fileformat avatar najustin avatar petemill avatar rossmoody avatar tressley avatar umar-ahmed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

svg-gobbler's Issues

Feature Request: toggle light/dark background

Is your feature request related to a problem? Please describe.

image

There are many occasions where it's not possible to see what a glyph/SVG asset actually looks like because its contents are the same color as the background color (as seen above).

Describe the solution you'd like
It would be useful to be able to toggle light/dark background modes.

Describe alternatives you've considered
I've tried to change the background-color style of the boxes using Inspect Element, but that's pretty inefficient.

Additional context
Here's the source of the page where I used the SVG Grabber: https://www.diffordsguide.com/

Open SVG Gobbler in new tab

I think it would be a better experience to open SVG Gobbler in a new tab instead of in the same one on top of content. I'm conflicted. I believe in keeping people on the page, but it would make it much easier to implement future functionality and I wouldn't have to compete against CSS styling.

Add ability to toggle gobbler off

Via some type of button that gets surfaced on the page. Right now the page has to be refreshed to start using the site again. It's annoying.

Account for all svg import instances

I'm going to cover how to work with two types of SVGs:

https://vecta.io/blog/best-way-to-embed-svg/

  • Inline
  • External (added using , or <iframe> tag)

    it's also possible to add SVGs using the tag and as a background-image in CSS, but neither of these methods allow you to manipulate the SVG with JS (or CSS).

    Inside the SVG itself
    External to the SVG (within the HTML document or as a separate file altogether)

Base64 support

Is your feature request related to a problem? Please describe.
Rarely, but sometimes sites use Base64 to encode the SVGs. SVG Gobbler currently can't grab those.

Here's example of site using Base64 SVGs: https://parsecgaming.com/ (logo at top left and bottom left)

Describe the solution you'd like
Decode Base64 SVGs and show them in SVG Gobbler.

Loading indicator

For sites with a ton of icons, loading the promises can take a second. Could be cool to have a loading indicator. Gobble gobble....

Preview sizes are missing for some SVGs since last update (breaking previews)

Since the last update, many SVGs are listed as 0x0 and don't generate correct previews in the interface despite working correctly previously.

An easy example of this is the charts generated by Google Data Studio, which can be tested against a public dashboard like this:
https://datastudio.google.com/u/0/reporting/1vqvDNQ1bqXhY5awvsW1OOQbjYpTliKAg/page/bnFIB?s=oh1ENMEdT04

In the previous version, output for the main line chart looked like this:
Google Data Studio example, showing working line chart preview

In the current version, it looks like this:
Google Data Studio example, showing blank chart and 0x0 size

The preview isn't actually blank, but rather just getting the top-left of the chart which happens to be all transparent. This makes it impossible to know which chart you're downloading.

I'm guessing this is probably all related to invalid detection of the size, but definitely a regression from the previous behavior. I've seen this on other sites too, but I'm not sure what the commonality is related to sizing. As you test, you'll see that number of the other elements on the page preview and calculate sizes just fine.

(I was originally hoping to get the time to fix this myself, but it's been seeming like that isn't very realistic with my current work scheduleβ€”so here's hoping someone else has the time!)

Highlight Font Icons

I mistake font icons for SVGs all the time and might be cool to see a numbered account for how many are on the page.

Add copy button

Would be nice to be able to copy svg to clipboard instead of downloading.

Make the close icon sticky

Even though there is a click outside the panels to close, I think it's not implied and a sticky close button will help give users something to aim for and not feel stuck if they miss it when scrolling.

Add SVGO to export

Should automatically run the chosen SVG through SVGO minify/cleanup process before exporting.

Filter duplicates before ajax calls

Seems like it would be smarter to filter the SVG array for duplicate icons before making the ajax calls. Need to find the method of determining how the SVGs are identical as the parsed string is being compared atm after the AJAX call.

Not exporting sprites

Describe the bug
Img are not being rendered in sprite instances for exporting PNGs.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.reliablesite.net/
  2. Try to export PNGs of sprites

Expected behavior
Should be able to see and export the SVGs

Fix the shame that is setTimeout

Getting asynchronous data between tabs in Chrome extensions is proving incredibly difficult for me. I've resorted to doing a half-second timeout in interim to make sure any fetches can complete before resolving in the new tab, but I'd love to get this hooked up correctly with a promise.

This is a StackOverflow covering how "simple" it is, but I haven't been able to get it to wait.

https://stackoverflow.com/questions/20077487/chrome-extension-message-passing-response-not-sent

Improve error handling

There is a generic try catch but it would be a lot more helpful to provide accessible reasons for why the extension isn't working.

Treeshake SVGO

SVGO dependency is adding 5mb to the webpack bundle file size. It's too much for Firefox and it's just too much in general. I don't know how to get it down. If I omit the import in download-svgs.js it immediately takes 5mb off the bundle size though. Need help here.

Add interesting attr to cards

Could be fun to assign tags to cards that give insight into attributes that make up the svg. For instance, how it's placed on the page, or if it has a viewbox or width/height.

Support for refreshing the page (⌘-R)

Describe the bug
Refreshing the page using ⌘-R clears the source of SVGs and doesn't rerun the extraction process.

To Reproduce
Steps to reproduce the behavior:

  1. Launch SVG Grabber to open a new page with extracted SVG assets
  2. Hit ⌘-R
  3. See empty page

Expected behavior

  1. Launch SVG Grabber to open a new page with extracted SVG assets
  2. Hit ⌘-R
  3. See page of refreshed assets (including any newly detected assets)

Screenshots
First load:
image

After refresh:
image

Desktop (please complete the following information):

  • OS: macOS 11.1 (20C69)
  • Browser: Chrome
  • Version 87.0.4280.88 (Official Build) (x86_64)

differentiate alert icons

Surfacing alert icons and messaging for Cors, sprite and symbols. Could be beneficial to separate the style of error at the card level.

Parse Xlink icons

Right now SVG that are generated via sprites using the xlink id method is rendering correctly but aren't being exported correctly. The SVG XML is within a closed shadow root and I'm unsure how to get to it.

Filtering functionality

Could be fun to institute filtering functionality of some kind by:

  • Size
  • Color
  • Animation
  • Viewbox
  • Hidden

This is an interesting question in particular because if filtering was instituted in this way it would free up a lot of card space. For instance, if cards were filtered by whether or not they are in view then it is implied by one global switch as opposed to individual notation on each card. This actually seems like a better usability approach in general.

fade on close

The closing mechanism whether by clicking on the x or by clicking on the webpage is too sudden.

Animate the cards in one at a time

There is a more attractive/performant way to load the icon cards into the dom. Would be really cool to facilitate a sequential load with a slight delay.

Institute different views

Could be really fun to have a view toggle for different types of views.

  • With attributes
  • Without attributes
  • Large card
  • Small card

Error handling

Would be nice to surface some feedback when errors happen for whatever reason.

Setup tests

It would be nice to have some tests in place to make sure regressions don't happen with functionality.

Grab SVG on a page if it's the only element

I think this has something to do with not being able to hook onto a body tag in the dom and so Gobbler doesn't fire at all. Could be fun to have a unique experience when a single SVG icon is on the page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.