Skip to content

Commit

Permalink
style: remove lite size style. close #6
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Dec 9, 2017
1 parent 5930029 commit 67a41bb
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 76 deletions.
11 changes: 0 additions & 11 deletions CHANGELOG.md

This file was deleted.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Simple, easy and performance countdown for angular
[![NPM version](https://img.shields.io/npm/v/ngx-countdown.svg)](https://www.npmjs.com/package/ngx-countdown)
[![Build Status](https://travis-ci.org/cipchk/ngx-countdown.svg?branch=master)](https://travis-ci.org/cipchk/ngx-countdown)

Version:
| Angular Version | ngx-countdown |
| --------------- | ------------- |
| Angular5 | [![NPM version](https://img.shields.io/npm/v/ngx-countdown.svg)](https://www.npmjs.com/package/ngx-countdown) |
| Angular4 | `1.0.5` |

## Demo

[Live Demo](https://cipchk.github.io/ngx-countdown/)
Expand Down Expand Up @@ -32,7 +38,7 @@ export class AppModule { }
### 2、Template

```html
<countdown [config]="config"
<countdown [config]="config"
(start)="onStart()"
(finished)="onFinished()"
(notify)="onNotify($event)"></countdown>
Expand Down
2 changes: 1 addition & 1 deletion demo/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { HighlightJsModule } from 'ngx-highlight-js';
import { NotifyModule } from 'ngx-notify';
import { TabsModule } from 'ngx-bootstrap/tabs';

import { CountdownModule } from 'ngx-countdown';
import { CountdownModule } from '../../../src/index';

import { AppComponent } from './app.component';
import { LayoutComponent } from './components/layout.component';
Expand Down
2 changes: 1 addition & 1 deletion demo/src/app/components/demo.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* tslint:disable */
import { Component, OnInit, ViewEncapsulation, AfterViewInit, ViewChild, ElementRef } from '@angular/core';
import { NotifyService } from 'ngx-notify';
import { CountdownComponent } from 'ngx-countdown';
import { CountdownComponent } from '../../../../src/index';

@Component({
selector: 'demo',
Expand Down
80 changes: 40 additions & 40 deletions demo/src/app/tpl/flip/flip.component.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import { Component, ViewEncapsulation } from '@angular/core';
import { Config } from "ngx-countdown";

@Component({
selector: 'demo-tpl-flip',
templateUrl: './flip.component.html',
styleUrls: [ './flip.component.scss' ],
encapsulation: ViewEncapsulation.None
})
export class TplFlipComponent {
config: Config = {
leftTime: 60 * 60 * 24 * 7,
className: 'flip-cd',
repaint: function() { // 这里不可以使用箭头函数,因为对于箭头函数this是强制性的,为了让重绘有更大的权限,必须是function
let me:any = this,
content: string;
me.hands.forEach((hand: any) => {
if (hand.lastValue !== hand.value) {
content = '';
let cur = me.toDigitals(hand.value + 1, hand.bits).join(''),
next = me.toDigitals(hand.value, hand.bits).join('');

hand.node.innerHTML = `
<span class="count curr top">${cur}</span>
<span class="count next top">${next}</span>
<span class="count next bottom">${next}</span>
<span class="count curr bottom">${cur}</span>
`;
hand.node.parentElement.className = 'time';
setTimeout(() => {
hand.node.parentElement.className = 'time flip';
});
}
});
},
}

}
import { Component, ViewEncapsulation } from '@angular/core';
import { Config } from '../../../../../src/index';

@Component({
selector: 'demo-tpl-flip',
templateUrl: './flip.component.html',
styleUrls: [ './flip.component.scss' ],
encapsulation: ViewEncapsulation.None
})
export class TplFlipComponent {

config: Config = {
leftTime: 60 * 60 * 24 * 7,
className: 'flip-cd',
repaint: function() { // 这里不可以使用箭头函数,因为对于箭头函数this是强制性的,为了让重绘有更大的权限,必须是function
const me: any = this;
let content: string;

me.hands.forEach((hand: any) => {
if (hand.lastValue !== hand.value) {
content = '';
let cur = me.toDigitals(hand.value + 1, hand.bits).join(''),
next = me.toDigitals(hand.value, hand.bits).join('');

hand.node.innerHTML = `
<span class="count curr top">${cur}</span>
<span class="count next top">${next}</span>
<span class="count next bottom">${next}</span>
<span class="count curr bottom">${cur}</span>
`;
hand.node.parentElement.className = 'time';
setTimeout(() => {
hand.node.parentElement.className = 'time flip';
});
}
});
},
}

}
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-countdown",
"version": "1.0.5",
"version": "2.0.1",
"main": "./bundles/ngx-countdown.umd.js",
"typings": "index.d.ts",
"description": "Simple, easy and performance countdown for angular",
Expand All @@ -23,10 +23,9 @@
},
"homepage": "https://github.com/cipchk/ngx-countdown#readme",
"scripts": {
"demo.serve": "run-s build link demo.build",
"demo.gh-pages": "run-s build demo.build demo.deploy",
"demo.build": "ng build -prod",
"demo.gh-pages": "run-s demo.build demo.deploy",
"demo.deploy": "gh-pages -d demo/dist",
"demo.build": "ng build -prod",
"link": "ngm link -p src --here",
"lint": "exit 0",
"build": "ngm build -p src --clean",
Expand Down Expand Up @@ -103,7 +102,7 @@
"rimraf": "^2.6.2",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-replace": "^2.0.0",
"rxjs": "^5.5.2",
"rxjs": "^5.5.5",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2",
Expand Down
34 changes: 17 additions & 17 deletions src/components/component.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
.count-down {
display: none;
color: #808080;
font-size: 12px;
font-family: arial;
span {
text-decoration: none;
}
.clock {
font-weight: bold;
}
.hand {
margin: 0 3px;
}
.digital {
color: #f60;
font-size: 14px;
font-weight: normal;
}
// color: #808080;
// font-size: 12px;
// font-family: arial;
// span {
// text-decoration: none;
// }
// .clock {
// font-weight: bold;
// }
// .hand {
// margin: 0 3px;
// }
// .digital {
// color: #f60;
// font-size: 14px;
// font-weight: normal;
// }
&.lite {}
&.medium {
.digital {
Expand Down

0 comments on commit 67a41bb

Please sign in to comment.