season-js
v1.0.2
Published
Customize your logo and carousel based on the current season
Downloads
4
Readme
SeasonJs
A Javascript library that provides logo decorations and images for carousels based on the current holiday season.
Installation
npm i season-js
Dependencies
- Jimp(JavaScript Image Manipulation Program): This library is used for editing the images. Include the following script tag before including the season-js script tag.
Usage
- Include the season-js script tag in your page:
- Initialize SeasonJs with the package location and set the holiday type(ethiopian, international):
- Initialize SeasonLogo with the id of the img tag that contains the logo, set the decoration position(top, bottom) and call replaceLogo:
- Initialize SeasonCarousel with the id of the img that contains the image of one of the carousels and call replaceLogo:
Example Usage
<script src="https://unpkg.com/[email protected]/browser/lib/jimp.js"></script>
<script src="vendor/season-js/season-js.js"></script>
<script>
var seasonJs = new SeasonJs("vendor/");
seasonJs.setHolidayType("ethiopian");
var seasonLogo = seasonJs.seasonLogo("logo");
seasonLogo.setDecorationPosition("bottom");
seasonLogo.replaceLogo();
var seasonCarousel = seasonJs.seasonCarousel("carousel-1");
seasonCarousel.replaceCarousel();
</script>