All Projects → alexjlockwood → Shapeshifter

alexjlockwood / Shapeshifter

Licence: apache-2.0
SVG icon animation tool for Android, iOS, and the web

Programming Languages

typescript
32286 projects
HTML
75241 projects
SCSS
7915 projects

Projects that are alternatives of or similar to Shapeshifter

Devicon
Set of icons representing programming languages, designing & development tools
Stars: ✭ 4,536 (+22.43%)
Mutual labels:  svg
Svgtovectordrawableconverter
Batch converter of SVG images to Android vector drawable XML resource files. Online version of the converter is here:
Stars: ✭ 341 (-90.8%)
Mutual labels:  svg
Flowchart
svg实现流程图绘制,导入导出json [正在重构项目flowchart-vue],地址:
Stars: ✭ 350 (-90.55%)
Mutual labels:  svg
Warpjs
Warp, distort, bend, twist and smudge your SVG’s directly in the browser
Stars: ✭ 326 (-91.2%)
Mutual labels:  svg
Latexdraw
A vector drawing editor for LaTeX (JavaFX).
Stars: ✭ 336 (-90.93%)
Mutual labels:  svg
Iconpark
🍎Transform an SVG icon into multiple themes, and generate React icons,Vue icons,svg icons
Stars: ✭ 4,924 (+32.9%)
Mutual labels:  svg
Displacy
💥 displaCy.js: An open-source NLP visualiser for the modern web
Stars: ✭ 311 (-91.61%)
Mutual labels:  svg
Bytesize Icons
Tiny style-controlled SVG iconset (101 icons, 12kb)
Stars: ✭ 3,662 (-1.16%)
Mutual labels:  svg
Faux Code Generator
Turn real code into faux code.
Stars: ✭ 339 (-90.85%)
Mutual labels:  svg
Svguitar
Create beautiful SVG guitar chord charts
Stars: ✭ 348 (-90.61%)
Mutual labels:  svg
Ikonate
Fully customisable & accessible vector icons
Stars: ✭ 3,392 (-8.45%)
Mutual labels:  svg
Compress Images
Minify size your images. Image compression with extension: jpg/jpeg, svg, png, gif. NodeJs
Stars: ✭ 331 (-91.07%)
Mutual labels:  svg
Magicasakura
MagicaSakura 是 Android 多主题框架。~ is an Android multi theme library which supporting both daily colorful theme and night theme.
Stars: ✭ 3,455 (-6.75%)
Mutual labels:  svg
Drawing animation
A Flutter library for gradually painting SVG path objects on canvas (drawing line animation).
Stars: ✭ 317 (-91.44%)
Mutual labels:  svg
Ira Illustrations
Build your own amazing illustrations
Stars: ✭ 351 (-90.53%)
Mutual labels:  svg
Sharpvectors
SharpVectors - SVG# Reloaded: SVG DOM and Rendering in C# for the .Net.
Stars: ✭ 315 (-91.5%)
Mutual labels:  svg
Wpf Math
.NET library for rendering mathematical formulae using the LaTeX typsetting style, for the WPF framework
Stars: ✭ 339 (-90.85%)
Mutual labels:  svg
Plain Draggable
The simple and high performance library to allow HTML/SVG element to be dragged.
Stars: ✭ 362 (-90.23%)
Mutual labels:  svg
Taro
A lightweight 3D game engine for the web.
Stars: ✭ 345 (-90.69%)
Mutual labels:  svg
React Mt Svg Lines
A React.js wrapper component to animate the line stroke in SVGs
Stars: ✭ 344 (-90.72%)
Mutual labels:  svg

Shape Shifter

Build Status Coverage Status GitHub Stats

Go to live version or ask a question on Slack


Shape Shifter is a web-app that simplifies the creation of icon animations for Android, iOS, and the web.

This tool currently exports to standalone SVGs, SVG spritesheets, and CSS keyframe animations for the web, as well as to AnimatedVectorDrawable format for Android. I am totally open to adding support for other export formats as well, so if you have a format that you'd like to see added in the future, file a feature request!

Try out the beta version, which adds the ability to draw/edit paths directly on the canvas (written using the amazing paper.js library)!

Screen capture of tool

Backers

Support us with either a one time donation or a monthly donation and help us continue our activities. Funds will go towards hiring new developers to work on awesome features! We'll display your logo below with a link to your site.

🙏 Become a backer 🙏

Sponsors

Is your company using Shape Shifter? Ask your manager to support us! We'll display your logo below with a link to your site.

🙏 Become a sponsor 🙏

Examples

I gave a couple of live demos that illustrate how to use the tool at Droidcon SF (15:15 - 20:33):

In-depth path morphing with Shape Shifter

Here are some example icon animations created by Shape Shifter:

Expand to collapse animationOverflow to back arrow animationPlay-pause-stop animationAnimals animation

Problem

Writing high-quality path morphing animations is a tedious and time-consuming task. In order to morph one shape into another, the SVG paths describing the two must be compatible with each other—that is, they need to have the same number and type of drawing commands. This is problematic because:

  • Design tools—such as Sketch and Illustrator—do not easily expose the order of points in a shape, making it difficult to change their order. As a result, engineers will often have to spend time tweaking the raw SVG path strings given to them by designers before they can be morphed, which can take a significant amount of time.
  • Design tools often map to shape primitives not supported in certain platforms (e.g. circles need to be represented by a sequence of curves and/or arcs, not simply by their center point and radius).
  • Design tools cannot place multiple path points in the same location, a technique that is often necessary when making two shapes compatible with each other.
  • Design tools provide no easy way to visualize the in-between states of the desired path morph animation.

Features

To address these problems, Shape Shifter provides the following features:

  • The ability to add/remove points to each path without altering their original appearance. The added points can be modified by dragging them to different positions along the path, and they can be later deleted using the keyboard as well.
  • The ability to reverse/shift the relative positions of each path's points. While reordering points won't affect whether or not two paths are compatible, it often plays a huge role in determining the appearance of the resulting animation.
  • Shape Shifter automatically converts incompatible pairs of SVG commands into a compatible format. There's no longer any need to convert Ls into Qs and As into Cs by hand in order to make your paths compatible—Shape Shifter does this for you behind-the-scenes!
  • Shape Shifter provides a useful utility called 'auto fix', which takes two incompatible paths and attempts to make them compatible in an optimal way. Depending on the complexity of the paths, auto fix may or may not generate a satisfying final result, so further modification may be necessary in order to achieve the animation you're looking for.
  • The ability to export the results to SVG spritesheets, CSS keyframes, and AnimatedVectorDrawable format for use on the web and in Android applications. I'm open to adding support for other export formats as well, so feel free to file a feature request!

How does it work?

Pretty much all of the graphics in this app are powered by bezier curve approximations under-the-hood. I learned most of what I needed to know from this excellent primer on bezier curves (especially sections 9 and 33, which explain how to split and project points onto bezier curves without altering their original appearance). Most of the interesting SVG-related code is located under src/app/model/paths.

Auto fix is powered by an adaptation of the Needleman-Wunsch algorithm, which is used in bioinformatics to align protein or nucleotide sequences. Instead of aligning DNA base-pairs, Shape Shifter aligns the individual SVG commands that make up each path instead. You can view the current implementation of the algorithm in the AutoAwesome.ts file.

Bug reports & feature requests

Let me know if you encounter any issues with the app (attach SVG files and/or screenshots if you can). Before you do, take a look at the list of known issues here and leave a comment on the existing bugs you want to see fixed in a future release!

I am open to pretty much any feature request, so don't be afraid to ask! I'll likely work on the most popular feature requests first. I'm especially curious how I can make this web app more useful for iOS and web developers.

Build instructions

If you want to contribute, you can build and serve the web app locally as follows:

  1. First install Node.js and npm.

  2. Clone the repository and in the root directory, run:

    npm install
    
  3. To build and serve the web app locally, run:

    npm start
    

Special thanks

Huge thanks to Nick Butcher, Roman Nurik, and Steph Yim for all of their help during the early stages of this project!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].