Giter Club home page Giter Club logo

angular-clock's Introduction

Angular Clock Widget

Responsive, beautiful clocks for AngularJS built using SVG

Demo & Documentation

Getting started

Dependencies

This repository contains native AngularJS directives to render a clock face. The only required dependencies are:

  • AngularJS (tested with 1.3.14 although it probably works with older versions)

Installation

bower install angular-ui-clock --save

Alternatively files can be downloaded downloaded from Github. and copy the files from dist/. Then add the sources to your code (adjust paths as needed) after adding the dependencies for Angular first:

<script src="../bower_components/angular/angular.min.js"></script>
<script src="/bower_components/angular-clock/dist/angular-clock.js"></script>

Whichever method you choose the good news is that the overall size is very small: < 4kb for all directives (~1kb with gzip compression!)

As soon as you've got all the files downloaded and included in your page you just need to declare a dependency on the ds.clock module:

angular.module('myModule', ['ds.clock']);

CSS

You need to include a link to the css file in your page.

<link rel="stylesheet" href="bower_components/dist/angular-clock.css">

If you need the default digital clock font Syncopate, include this. Else check styling section to use your own font

<link href='//fonts.googleapis.com/css?family=Syncopate:400,700' rel='stylesheet' type='text/css'>

Options

There are several options that you can set as attributes on the directive element

  1. start-time : init clock with specific time in milliseconds, (default: undefined)
  2. digital-format : digital clock format in angular date filter format (default: 'HH-mm-ss'). Pass as string enclosed in single quate
  3. gmt-offset : shows time for the given GMT offset in clock, (default: false, shows local time) example: India -> 5.30, Singapore -> 8 , venezula -> -4.30, Nepal -> 5.45
  4. show-digital: shows digital clock, (default: true if both show-analog &show-digital are not set)
  5. show-analog : shows analog clock, (default: true if both show-analog &show-digital are not set)
  6. show-gmt-info : shows GMT offset value, (default: false)
  7. theme : analog clockface theme, (default: light)

Browser compatibility

For IE8 and older browsers, you will need SVG polyfills and Shims

Example

Markup

<ds-widget-clock theme="dark" show-secs="true" digital-format="'hh:mm:ss a'"></ds-widget-clock>

Reactive & Responsive

angular clock widget is reactive and fully responsive

Issues

Please check if issue exists and otherwise open issue in github

Please add a link to a plunker, jsbin, or equivalent.

Contributing

Pull requests welcome!

  1. Fork the repo
  2. Make your changes
  3. Write unit tests under test directory
  4. Update examples under examples directory
  5. Run tests: npm test, gulp test
  6. Submit pull request

Contributors

Thank you!

Author

Designed and built by Deepu K Sasidharan

Issues

Inspired from this demo.

License

angular-clock.js is available under the MIT license.

angular-clock's People

Contributors

animir avatar deepu105 avatar lhas-dev avatar rezass avatar tsekityam avatar zack9433 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-clock's Issues

Dynamically Adding Clock(s)

I have an add button. I would like it so when that add button is pushed a clock appears. Currently when i click my add button it adds an [[object HTMLElement]]

Here is my code currently. Any help would be appreciated.
image

the css path in README seems wrong.

README: import css by

<link rel="stylesheet" href="bower_components/dist/angular-clock.css">

i installed by bower install angular-ui-clock --save
the css file shows at bower_components/angular-ui-clock/dist/angular-clock.css
Environment:
OS: macOS 10.13.4
bower version: 1.8.3

Digital Clock Doesnt Update When using gmt-offset

I have a Analog + Digital Clock showing via this HTML:

<ds-widget-clock theme="light" show-secs="true" gmt-offset="-5" show-analog show-digital digital-format="'hh:mm:ss a'" ></ds-widget-clock>

The analog clock is correct, however, the digital clock shows the wrong hour.

Change Time on started

The plugin is not updating once it's started if we update the $scope.startTimeValue.
If we change the $scope.gmtValue then only it's updating.

Negative GMT offset

Negative gmt offset returns time with many hours difference. Is there any solution for that?

Updating time when start-time value is changed

I get my start-time value from an HTTP get request and by the time request is answered, clock starts working and there is no way to update it based on changed start-time value.

I created #16 to fix my issue.

Fixed Time Clock?

Nice clock! I was searching for this for a long while.

What I need is not a moving time clock but a representation of a specific time in analog form.

My suggestion is to add an attribute "live" as:

<ds-widget-clock start-time="10800000" live="false"></ds-widget-clock> (time in milliseconds right?)

This would show a clock fixed at 3.

It will allow much more versatility in what your clock can do.

Difference between analog and digital

Hi,
Just started working with your custom directive. When setting a custom GMT value, the digital value updates correctly, the analog however does now. Any ideas what could be causing this?

Thanks in advance.
Tolga

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.