1.0.18 • Published 5 years ago

kaguya-clock v1.0.18

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

A simple plugin of clock,support dial mode and digital mode.

Demo

  • Install

NPM

$npm install kaguya-clock 

or

<script type="text/javascript" src="/dist/clock.js"></script>
  • API
keyvaluedescription
selector'.clock'the root node
type'dial'/'digital'mode type
draggabletrue/falsedraggable
renderType'css'/'canvas'render type
color'#fff'/'rgba(255,255,255,1)'the stroke color
bgColor'#fff'/'rgba(255,255,255,1)'the bgcolor
dial.hasTimeLabeltrue/falseset TimeLabel
dial.hasTimeLabeltrue/falseset broder
digitalobjectdigital config
digital.fontSize12fontsize of digital
digital.fontFamily'Arial'fontfamily of digital
digital.hasDaytrue/falseis show day
const clock = new Clock({
    selector: '.clock',
    type: 'dial',
    renderType: 'css',
    color: '#fff',
    draggable: true,
    bgColor: 'rgba(0, 0, 0, .35)',
    dial: {
        hasTimeLabel: true,
        hasBorder: true,
    },
    digital: {
        fontSize: 24,
        fontFamily: 'Arial',
        hasDay: true,
    },
}); 
  • warn

the dial css type force hide the timeLabel while the container's size less than 80px, if you want to show it you can choose canvas type or change the condition in dial.js.

  • TODO List
  • canvas mode
  • timelabel mode
  • show week and month
  • performance optimization
  • drag mode

if you want to contribute code view build

1.0.18

5 years ago

1.0.17

5 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago