1.2.2 • Published 4 years ago

flying-canvas v1.2.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

flying-canvas Build Status

yarn version NuGet version

flying-canvas is awesome. LOL!

flying-canvas demo image Check out the live example: https://www.subidote.com/flying-canvas

Use it this way

1 Download and Install flying-canvas

2 Include dependences

2.1 Include flying-canvas.min.js by referencing the necessary files

You will find .js and .css files in dist folder.

<script src="../dist/flying-canvas.min.js"></script>
<link rel="stylesheet" href="../dist/flying-canvas.min.css">

2.2 Initialize the plugin

<script>
    flyingCanvas.init({
        showWings: false,
        animation: false
    });
</script>

When the canvas pane bumps into the edges a function can be executed specifying bumpIntoEdgeFn

<script>
    flyingCanvas.init({
        showWings: false,
        bumpIntoEdgeFn: function(){
            console.log("Choca 1!");
        },
        animation: false
    });
</script>

2.3 Show a picture

Use src: "./void.png" to load a pinture in the canvas.

<script>
    flyingCanvas.init({
        src: "./void.png"
    });
</script>

2.3 Awesome

<script>
    flyingCanvas.init({
        width: 200,
        height: 400,
        showWings: false,
        bumpIntoEdgeFn: function(){
            console.log("Choca 1!");
        },
        zIndex: 300,
        awesome: 2 // This will render the picture of the column
    });
</script>

3 Configuration options

optiondefaultdescription
flyingCanvas.init()-Initializes the component allowing several parameters in json format.
width350Width of the canvas.
height400Height of the canvas.
pictureFrameWidth75Working on this now!
srcnullRoute to an image.
flyingCanvas.loadImage()-Loads new images this way: flyingCanvas.loadImage("newImage.jpg").
flyingCanvas.clearImage()-Removes the image
animationbooleanIn the case of false the component will not have movement when created.
hiddenbooleanIn the case of false the component will be hidden by default.
showWingsbooleanShow wings
awesomeunknownAwesome stuff will happen.
flyingCanvas.start()-Starts the movement of the canvas.
flyingCanvas.stop()-Stops the movement.
flyingCanvas.hide()-Hides the component. Does not destroy. The component will continue running in the background.
flyingCanvas.show()-Shows the component again.

Development

sudo npm install -g eslint

sudo npm install -g grunt-cli

grunt build

License

flying-canvas is MIT licensed.

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago