Skip to content

Commit

Permalink
Merge pull request #91 from scriptex/bugfix/umd
Browse files Browse the repository at this point in the history
Fix UMD module
  • Loading branch information
scriptex authored Aug 20, 2020
2 parents c9de14d + f67179c commit 1cb524c
Show file tree
Hide file tree
Showing 11 changed files with 206 additions and 120 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ node_js:
install:
- yarn
script:
- yarn build
- yarn prod
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,47 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [2.1.0](https://github.com/scriptex/AnimateMe/compare/2.0.0...2.1.0)

> 20 August 2020
- Update dependency release-it to v13.6.8 [`#90`](https://github.com/scriptex/AnimateMe/pull/90)
- Update dependency release-it to v13.6.7 [`#88`](https://github.com/scriptex/AnimateMe/pull/88)
- Update README.md [`#89`](https://github.com/scriptex/AnimateMe/pull/89)
- Update dependency release-it to v13.6.6 [`#87`](https://github.com/scriptex/AnimateMe/pull/87)
- Update dependency typescript to v3.9.7 [`#86`](https://github.com/scriptex/AnimateMe/pull/86)
- Bump lodash from 4.17.15 to 4.17.19 [`#85`](https://github.com/scriptex/AnimateMe/pull/85)
- Update dependency release-it to v13.6.5 [`#84`](https://github.com/scriptex/AnimateMe/pull/84)
- Update renovate.json [`#83`](https://github.com/scriptex/AnimateMe/pull/83)
- Update dependency typescript to v3.9.6 [`#82`](https://github.com/scriptex/AnimateMe/pull/82)
- Build as UMD module [`75152d8`](https://github.com/scriptex/AnimateMe/commit/75152d812f568638a5df1d9216ca2e1d713de4aa)
- Release 2.1.0 [`4fe6330`](https://github.com/scriptex/AnimateMe/commit/4fe63303e3070505e2f370ee43e0615bc45e5569)

### [2.0.0](https://github.com/scriptex/AnimateMe/compare/1.2.0...2.0.0)

> 1 July 2020
- Migrate to TypeScript [`#49`](https://github.com/scriptex/AnimateMe/pull/49)
- Update babel monorepo to v7.10.4 [`#81`](https://github.com/scriptex/AnimateMe/pull/81)
- Update dependency release-it to v13.6.4 [`#80`](https://github.com/scriptex/AnimateMe/pull/80)
- Update babel monorepo to v7.10.3 [`#79`](https://github.com/scriptex/AnimateMe/pull/79)
- Update dependency release-it to v13.6.3 [`#78`](https://github.com/scriptex/AnimateMe/pull/78)
- Update dependency release-it to v13.6.2 [`#77`](https://github.com/scriptex/AnimateMe/pull/77)
- Update babel monorepo to v7.10.2 [`#76`](https://github.com/scriptex/AnimateMe/pull/76)
- Update babel monorepo to v7.10.1 [`#75`](https://github.com/scriptex/AnimateMe/pull/75)
- Update babel monorepo to v7.10.0 [`#74`](https://github.com/scriptex/AnimateMe/pull/74)
- Update dependency release-it to v13.6.1 [`#73`](https://github.com/scriptex/AnimateMe/pull/73)
- Update dependency release-it to v13.6.0 [`#70`](https://github.com/scriptex/AnimateMe/pull/70)
- Update dependency release-it to v13.5.8 [`#69`](https://github.com/scriptex/AnimateMe/pull/69)
- Update babel monorepo to v7.9.6 [`#68`](https://github.com/scriptex/AnimateMe/pull/68)
- Update dependency release-it to v13.5.7 [`#67`](https://github.com/scriptex/AnimateMe/pull/67)
- Update dependency release-it to v13.5.6 [`#66`](https://github.com/scriptex/AnimateMe/pull/66)
- Update dependency release-it to v13.5.5 [`#65`](https://github.com/scriptex/AnimateMe/pull/65)
- Update dependency release-it to v13.5.4 [`#64`](https://github.com/scriptex/AnimateMe/pull/64)
- Improve build [`cb7bc17`](https://github.com/scriptex/AnimateMe/commit/cb7bc175225a9aa53ab7de31ea984a20e7e038a9)
- Merge with master [`affc2b8`](https://github.com/scriptex/AnimateMe/commit/affc2b8bd3356bd3c065059d93ca7c67d630f177)
- Update src and dist [`742b988`](https://github.com/scriptex/AnimateMe/commit/742b9887f57703d01373fd15e52e3b795b908457)

#### [1.2.0](https://github.com/scriptex/AnimateMe/compare/1.1.0...1.2.0)

> 16 April 2020
Expand Down
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ and create a new instance with the default settings
new AnimateMe();
```

or use your own settings
or use your own options

```javascript
new AnimateMe('.your-element', {
Expand All @@ -76,7 +76,32 @@ or just use it as a good old `<link>` tag.

**Note**

Using `AnimateMe` via a good old `<script>` tag is currently not supported. Please use a module bundler such as Webpack, Parcel, Rollup or Browserify.
Using `AnimateMe` via a good old `<script>` tag is currently supported only using helper libraries such as `requirejs`, `systemjs`, etc.

```html
<!-- Import the Require JS script -->
<script src="https://unpkg.com/requirejs"></script>

<!-- Then require the AnimateMe script from your local folder and use it -->
<script>
require(['./your/scripts/folder/animate.me.js'], function ({ AnimateMe }) {
new AnimateMe();
// or with custom options
new AnimateMe('.your-element', {
offset: 0.8,
reverse: false,
animatedIn: 'your-custom-class',
offsetAttr: 'data-offset-top',
animationAttr: 'data-animation-name',
touchDisabled: false
});
});
</script>
```

For the best experience please use a module bundler such as Webpack, Parcel, Rollup or Browserify.

---

Expand Down
6 changes: 4 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@

<div class="animate-me" style="background-color: lavender;">5th section</div>

<script src="../dist/animate.me.js"></script>
<script src="https://unpkg.com/requirejs"></script>

<script>
new AnimateMe();
require(['../dist/animate.me.js'], function ({ AnimateMe }) {
new AnimateMe();
});
</script>
</body>
</html>
5 changes: 3 additions & 2 deletions dist/animate.me.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
interface AnimateMeOptions {
export interface AnimateMeOptions {
offset?: number;
readonly reverse?: boolean;
readonly animatedIn?: string;
readonly offsetAttr?: string;
readonly animationAttr?: string;
readonly touchDisabled?: boolean;
}
declare class AnimateMe {
export declare class AnimateMe {
private win;
private winO;
private winH;
Expand All @@ -29,3 +29,4 @@ declare class AnimateMe {
private animate;
private updateOffsets;
}
export default AnimateMe;
216 changes: 115 additions & 101 deletions dist/animate.me.js

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

Loading

0 comments on commit 1cb524c

Please sign in to comment.