Last active
March 26, 2020 08:58
-
-
Save jesperlandberg/d941e980fb47e604fb5935ae510c864e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Highway from '@dogstudio/highway' | |
| export default class extends Highway.Renderer { | |
| onEnter() { | |
| this.el = this.wrap.lastElementChild | |
| } | |
| onLeave() { | |
| } | |
| onEnterCompleted() { | |
| document.readyState === 'complete' | |
| ? this.initOnComplete() | |
| : listener(window, 'a', 'load', () => this.initOnComplete()) | |
| } | |
| onLeaveCompleted() { | |
| } | |
| initOnComplete() { | |
| // Scripts | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Highway from '@dogstudio/highway' | |
| import * as R from './renderers' | |
| import * as T from './transitions' | |
| export default new class extends Highway.Core { | |
| constructor() { | |
| super({ | |
| renderers: { | |
| home: R.Home, | |
| about: R.About, | |
| default: R.Default | |
| }, | |
| transitions: { | |
| default: T.Default | |
| } | |
| }) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Default from './Default' | |
| export default class extends Default { | |
| onEnter() { | |
| super.onEnter() | |
| } | |
| onLeave() { | |
| super.onLeave() | |
| } | |
| onEnterCompleted() { | |
| super.onEnterCompleted() | |
| } | |
| onLeaveCompleted() { | |
| super.onLeaveCompleted() | |
| } | |
| initOnComplete() { | |
| super.initOnComplete() | |
| // home specific scripts | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment