Skip to content

Commit 9933af9

Browse files
author
Anthony Du Pont
committed
✨ Release v1.0.1
1 parent 0558ffb commit 9933af9

File tree

27 files changed

+244
-885
lines changed

27 files changed

+244
-885
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const H = new Highway.Core({
154154
OK so now you have your custom renderers but you are sad because there are no transitions between your pages...
155155
Don't be afraid, let's now see how to create our first transition!
156156

157-
Transitions in **Highway** are really simple, these are objects with two methods:
157+
Transitions in **Highway** are really simple, you need to extend `Highway.Transition` and provide two required methods:
158158

159159
- `in`: The `in` method should contain the transition to show a `[router-view]`.
160160
- `out`: The `out` method should contain the transition to hide a `[router-view]`.
@@ -166,14 +166,18 @@ Each one get two parameters you can call howewer you want but here are good defa
166166

167167
**transition.js**
168168
```javascript
169-
const Transition = {
170-
in: (view, done) => {
169+
// Import Highway
170+
import Highway from '@dogstudio/highway';
171+
172+
class Transition extends Highway.Transition {
173+
in(view, done) {
171174
// [...]
172-
},
173-
out: (view, done) => {
175+
}
176+
177+
out(view, done) {
174178
// [...]
175179
}
176-
};
180+
}
177181

178182
// Don't forget to export your transition
179183
export default Transition;

dist/highway.js

Lines changed: 115 additions & 132 deletions
Large diffs are not rendered by default.

dist/highway.min.js

Lines changed: 1 addition & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/highway.min.js.gz

-947 Bytes
Binary file not shown.

examples/basic-css-transition/dist/index.js

Lines changed: 1 addition & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic-css-transition/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@dogstudio/highway",
33
"license": "MIT",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"main": "dist/index.js",
66
"scripts": {
77
"build": "webpack",
@@ -16,6 +16,6 @@
1616
"webpack-cli": "^2.0.12"
1717
},
1818
"dependencies": {
19-
"@dogstudio/highway": "^1.0.0"
19+
"@dogstudio/highway": "^1.0.1"
2020
}
2121
}
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1+
// Import Highway
2+
import Highway from '@dogstudio/highway';
3+
14
// To create your custom transition you need to provide two required methods:
25
// - `in`: The transition part to show your view.
36
// - `out`: The transition part to hide you view.
47
//
5-
// Each method receives two parameters, the `view` and a callback method called
6-
// `done` you will always have to call when the method is over.
7-
const Fade = {
8-
in: (view, done) => {
8+
// Each method receives a callback method called `done` you will always have to
9+
// call when the a transition is over.
10+
class Fade extends Highway.Transition {
11+
in(view, done) {
912
// Add a classname to trigger the animation
1013
view.classList.add('fade-in');
1114

1215
// Wait for the animation to end
1316
view.addEventListener('animationend', done);
14-
},
15-
out: (view, done) => {
17+
}
18+
19+
out(view, done) {
1620
// Add a classname to trigger the animation
1721
view.classList.add('fade-out');
1822

1923
// Wait for the animation to end
2024
view.addEventListener('animationend', done);
2125
}
22-
};
26+
}
2327

2428
// Don't forget to export in some way your custom transition.
2529
export default Fade;

examples/basic-css-transition/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# yarn lockfile v1
33

44

5-
"@dogstudio/highway@^1.0.0":
6-
version "1.0.0"
7-
resolved "https://registry.yarnpkg.com/@dogstudio/highway/-/highway-1.0.0.tgz#7bd3a7271674a8d2dfac400cf6367411aa276bfd"
5+
"@dogstudio/highway@^1.0.1":
6+
version "1.0.1"
7+
resolved "https://registry.yarnpkg.com/@dogstudio/highway/-/highway-1.0.1.tgz#1d38da001396363b2502b3c38a61ba2c13921131"
88

99
"@sindresorhus/is@^0.7.0":
1010
version "0.7.0"

examples/basic-google-analytics/dist/index.js

Lines changed: 1 addition & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic-google-analytics/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@dogstudio/highway",
33
"license": "MIT",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"main": "dist/index.js",
66
"scripts": {
77
"build": "webpack",
@@ -16,6 +16,6 @@
1616
"webpack-cli": "^2.0.12"
1717
},
1818
"dependencies": {
19-
"@dogstudio/highway": "^1.0.0"
19+
"@dogstudio/highway": "^1.0.1"
2020
}
2121
}

0 commit comments

Comments
 (0)