Git Product home page Git Product logo

konva-boilerplate's Introduction

MOTIVATION

Konva.js (hereinafter – Konva) gives you ability to hook into native "CanvasAPI" context (CanvasRenderingContext2D) via Konva.Shape exposed sceneFunc, but also enjoy Konva-specific functionality such as draggable shape (enabled at Layer level).


Installation

  1. Clone the project to your local machine;
  2. npm ci # it assumes you have Node.js as well as npm installed prior to using this command.

Dependencies

Conventions

To reproduce token used as Letter modifier class (Lm Unicode) for valid a ECMAScript (JavaScript) indentifier found in this codebase, you can follow-up one of the respective methods as follows:

A. Leverage Regex in JavaScript:

    // # alternatively just use dollar '$' token
    RegExp('\u{3035}').source // '〵'

B. Set global snippet in VSC (recommended):

Snippets

DEV_TIP # you can make your own aliases in prefix[], use your imagination what works best for you !

{
    "Letter modifier (Lm U+3035) := vertical kana lower half": {
        "scope": "javascript,typescript",
        "prefix": ["lm:lower-kana", "u3035", "downkana"]
        "body": [
            "〵$0"
        ],
        "description": "JavaScript-friendly backward-slash"
    }
}

Playground

In order to drag a shape drew within Konva.Shape we have to create a Konva.Rect instance and plug it onto CanvasRenderingContext2D's ctx accessible via Konva.Shape's exposed sceneFunc;

Interactions

npx vite serve --open

Click on black-coloured border (frame) of circle and drag around, it will change a color whilst dragging, but gets back to its defaults then dragging is done;


Feel free to accommodate the codebase to your needs, just clone the boilerplate and enjoy coding with Konva.js ! ♥

Cheers

konva-boilerplate's People

Contributors

projektorius96 avatar

Watchers

James Cloos avatar  avatar

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.