Clumsy Graphics

a tool for rapidly developing animations where frames are described using svg elements à la react 🙃
Alternatives To Clumsy Graphics
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
React Spring26,3751,4641,603a day ago378June 26, 202396mitTypeScript
✌️ A spring physics based React animation library
React Three Fiber23,7793036 days ago184July 26, 202323mitTypeScript
🇨🇭 A React renderer for Three.js
Motion20,1191183,1873 days ago938July 28, 2023311mitTypeScript
Open source, production-ready animation and gesture library for React
Lottie React Native16,1226,322232a day ago69July 25, 202328apache-2.0Kotlin
Lottie wrapper for React Native.
React Content Loader12,7683094466 months ago70March 12, 20239mitTypeScript
⚪ SVG-Powered component to easily create skeleton loadings.
React Transition Group9,77147,7156,1635 months ago43August 01, 2022218otherJavaScript
An easy way to perform animations when a React component enters or leaves the DOM
React Native Animatable9,4982,1303384 months ago23October 13, 2019209mitJavaScript
Standard set of easy to use animations and declarative transitions for React Native
Auto Animate9,4325111 days ago13June 16, 202329mitTypeScript
A zero-config, drop-in animation utility that adds smooth transitions to your web app. You can use it with React, Vue, or any other JavaScript application.
React Native Reanimated7,6994,8471,51316 hours ago193August 05, 2023302mitTypeScript
React Native's Animated library reimplemented
React Move6,558323819 months ago60June 13, 202125mitJavaScript
React Move | Beautiful, data-driven animations for React
Alternatives To Clumsy Graphics
Select To Compare


Alternative Project Comparisons
Readme

clumsy-graphics

a tool for rapidly developing animations where frames are described using svg elements la react

example

tl;dr

TL;DR Hello Rainbow Animation Gif

./example-project/HelloRainbow.animation.tsx

import React from 'react'
import { AnimationModule } from 'clumsy-graphics'
import getColormap from 'colormap'

const HelloRainbowAnimationModule: AnimationModule = {
  moduleName: 'Hello-Rainbow',
  frameCount: 24,
  getFrameDescription: getHelloRainbowFrameDescription,
  frameSize: {
    width: 1024,
    height: 1024,
  },
  animationSettings: {
    frameRate: 9,
    constantRateFactor: 1,
  },
}

export default HelloRainbowAnimationModule

interface GetHelloRainbowFrameDescriptionApi {
  frameCount: number
  frameIndex: number
}

async function getHelloRainbowFrameDescription(
  api: GetHelloRainbowFrameDescriptionApi
) {
  const { frameCount, frameIndex } = api
  const rainbowColormap = getColormap({
    colormap: 'rainbow-soft',
    nshades: frameCount,
    format: 'hex',
    alpha: 1,
  })
  const mainFrameColor = rainbowColormap[frameIndex % frameCount]
  return (
    <svg viewBox={`0 0 100 100`}>
      <rect
        x={0}
        y={0}
        width={100}
        height={100}
        fill={'black'}
        stroke={mainFrameColor}
        strokeWidth={2}
      />
      <text
        x={5}
        y={9}
        style={{
          fontFamily: 'monospace',
          fontSize: 5,
          fontWeight: 600,
          fill: mainFrameColor,
        }}
      >
        Hello Rainbow
      </text>
      {new Array(frameCount).fill(null).map((_, squareIndex) => {
        const squareStamp = squareIndex / frameCount
        const squareRadius = 30 - 30 * squareStamp
        const squareLength = 2 * squareRadius
        return (
          <rect
            x={50 - squareRadius}
            y={50 - squareRadius}
            width={squareLength}
            height={squareLength}
            stroke={rainbowColormap[(squareIndex + frameIndex) % frameCount]}
            strokeWidth={0.5}
          />
        )
      })}
    </svg>
  )
}

develop and iterate on animation

yarn clumsy-graphics startDevelopment --animationModulePath=./example-project/HelloRainbow.animation.tsx

open browser at localhost:3000

./example-project/HelloRainbow.gif

Hello Rainbow Animation Gif

installation

add package to project

yarn add clumsy-graphics

setup docker

install and run docker engine (the majority of clumsy-graphics runs within a container to simplify dependency management)

api

clumsy-graphics --animationModulePath=<SourceFilePath>

  • animationModulePath: path to animation module export file

    • required
  • clientServerPort: the port on the host machine to use for handling api, asset, and page requests

    • defaultValue = 3000

how-to

  • run clumsy-graphics command

  • open browser at localhost:3000

  • begin making changes on the active animation module

Popular Animation Projects
Popular Reactjs Projects
Popular User Interface Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Typescript
Reactjs
Docker
Animation
Ffmpeg