GithubHelp home page GithubHelp logo

whimsicaldreamer / scribbly Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 25 KB

A simple javascript and HTML5 drawing plugin

License: MIT License

CSS 9.99% HTML 3.88% JavaScript 86.13%
html5 html5-canvas-element html5-canvas javascript plugin drawing paint no-dependencies

scribbly's Introduction

Scribbly

Simple Usage

  • Declare the HTML5 canvas element as:
    <canvas id="drawingBoard" width="700" height="400"></canvas>

  • Import scribbly.js as <script src="scribbly.js"></script>

  • Import scribbly.css as <link rel="stylesheet" href="scribbly.css"> if toolbar is not set to false

  • Then initialize your script with the HTML5 canvas element:

     var scribble = new Scribbly({     
         canvas: 'drawingBoard',
     });  
    

Options

Options Default Description
canvas null Identify your drawing board. Required
canvasBg #FFFFFF Background colour for the drawing canvas
lineThickness 2 Stroke width
lineColor #000000 Stroke colour
toolbar true Show/ Hide the toolbar

Functions

Function Description
clear() Clears the whole canvas
save(filename) Saves the canvas and downloads the image.
Parameter filename is optional
setTool(tool, size, color) Tools available are : clear, eraser, marker.
Parameter size sets the stroke size

scribbly's People

Contributors

whimsicaldreamer avatar

Watchers

 avatar  avatar

scribbly's Issues

Stroke dot not occuring on single tap in touch devices

The scenario is that when trying to draw on touch devices rather than using touch emulation in browsers. When drawing if a user taps on the canvas only once, no stroke dot appears on the canvas. Except that when user drags to draw everything goes fine. In desktop browsers emulating touch doesn't cause this issue.

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.