Image Loader Component - Lazy loading and Progressive loading.
npm install @veerajshenoy/imageloaderCopy dist folder into your project directory. and in the ``` tag of the `html` document place ``.
or
Run
``
$ npm i @veerajshenoy/imageloader`
and include ``
in the head` tag of your `html` file.
Lazy Loading
Use
You can set your custom style using styling property on the component
``
To set image url use src prop
``
To give a color to the div before loading image use the initcolor property
``
By default image is set using the image tag, to set image as a background image in div, set property bg=true
``
Example setting as background image
``
Example setting as image as img tag
``
Progressive Loading
Use
You can set your custom style using styling property on the component
``
To set image url use src Prop
``
To give a color to the div before loading image use the initcolor property
``
By default image is set using the image tag to set image as background image in div set property bg=true
``
Set a low resolution image using lowres property, set a high resultion image using highres property
```
Providing both properties is unnecessay, any single property will readily load the image.
Feel free to use it in any of your projects.
You can donate to this project using the link below
Donate now
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.