Skip to content

Commit

Permalink
build: release 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Apr 5, 2019
1 parent ba9b353 commit 42e0861
Show file tree
Hide file tree
Showing 10 changed files with 2,025 additions and 2,286 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Changelog

## 1.1.1 (Apr 5, 2019)

- Use `requestAnimationFrame` instead of `setTimeout` for better performance (#33).

## 1.1.0 (Dec 23, 2018)

- Add new `now` option for customizing local time.
- Pause the countdown when page hidden and continue the countdown when page visible again.
- Pause the countdown when the page is hidden and continue the countdown when the page is visible again.

## 1.0.1 (Nov 9, 2018)

Expand Down
42 changes: 27 additions & 15 deletions dist/vue-countdown.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* vue-countdown v1.1.0
* vue-countdown v1.1.1
* https://fengyuanchen.github.io/vue-countdown
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-04-02T10:55:54.517Z
* Date: 2019-04-05T14:29:42.461Z
*/

'use strict';
Expand Down Expand Up @@ -247,20 +247,28 @@ var index = {

var delay = Math.min(this.totalMilliseconds, this.interval);

var step = function step(timestamp) {
if (!_this.stepStart) _this.stepStart = timestamp;

if (timestamp - _this.stepStart < delay) {
_this.timeout = window.requestAnimationFrame(step);
if (delay > 0) {
if (window.requestAnimationFrame) {
var start;

var step = function step(timestamp) {
if (!start) {
start = timestamp;
}

if (timestamp - start < delay) {
_this.requestId = requestAnimationFrame(step);
} else {
_this.progress();
}
};

this.requestId = requestAnimationFrame(step);
} else {
_this.progress();

_this.stepStart = null;
this.timeoutId = setTimeout(function () {
_this.progress();
}, delay);
}
};

if (delay > 0) {
this.timeout = window.requestAnimationFrame(step);
} else {
this.end();
}
Expand All @@ -271,7 +279,11 @@ var index = {
* @private
*/
pause: function pause() {
window.cancelAnimationFrame(this.timeout);
if (window.requestAnimationFrame) {
cancelAnimationFrame(this.requestId);
} else {
clearTimeout(this.timeoutId);
}
},

/**
Expand Down
42 changes: 27 additions & 15 deletions dist/vue-countdown.esm.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* vue-countdown v1.1.0
* vue-countdown v1.1.1
* https://fengyuanchen.github.io/vue-countdown
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-04-02T10:55:54.517Z
* Date: 2019-04-05T14:29:42.461Z
*/

var MILLISECONDS_SECOND = 1000;
Expand Down Expand Up @@ -245,20 +245,28 @@ var index = {

var delay = Math.min(this.totalMilliseconds, this.interval);

var step = function step(timestamp) {
if (!_this.stepStart) _this.stepStart = timestamp;

if (timestamp - _this.stepStart < delay) {
_this.timeout = window.requestAnimationFrame(step);
if (delay > 0) {
if (window.requestAnimationFrame) {
var start;

var step = function step(timestamp) {
if (!start) {
start = timestamp;
}

if (timestamp - start < delay) {
_this.requestId = requestAnimationFrame(step);
} else {
_this.progress();
}
};

this.requestId = requestAnimationFrame(step);
} else {
_this.progress();

_this.stepStart = null;
this.timeoutId = setTimeout(function () {
_this.progress();
}, delay);
}
};

if (delay > 0) {
this.timeout = window.requestAnimationFrame(step);
} else {
this.end();
}
Expand All @@ -269,7 +277,11 @@ var index = {
* @private
*/
pause: function pause() {
window.cancelAnimationFrame(this.timeout);
if (window.requestAnimationFrame) {
cancelAnimationFrame(this.requestId);
} else {
clearTimeout(this.timeoutId);
}
},

/**
Expand Down
42 changes: 27 additions & 15 deletions dist/vue-countdown.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* vue-countdown v1.1.0
* vue-countdown v1.1.1
* https://fengyuanchen.github.io/vue-countdown
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-04-02T10:55:54.517Z
* Date: 2019-04-05T14:29:42.461Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -251,20 +251,28 @@

var delay = Math.min(this.totalMilliseconds, this.interval);

var step = function step(timestamp) {
if (!_this.stepStart) _this.stepStart = timestamp;

if (timestamp - _this.stepStart < delay) {
_this.timeout = window.requestAnimationFrame(step);
if (delay > 0) {
if (window.requestAnimationFrame) {
var start;

var step = function step(timestamp) {
if (!start) {
start = timestamp;
}

if (timestamp - start < delay) {
_this.requestId = requestAnimationFrame(step);
} else {
_this.progress();
}
};

this.requestId = requestAnimationFrame(step);
} else {
_this.progress();

_this.stepStart = null;
this.timeoutId = setTimeout(function () {
_this.progress();
}, delay);
}
};

if (delay > 0) {
this.timeout = window.requestAnimationFrame(step);
} else {
this.end();
}
Expand All @@ -275,7 +283,11 @@
* @private
*/
pause: function pause() {
window.cancelAnimationFrame(this.timeout);
if (window.requestAnimationFrame) {
cancelAnimationFrame(this.requestId);
} else {
clearTimeout(this.timeoutId);
}
},

/**
Expand Down
6 changes: 3 additions & 3 deletions dist/vue-countdown.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="Countdown component for Vue.js.">
<meta name="author" content="Chen Fengyuan">
<title>vue-countdown</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/styles/github.css">
<link rel="stylesheet" href="css/main.css">
</head>
Expand All @@ -33,7 +33,7 @@
<div class="container">
<div class="row">
<div class="col-md">
<h1>vue-countdown <small class="h6">v1.1.0</small></h1>
<h1>vue-countdown <small class="h6">v1.1.1</small></h1>
<p class="lead">Countdown component for Vue.js.</p>
</div>
<div class="col-md">
Expand Down Expand Up @@ -122,11 +122,12 @@ <h6>JavaScript:</h6>
</footer>

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
<script src="https://unpkg.com/vue@2/dist/vue.min.js"></script>
<script src="https://unpkg.com/[email protected]/highlight.pack.js"></script>
<script src="https://fengyuanchen.github.io/shared/google-analytics.js"></script>
<script src="js/vue-countdown.js"></script>
<script src="js/main.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
4 changes: 0 additions & 4 deletions docs/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,4 @@ window.onload = function () {
},
}
});

if (typeof hljs !== 'undefined') {
hljs.initHighlightingOnLoad();
}
};
42 changes: 27 additions & 15 deletions docs/js/vue-countdown.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* vue-countdown v1.1.0
* vue-countdown v1.1.1
* https://fengyuanchen.github.io/vue-countdown
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-04-02T10:55:54.517Z
* Date: 2019-04-05T14:29:42.461Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -251,20 +251,28 @@

var delay = Math.min(this.totalMilliseconds, this.interval);

var step = function step(timestamp) {
if (!_this.stepStart) _this.stepStart = timestamp;

if (timestamp - _this.stepStart < delay) {
_this.timeout = window.requestAnimationFrame(step);
if (delay > 0) {
if (window.requestAnimationFrame) {
var start;

var step = function step(timestamp) {
if (!start) {
start = timestamp;
}

if (timestamp - start < delay) {
_this.requestId = requestAnimationFrame(step);
} else {
_this.progress();
}
};

this.requestId = requestAnimationFrame(step);
} else {
_this.progress();

_this.stepStart = null;
this.timeoutId = setTimeout(function () {
_this.progress();
}, delay);
}
};

if (delay > 0) {
this.timeout = window.requestAnimationFrame(step);
} else {
this.end();
}
Expand All @@ -275,7 +283,11 @@
* @private
*/
pause: function pause() {
window.cancelAnimationFrame(this.timeout);
if (window.requestAnimationFrame) {
cancelAnimationFrame(this.requestId);
} else {
clearTimeout(this.timeoutId);
}
},

/**
Expand Down
Loading

0 comments on commit 42e0861

Please sign in to comment.