Usage
Import
You can import it with ES6 syntax:
Or you can import directly the file:
How to use ?
A basic usage will look like this:
Explanations
Puffin
Property | Type | Informations |
---|---|---|
selector | string | Container where to put the image |
image | string | URI of the image |
overlay | string|false | Optional. Text to be display on an overlay. Default is disabled |
duration | number | Optional. Duration by default for all parts. Default is 0.4 |
delay | number | Optional. Delay by default for all parts. Default is 0 |
parts | PuffinPart[] | Parts. See below for more informations. |
PuffinParts
As you can see, you must specify parts. Those parts represent the square moving out when you mouseover.
You can define some properties :
Property | Type | Informations |
---|---|---|
x | number | Amount of horizontal pixels the part will move. If x is positive, the part will be on the right of the image, otherwise on the left. |
y | number | Amount of vertical pixels the part will move. If y is positive, the part will be on the bottom of the image, otherwise on the top. |
height | number | Height of the part. |
width | number | Width of the part. |
delay | number | Optional. Delay before the movement of the part. Default is 0 |
duration | number | Optional. Duration of the part movement. Default is 0.4 |