Skip to content

Commit f160400

Browse files
committed
Rename PageAnimation to Pangea
1 parent f257b7d commit f160400

File tree

5 files changed

+45
-45
lines changed

5 files changed

+45
-45
lines changed

.jshintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"browser": true,
33
"browserify": true,
44
"devel": true,
5-
"predef": [ "PageAnimation" ]
5+
"predef": [ "Pangea" ]
66
}

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
pageanimation.js
2-
===========================
1+
pangea.js
2+
=========
33

44
Choreograph elegant, performant exit animations on the web. This library is design from a "less is more" additude in regards to JavaScript code. Animations are expected to be implemented separately, using pure CSS transitions & animations.
55

@@ -12,8 +12,8 @@ Choreograph elegant, performant exit animations on the web. This library is desi
1212
#### Step 1: Write your markup
1313

1414
```html
15-
<!-- 1. Include the pageanimation.js library -->
16-
<script src="pageanimation.min.js"></script>
15+
<!-- 1. Include the pangea.js library -->
16+
<script src="pangea.min.js"></script>
1717

1818
<!-- 2. Tag an element as being the last to animate, using any ID you see fit -->
1919
<h1>Test webpage</h1>
@@ -43,7 +43,7 @@ h1, p {
4343
* Example animation styles.
4444
*
4545
* Here, we fade out text and fade the background to black when the
46-
* PageAnimation library gives the body the animating-to-about-page class.
46+
* Pangea library gives the body the animating-to-about-page class.
4747
*/
4848
body.animating-to-about-page {
4949
background-color: black;
@@ -63,17 +63,17 @@ body.animating-to-about-page p {
6363
* animating-to-about-page class. When the element with ID last-to-animate
6464
* is done transitioning, we will navigate to the /about page.
6565
*/
66-
var animation = new PageAnimation()
66+
var pangea = new Pangea()
6767
.register(/\/about/, 'last-to-animate', 'animating-to-about-page')
6868
.enable();
6969
```
7070

7171

7272
## API
7373

74-
### PageAnimation([_options_])
74+
### Pangea([_options_])
7575

76-
The `PageAnimation`constructor will setup a new page animation manager instances. Returns a new instance of the `PageAnimation` class.
76+
The `Pangea`constructor will setup a new page animation manager instances. Returns a new instance of the `Pangea` class.
7777

7878
You can customize the instance by passing the `options` parameter. The example below uses all options and their defaults:
7979

@@ -87,7 +87,7 @@ var opts = {
8787
beforeAnimationStart: function() {},
8888
onTransitionEnd: function() {},
8989
};
90-
var pageAnimation = new PageAnimation(opts)
90+
var pangea = new Pangea(opts)
9191
```
9292

9393
##### `options`
@@ -158,12 +158,12 @@ Register a new animation on this page.
158158
159159
#### `options.shouldScroll`
160160
> **Type**: `bool`
161-
> **Defualt**: The value of `options.shouldScroll` passed into `PageAnimation()`.
161+
> **Defualt**: The value of `options.shouldScroll` passed into `Pangea()`.
162162
> **Description**: Whether or not we should scroll the page as part of this animation.
163163
164164
#### `options.scrollTiming`
165165
> **Type**: `bool`
166-
> **Default**: the value of `options.scrollTiming` passed into `PageAnimation()`.
166+
> **Default**: the value of `options.scrollTiming` passed into `Pangea()`.
167167
> **Description**: The scroll timing for this animation
168168
> **Options**:
169169
>
@@ -172,18 +172,18 @@ Register a new animation on this page.
172172
> - `"after"`: scroll once the animations are complete
173173
174174
### deregister(_urlRegex_)
175-
Deregisters the animation for the passed `urlRegex`. Returns the PageAnimation instance.
175+
Deregisters the animation for the passed `urlRegex`. Returns the Pangea instance.
176176

177177
#### `urlRegex`
178178
> **Type**: `string`
179-
> **Description** The same pattern that was passed into `PageAnimation.register()`.
179+
> **Description** The same pattern that was passed into `Pangea.register()`.
180180
181181
### enable()
182182

183-
Enable the PageAnimation library by beginning to listen to click events, running animations appropriately.
183+
Enable the Pangea library by beginning to listen to click events, running animations appropriately.
184184

185185
### disable()
186186

187-
Disable the PageAnimation library by removing event listeners set in `PageAnimation.enable()`.
187+
Disable the Pangea library by removing event listeners set in `Pangea.enable()`.
188188

189-
[download]: https://github.com/minimill/pageanimation.js/releases/download/v0.1/pageanimation.min.js
189+
[download]: https://github.com/minimill/pangea.js/releases/download/v0.1/pangea.min.js

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "pageanimation.js",
2+
"name": "pangea.js",
33
"version": "0.1.0",
44
"description": "Choreograph elegant, performant exit animations on the web",
5-
"repository": "https://github.com/minimill/pageanimation.js",
5+
"repository": "https://github.com/minimill/pangea.js",
66
"devDependencies": {
77
"gulp": "^3.9.0",
88
"gulp-jscs": "^3.0.1",

src/pageanimation.js src/pangea.js

+25-25
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
}
6666

6767
/**
68-
* The PageAnimation constructor
68+
* The Pangea constructor
6969
*
7070
* @param {Object} options - Configuration options
7171
* @param {bool} options.shouldScroll - whether or we should scroll the page
@@ -93,7 +93,7 @@
9393
* @param {function} options.onTransitionEnd - a function to run once the
9494
* animation is complete.
9595
*/
96-
function PageAnimation(options) {
96+
function Pangea(options) {
9797

9898
var opts = options || {};
9999

@@ -142,19 +142,19 @@
142142
* @param {Object} options - Configuration options
143143
* @param {bool} options.shouldScroll - whether or not we should scroll the
144144
* page as part of this animation.
145-
* defualt: the value of options.shouldScroll passed into PageAnimation()
145+
* defualt: the value of options.shouldScroll passed into Pangea()
146146
* @param {bool} options.scrollTiming - the scroll timing for this animation
147147
* options:
148148
* 'before': scroll the page before starting animations
149149
* 'during': scroll the page and start the animations at the same time
150150
* 'after': scroll once the animations are complete
151-
* default: the value of options.scrollTiming passed into PageAnimation()
151+
* default: the value of options.scrollTiming passed into Pangea()
152152
* @param {Number} options.scrollDuration - the scroll speed in ms.
153-
* default: the value of options.scrollDuration passed into PageAnimation()
153+
* default: the value of options.scrollDuration passed into Pangea()
154154
*
155-
* @returns the new PageAnimation instance.
155+
* @returns the new Pangea instance.
156156
*/
157-
PageAnimation.prototype.register = function(urlRegex, finalElementId, bodyClass, options) {
157+
Pangea.prototype.register = function(urlRegex, finalElementId, bodyClass, options) {
158158
// Create the animation
159159
var opts = options || {};
160160
var animation = {
@@ -183,11 +183,11 @@
183183
* Deregisters the animation for the passed urlRegex
184184
*
185185
* @param {string} urlRegex - the same pattern that was passed into
186-
* PageAnimation.register()
186+
* Pangea.register()
187187
*
188-
* @returns the PageAnimation instance.
188+
* @returns the Pangea instance.
189189
*/
190-
PageAnimation.prototype.deregister = function(urlRegex) {
190+
Pangea.prototype.deregister = function(urlRegex) {
191191
if (!this.animations[urlRegex]) {
192192
console.error('No animation registered with regex ' + urlRegex);
193193
}
@@ -199,20 +199,20 @@
199199
};
200200

201201
/**
202-
* Enable the PageAnimation library by beginning to listen to click events,
202+
* Enable the Pangea library by beginning to listen to click events,
203203
* running animations appropriately.
204204
*/
205-
PageAnimation.prototype.enable = function() {
205+
Pangea.prototype.enable = function() {
206206
for (var i = 0; i < this.links.length; i++) {
207207
this.links[i].addEventListener('click', this.boundOnClick);
208208
}
209209
};
210210

211211
/**
212-
* Disable the PageAnimation library by removing event listeners set in
213-
* `PageAnimation.enable()`.
212+
* Disable the Pangea library by removing event listeners set in
213+
* `Pangea.enable()`.
214214
*/
215-
PageAnimation.prototype.disable = function() {
215+
Pangea.prototype.disable = function() {
216216
for (var i = 0; i < this.links.length; i++) {
217217
this.links[i].removeEventListener('click', this.boundOnClick);
218218
}
@@ -225,7 +225,7 @@
225225
* @param {int} scrollDuration - how long the scroll should take, in ms
226226
* @param {function} cb - callback to call when the scroll is complete
227227
*/
228-
PageAnimation.scrollTo = function(offset, scrollDuration, cb) {
228+
Pangea.scrollTo = function(offset, scrollDuration, cb) {
229229
cb = cb || function() {};
230230
var startT = Date.now();
231231
var startY = window.scrollY;
@@ -260,7 +260,7 @@
260260
*
261261
* @param {Object} e - the transition end event object.
262262
*/
263-
PageAnimation.prototype._onTransitionEnd = function(e) {
263+
Pangea.prototype._onTransitionEnd = function(e) {
264264
if (!this.currentAnimation) {
265265
return;
266266
}
@@ -287,7 +287,7 @@
287287
}.bind(this);
288288

289289
if (animation.shouldScroll && animation.scrollTiming === 'after') {
290-
PageAnimation.scrollTo(this.cb.computeScrollOffset(animation), animation.scrollDuration, followLink);
290+
Pangea.scrollTo(this.cb.computeScrollOffset(animation), animation.scrollDuration, followLink);
291291
} else {
292292
followLink();
293293
}
@@ -308,7 +308,7 @@
308308
* as part of this animation
309309
* @param {string} animation.scrollTiming - when to scroll the page
310310
*/
311-
PageAnimation.prototype._animate = function(animation) {
311+
Pangea.prototype._animate = function(animation) {
312312
this.cb.beforeAnimationStart(animation);
313313
animation.finalElement.addEventListener(this.transitionEndEvent, this.boundOnTransitionEnd);
314314
this.currentAnimation = animation;
@@ -318,10 +318,10 @@
318318
}.bind(this);
319319

320320
if (animation.shouldScroll && animation.scrollTiming === 'before') {
321-
PageAnimation.scrollTo(this.cb.computeScrollOffset(animation), animation.scrollDuration, startAnimation);
321+
Pangea.scrollTo(this.cb.computeScrollOffset(animation), animation.scrollDuration, startAnimation);
322322
} else if (animation.shouldScroll && animation.scrollTiming === 'during') {
323323
setTimeout(startAnimation, 0);
324-
PageAnimation.scrollTo(this.cb.computeScrollOffset(animation), animation.scrollDuration);
324+
Pangea.scrollTo(this.cb.computeScrollOffset(animation), animation.scrollDuration);
325325
} else {
326326
startAnimation();
327327
}
@@ -335,7 +335,7 @@
335335
*
336336
* @param {Object} e - the click event object.
337337
*/
338-
PageAnimation.prototype._onClick = function(e) {
338+
Pangea.prototype._onClick = function(e) {
339339
var anchor = _getTargetAnchor(e);
340340
var path = _getAnchorPath(anchor);
341341

@@ -358,11 +358,11 @@
358358
};
359359

360360
if (typeof define === 'function' && define.amd) {
361-
define(PageAnimation);
361+
define(Pangea);
362362
} else if (typeof module !== 'undefined' && module.exports) {
363-
module.exports = PageAnimation;
363+
module.exports = Pangea;
364364
} else {
365-
global.PageAnimation = PageAnimation;
365+
global.Pangea = Pangea;
366366
}
367367

368368
}(this));

src/pageanimation.min.js src/pangea.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)