Giter VIP home page Giter VIP logo

cantwait's Introduction

Build Status

Can't wait!

This is a small web application computing time remaining between events, intended to learn and play with recent features of the JavaScript Web APIs.

Usage

Simply try the demo at https://astorije.github.io/cantwait/, or clone the repository and open the index page in your browser.

Add timed events in the numbered fields. Click on Compute and see the magic happen.

For example, try these well-known values.

Is that useful?

Not really. Something cool was going to happen soon. Every day I was counting how much time was remaining until then as well as the current progress. I used this as an excuse to play with some of the recent JavaScript APIs for the web and other stuff like:

  • History API
  • Date manipulation in JavaScript
  • Bootstrap 3
  • Latest CSS Selectors
  • Functional programming principles applied in JavaScript
  • JSDoc
  • Testing in JavaScript

This was also a way to refresh my JavaScript. All of this was done in Vanilla JS.

Tests

In the browser

Open test/index.html in your browser (or https://astorije.github.io/cantwait/test/) and look at all these tests gracefully pass.

If they don't, please report a bug.

On the command line

Run the following:

npm install
npm test

This is also used for continuous integration.

Caveat: Since a headless WebKit is used for this, tests may pass in the console but fail in your actual browser.

Update test libraries

It is a good idea to update the test libraries from time to time, since they are not part of the package.json file (automating this part with Grunt or similar would be overkill...).

To do so, run the following, and then commit the changes:

npm install mocha chai
cp node_modules/{mocha/mocha.{js,css},chai/chai.js} test/
npm uninstall mocha chai

Documentation

The API documentation can be seen when opening doc/global.html in your browser, or at https://astorije.github.io/cantwait/doc/global.html.

Generate the documentation

To generate the documentation, run the following, and then commit the changes:

npm install
npm run doc

Compatibility

Because I used the experimental ChildNode.remove(), browser compatibility of Can't Wait! is limited.

As far as I know, it looks like this:

  • Chrome 23 and up is compatible
  • Firefox 23.0 and up is compatible
  • Opera 10.0 and up is compatible
  • Internet Explorer is not compatible
  • Safari is not compatible

Because I do not plan to use Internet Explorer or Safari anytime soon and, let's face it, nobody else will actually use Can't Wait!, I will not try to fix this.

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.