jquery-HS-unsplash
jQuery plugin to change a full background image from Unsplash
Installation
npm install jquery-HS-unsplash
Load
Usage
Create a container where you want to set a full background image(div
, section
, article
, etc.)
Before using the Unsplash API, you need to register as a developer. You must put the CLIENT_ID in order to be enable to get photos from Unsplash API.
windowhsUnsplash;
Call the plugin:
;
Options
By default the plugin use some values:
height: '100vh' width: '100%' minHeight: '800px' backgroundSize: 'cover' backgroundPosition: 'center' backgroundColor: 'black'
You can override them:
;
In case that endpoint of Unsplash responses with errors, you can set an image(this only is visible when Unsplash endpoint fails):
;
Testing
This will build scripts, run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.
npm test
Contributing
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests (
npm test
).