Giter Club home page Giter Club logo

reverse-alarm-clock's Introduction

#Reverse Alarm Clock Bookmarklet#

This bookmarklet and JS library allows the user to input how much time they want that tab to remain open (in the format of 'X hours Y minutes Z seconds'. With the default being minutes if not specified.) After the time limit has expired the tab the bookmarklet was used on will close.

UI of previous version

I made this tool, because I really needed it and it didn't exist. I use it when I want to listen to music or watch something while falling asleep. I find that backgroud noise helps me go to sleep, but I hate being woken up hours later when a movie, or song suddenly gets very loud. This tool allows me to fall asleep to the content in my tab but have it close some time later once I am already asleep.

###Buidling###

$ git clone https://github.com/Samangan/reverse-alarm-clock.git

$ npm install

$ npm install -g grunt-cli

$ npm install -g buster

Now lint, build, and create the minified file for the bookmarklet with:

grunt

###Testing###

To test setup the buster server by using

buster-server

and then navigate to http://localhost:1111 and capture as many browsers as you want to test. Then call buster-test to run the tests (or use . See here for more information on buster browser testing.

####Building note for Windows Users####

Use git bash to emulate a unix terminal. Buster does not work in Windows at the moment, but I have tested that everything works in windows using the git for windows terminal.

###Usage###

####As a JS library####

Call reverseAlarm.promptUserForTime( ) to open the dialog window to allow the user to select the time until the tab closes.

Call reverseAlarm.startCountDown( ) to start counting down until the tab closes.

An example of how to use all of the functions is in the bookmarklet code.

TODO: Document the rest of the functions here (this is meant to be modularized).

####As a bookmarklet####

Add the minified version of the bookmarklet in [found here](update with real address) to your bookmarks. Then just press it on the page you wish.

###TODO###

  • setup the bookmarklet code (this will have a UI and be an example of how to use the library)
  • Improve UI (Should I have a better interface for inputting time? Should I allow for more types of time inputs? --> Yes)
  • Update UI image in this readme + update the link to the minified bookmarklet in this readme
  • Put a full guide on using git bash + node in windows environment with this project as an example (put on blog)

reverse-alarm-clock's People

Contributors

de-husk avatar

Watchers

James Cloos avatar

reverse-alarm-clock's Issues

Input Bug Causes Page to Immediately Close

The following input 999 hour 1234 minutes 23 seconds causes the page to close immediately.

I have a test case that ensures that reverseAlarm._updateTime( ) is handling the value properly. The milliseconds timeout value is also not anywhere near the maximum Number value. It is only 3670463000.

I think the setInterval( ) or setTimeout( ) functions have some weird functionality for larger numbers. I need to look into 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.