Giter Club home page Giter Club logo

powercanvas's Introduction

Powercanvas

With power canvas you can use a HTML <canvas> element as a board where to place images and text. It lets you add borders, colorful captions, shades and scale, rotate, resize, reorder anything you pour in it! I originally wrote this for a school project, but the script works quite well by itself too, so here it is in the form of a super-simple library. It uses oCanvas and jQuery. Feel free to try it out. I included a very simple usage example in this repository, which doesn't let you play too much with text and borders, but it's better than nothing...

##Usage As shown in the example, place your canvas element somewhere, give it a size (WIDTH= and HEIGHT=...) and an id (e.g. powercanvas), then initialize it:

var p = PowerCanvas("powercanvas");

At that point you can go on with inserting an image or two:

p.insertImage("http://www.whatever.com/imageaddress.png",100,100) //Path to image, X position, Y position

And then start playing with it. You can select images by clicking on them, or unselect everything by clicking in any empty point of the canvas.

Some functions will make some handles appear, that you can drag around to interact with the selected image in a similar way to how you would do it on PowerPoint or Photoshop:

p.move();
p.rotate();
p.scale();
p.shade(); //This is my favourite *_*

Other commands are just one-time actions that don't require additional interactions:

p.setBorders(5,"#ff0000"); //width and color
p.addCaption("Any text you want","#0000ff","Ariel"); //Content, color, font. You can resize, rotate, add shades and borders to these too!
p.bringFront();
p.sendBack();
p.erase();

##Output Example When you will be a powercanvas ninja (and a good photographer :P) you will be able to put together things like this: alt tag

Enjoy!

powercanvas's People

Contributors

mrgreenh avatar

Watchers

James Cloos avatar 阿喵 avatar  avatar  avatar

Forkers

seco

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.