Library to generate GIF countdown with customized background image and font
License: MIT License
JavaScript 100.00%
gif-countdown's Introduction
Library to generate GIF countdown with customized background image and font
Features
Generate animated GIF with your preferred background image, font and countdown text
Show different image when the counter is zero / expired
For advanced use, frame delay, number of frames, number of times to repeat, gif quality and number of seconds count down can be configured
How to Use - See example folder for details
constGifCountdown=require("gif-countdown");constpath=require("path");constgifCountdown=newGifCountdown();awaitgifCountdown.loadImage(path.join(__dirname,"./assets/images/bg.png"));// Optional - To add image when counter is to zero// Note: It has been loaded after loadImage() and the expired image size has to be equal to counter background image//awaitgifCountdown.loadExpiredImage(path.join(__dirname,"./assets/images/expired_image.png"));awaitgifCountdown.registerFontText(path.join(__dirname,"./assets/fonts/OpenSans-Bold.ttf"),"Open Sans",40,(counter)=>` ${counter.days}${counter.hours}${counter.minutes}${counter.seconds}`,"rgb(163, 168, 178)",25,49);awaitgifCountdown.generate("2023-01-01T23:59:59-08:00");