Super simple countdowns.

Overview

Countdown.js Build Status

Countdown.js is a library that allows developers to set countdowns for any kind of interaction. For example, if you would like to submit a form, Countdown.js allows you to set a 5 second countdown and give the user a chance to cancel the submission. You can see it in action here.

Installation

If you use bower:

bower install countdown.js

Otherwise, you can download it from here.

API

new Countdown(duration, onTick, onComplete)

Begins a countdown. After duration time has passed, the function onComplete will be executed. Every second, the onTick function will be executed.

Example:

var countdown = new Countdown(5, function(seconds) {
  console.log(seconds); //log the number of seconds that have passed
}, function() {
   console.log("Countdown complete!") //log that the countdown has complete
});

abort()

Terminates countdown.

Example:

countdown.abort();

getRemainingTime()

Returns remaining time in seconds.

Example:

countdown.getRemainingTime(); //=> 4

Example

http://gumroad.github.io/countdown.js/

Contribute

Install development dependencies

npm install

Test

npm test
You might also like...

A super simple web3 API to allow crypto interactions with the Solana Network 🔑🌐

orca.js A JavaScript API for web3 Transaction and Authenticating PLEASE NOTE: orca.js is still in development! And comming soon in 2022. Stay tuned on

Mar 20, 2022

A super light, fast and simple tho advanced Music Bot

A super light, fast and simple tho advanced Music Bot, without any Music Manager Packages like Lavalink, discord-player or distube. Technically providing up to all filters of lavalink, but limited to 19 predefined ones, with speed and bassboost control, as well as everything in slash Commands and message Commands!

Dec 17, 2022

Simple but super overengineered wake-on-lan web app.

webwol An absolutely overengineered web application for waking up network devices via wake on lan. Demo Untitled.mp4 Setup You might want to deploy th

Mar 4, 2022

A super-simple thermostat for Home Assistant's Lovelace UI.

A super-simple thermostat for Home Assistant's Lovelace UI.

Minimalist Thermostat by @ShepleySound A super-simple thermostat for Home Assistant's Lovelace. The goal is to create a thermostat interface that clea

Jan 22, 2022

Hash.js is a 0.5 KB script that lets you in a super simple way manipulate everything behind # in urls.

Hash.js - URL Hash Manipulation Hash.js is a 0.5 KB script that lets you in a super simple way manipulate everything behind # in urls. Tested in lates

Aug 1, 2022

Our super simple URL shortener. Powered by Deno and Supabase.

Feelantera URL Shortener This is our super simple URL shortener. Powered by Supabase and Deno, and Oak for the http framework. You can deploy this pro

Oct 14, 2022

A super simple minimal tRPC for next-js

Typed Routes A way to have fully typed routes in next, without all the complexity of tRPC. This is more for super minimal use cases, where you don't n

Dec 28, 2022

tb-grid is a super simple and lightweight 12 column responsive grid system utilizing css grid.

tb-grid is a super simple and lightweight 12 column responsive grid system utilizing css grid.

tb-grid Lightweight (1kb gzipped) 12 column grid system, built with css grid. 👉 Demos & Playground Have a look at those examples: Main Demo: https:/

Dec 28, 2022

Super-smooth CSS3 transformations and transitions for jQuery

jQuery Transit Super-smooth CSS3 transformations and transitions for jQuery jQuery Transit is a plugin for to help you do CSS transformations and tran

Dec 23, 2022

🐿 Super easy and lightweight(3kb) JavaScript animation library

🐿 Super easy and lightweight(<3kb) JavaScript animation library

Overview AniX - A super easy and lightweight javascript animation library. AniX is a lightweight and easy-to-use animation library with excellent perf

Sep 19, 2022

DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:

DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:

DOMPurify DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. It's also very simple to use and get started with

Jan 7, 2023

Super minimal MVC library

Espresso.js Espresso.js is a tiny MVC library inspired by Backbone and React with a focus on simplicity and speed. We've aimed to bring the ideas of u

Dec 11, 2022

ppo is a super small and useful utils library for JavaScript 🐝🐜

ppo is a super small and useful utils library for JavaScript 🐝🐜

Overview Every frontend developer has written his own utils library, and we often write methods that are easily forgotten and highly used. ppo is a su

Jul 21, 2022

Pure CSS animated 3D Super Mario Icon

Pure CSS Super Mario This is the transferred source of a little sideproject I did in 2010. I initially did this without any CSS preprocessor and event

Apr 15, 2021

🍔 A Node.js Serverless Framework for front-end/full-stack developers. Build the application for next decade. Works on AWS, Alibaba Cloud, Tencent Cloud and traditional VM/Container. Super easy integrate with React and Vue. 🌈

🍔 A Node.js Serverless Framework for front-end/full-stack developers. Build the application for next decade. Works on AWS, Alibaba Cloud, Tencent Cloud and traditional VM/Container. Super easy integrate with React and Vue. 🌈

Midway - 一个面向未来的云端一体 Node.js 框架 English | 简体中文 🥳 欢迎观看 Midway Serverless 2.0 发布会回放: https://www.bilibili.com/video/BV17A411T7Md 《Midway Serverless 发布

Jan 8, 2023

Super Fast Complex Object Validator for Javascript(& Typescript).

Super Fast Complex Object Validator for Javascript(& Typescript).

Super Fast Object Validator for Javascript(& Typescript). Safen supports the syntax similar to the type script interface. This makes it easy to create

Nov 25, 2022

A JavaScript, zero-dependency, super small version of IP2Location LITE country lookups.

ip3country This is a zero-dependency, super small, IP address to 2-letter country code lookup library. There are already several libraries available,

Dec 14, 2022

Super Low-Level Raster Reprojection and Resampling Library

geowarp Super Low-Level Raster Reprojection and Resampling Library install npm install -S geowarp usage const geowarp = require("geowarp"); const proj

Nov 9, 2022

A JavaScript, zero-dependency, super small version of IP2Location LITE country lookups.

A JavaScript, zero-dependency, super small version of IP2Location LITE country lookups.

Dec 14, 2022
Comments
  • Allow floats as duration

    Allow floats as duration

    Another shot at https://github.com/gumroad/countdown.js/issues/4. This is extracted from this PR (https://github.com/gumroad/countdown.js/pull/7) and converts the duration instead as @kn had suggested.

    opened by mduvall 1
  • Allow user to specify the step interval

    Allow user to specify the step interval

    I think it would be a nice feature to allow the user the option to specify how often the onTick callback function is called. Completely optional, so it shouldn't break any previous implementations.

    • Defaults to 1 second interval if step parameter is not provided or if invalid value
    • Added test cases
    opened by thgaskell 0
Lightweight and simple JS date formatting and parsing

fecha Lightweight date formatting and parsing (~2KB). Meant to replace parsing and formatting functionality of moment.js. NPM npm install fecha --save

Taylor Hakes 2k Jan 5, 2023
Countdown - jQuery CountDown Clock - Simple countdown plugin for product special offers

TronLink Wallet Address TRX - BTC - BTT - USDT: TH9RyofE7WiDDVVFLMJgFns2ByBRmgQzNB jQuery Countdown Clock jQuery countdown plugin that accounts for ti

E-Piksel 33 Aug 30, 2022
Simple drag and drop with dragula

Drag and drop so simple it hurts Official Angular wrapper for dragula. Notice: v2 has been released It contains a number of breaking changes. Follow t

Valor Software 1.9k Dec 18, 2022
Super-Resolution-CNN - web server for super-resolution CNN

Web Server for Image Super-Resolution This project showcases the Super-Resolution CNN (SRCNN). The model is pretrained following this tutorial. The or

Daniel O'Sullivan 1 Jan 3, 2022
a super simple, no-nonsense diagramming library written in react that just works

Introduction DEMO: http://projectstorm.cloud/react-diagrams DOCS (wip) https://projectstorm.gitbook.io/react-diagrams Docs are currently being worked

Storm 7.4k Jan 4, 2023
Add a super simple rotating text to your website with little to no markup

#Super Simple Text Rotator by Pete R. A light weight jQuery plugin that will allow you to add a super simple rotating text to your website with little

Pete R. 754 Dec 6, 2022
Super simple WYSIWYG editor

Summernote Super simple WYSIWYG Editor. Summernote Summernote is a JavaScript library that helps you create WYSIWYG editors online. Home page: https:/

Summernote 11k Jan 7, 2023
A super simple and lightweight API to get crypto token live information.

TokenStats ?? ?? A super simple and lightweight API to get crypto token live information. APP URL https://tokenstats.herokuapp.com/ Quick Start To get

Abdulfatai Suleiman 21 Jun 28, 2022
A super simple static site generator

Teeny: A simple static site generator ⚠️ Disclaimer: This is a tool I built in a couple of hours to generate my personal blog yakkomajuri.github.io. I

Yakko Majuri 104 Nov 18, 2022
A super simple web3 API to allow crypto interactions with the Solana Network 🔑🌐

orca.js A JavaScript API for web3 Transaction and Authenticating PLEASE NOTE: orca.js is still in development! And comming soon in 2022. Stay tuned on

null 3 Mar 20, 2022