Coder Social home page Coder Social logo

good-lly / countdown-gif Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blabu-com/countdown-gif

0.0 2.0 0.0 619 KB

Simple library to generate countdown GIFs in nodejs using Cairo/Canvas implementation usable for on-demand image generation.

License: MIT License

TypeScript 100.00%

countdown-gif's Introduction

Countdown GIF generator for emails and whatnot

Simple library to generate countdown GIFs in nodejs using Cairo/Canvas implementation usable for on-demand image generation.

Image Options

  • width - width in pixels [defaults to 200]
  • height - height in pixels [defaults to 200]
  • color - hex colour code for the text [defaults to ffffff]
  • bg - hex colour code for the background [defaults to 000000]
  • frames - number of frames (also number of seconds) the countdown will run before looping [defaults to 30]
  • fontSize - size of font, recommended is width / 12, but play with this to see what looks good
  • fontFamily - font family, see #More Fonts
  • fontStyle - font style
  • expired - expired text, blinking
  • quality - final output quality

Timer value

  • end - Any momentjs parseable string, ideally JSON.stringify(new Date()) format [e.g. 2016-06-24T20:35:00.000Z]

Default options

width: 200,
height: 200,
color: 'ffffff',
bg: '000000',
frames: 30,
fontSize: 26,
fontFamily: 'Courier New',
fontStyle: 'bold',
expired: '00:00:00',
quality: 90

More fonts

import { registerFont } from 'canvas'
registerFont(path, 'name')
ImageOptions.familyName = 'name'

Package Size

The main dependency Cairo has around 30MB when installed on Mac.

Samples

Attached webserver offers generating GIF into file or as direct output of express response (the fastest method of serving)

License

MIT

Inspired by

countdown-gif's People

Contributors

tomasstrejcek avatar good-lly avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.