Skip to content

Commit

Permalink
Bump version for #285, improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
inorganik committed Jun 27, 2022
1 parent e24cc69 commit c623142
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CountUp.js supports all browsers. MIT license.

## [Try the demo](https://inorganik.github.io/countUp.js)

Or tinker with CountUp in [Stackblitz](https://stackblitz.com/edit/countup-typescript)

## Jump to:

Expand Down Expand Up @@ -34,7 +35,7 @@ CountUp.js supports all browsers. MIT license.

## Usage:

**On npm**: `countup.js`
**On npm** as: `countup.js`. You can import as a module or include the UMD script and access CountUp as a global. See [detailed instructions](#including-countup) below.

**Params**:
- `target: string | HTMLElement | HTMLInputElement` - id of html element, input, svg text element, or DOM element reference where counting occurs
Expand Down
5 changes: 3 additions & 2 deletions dist/countUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var CountUp = /** @class */ (function () {
var _this = this;
this.endVal = endVal;
this.options = options;
this.version = '2.2.0';
this.version = '2.3.0';
this.defaults = {
startVal: 0,
decimalPlaces: 0,
Expand Down Expand Up @@ -158,7 +158,8 @@ var CountUp = /** @class */ (function () {
if (!self || !window || self.once)
return;
var bottomOfScroll = window.innerHeight + window.scrollY;
var bottomOfEl = self.el.offsetTop + self.el.offsetHeight;
var rect = self.el.getBoundingClientRect();
var bottomOfEl = rect.top + rect.height + window.pageYOffset;
if (bottomOfEl < bottomOfScroll && bottomOfEl > window.scrollY && self.paused) {
// in view
self.paused = false;
Expand Down
2 changes: 1 addition & 1 deletion dist/countUp.min.js

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

5 changes: 3 additions & 2 deletions dist/countUp.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
var _this = this;
this.endVal = endVal;
this.options = options;
this.version = '2.2.0';
this.version = '2.3.0';
this.defaults = {
startVal: 0,
decimalPlaces: 0,
Expand Down Expand Up @@ -164,7 +164,8 @@
if (!self || !window || self.once)
return;
var bottomOfScroll = window.innerHeight + window.scrollY;
var bottomOfEl = self.el.offsetTop + self.el.offsetHeight;
var rect = self.el.getBoundingClientRect();
var bottomOfEl = rect.top + rect.height + window.pageYOffset;
if (bottomOfEl < bottomOfScroll && bottomOfEl > window.scrollY && self.paused) {
// in view
self.paused = false;
Expand Down
Loading

0 comments on commit c623142

Please sign in to comment.