changhuixu / canvas-animation-step-by-step

Canvas animation with flowers step by step using TypeScript.

Home Page:https://flowerscanvas.firebaseapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Canvas Animation in TypeScript

ko-fi

Canvas Animation written in TypeScript. No jQuery and no other 3rd party dependencies. You may also interested in my another repo about canvas animation.

Interactive Canvas with Flowers

Step-by-step guide can be found in this Medium Post

This repo includes blooming flowers animation examples. The flower drawing was inspired and optimized from this tutorial.

Project Structure

  1. models

    flower.ts

    flower-center.ts

    petal.ts

    point.ts

  2. services

    flower-randomization.service.ts

  3. animations

    blooming-flowers.ts

    interactive-flowers.ts

Supplementary

In order to show the steps of drawing flower, I also kept the "sandbox" that I played with in supplementary folder. The code in supplementary folder generates an illustration below.

how to draw flower on canvas

How to build locally

// run the animation app
npm start

// build the app
npm run build

Then visit http://localhost:8080/

License

Feel free to use the code in this repository as it is under MIT license.

ko-fi

About

Canvas animation with flowers step by step using TypeScript.

https://flowerscanvas.firebaseapp.com

License:MIT License


Languages

Language:TypeScript 66.0%Language:JavaScript 20.1%Language:HTML 12.6%Language:CSS 1.3%