Last active
April 21, 2016 13:32
-
-
Save Scapal/27e46dd56fb48f5b02aa725ac04b26ca to your computer and use it in GitHub Desktop.
Aurelia navigation-view Demo
This file contains 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
/* animate page transitions */ | |
div.page { | |
position: absolute; | |
left: 0; | |
top: 0; | |
right: 0; | |
/*width: 100%;*/ | |
height: 100%; | |
} | |
.nav-forward div.page.au-enter-active { | |
-webkit-animation: fadeInRight 1s; | |
animation: fadeInRight 1s; | |
} | |
.nav-forward div.page.au-leave-active { | |
-webkit-animation: fadeOutLeft 1s; | |
animation: fadeOutLeft 1s; | |
} | |
.nav-back div.page.au-enter-active { | |
-webkit-animation: fadeInLeft 1s; | |
animation: fadeInLeft 1s; | |
} | |
.nav-back div.page.au-leave-active { | |
-webkit-animation: fadeOutRight 1s; | |
animation: fadeOutRight 1s; | |
} | |
.animate-title-forward-add { | |
-webkit-animation: fadeInRight 1s; | |
animation: fadeInRight 1s; | |
} | |
.animate-title-back-add { | |
-webkit-animation: fadeInRight 1s; | |
animation: fadeInLeft 1s; | |
} | |
/* animation definitions */ | |
@-webkit-keyframes fadeInRight { | |
0% { | |
/*opacity: 0;*/ | |
-webkit-transform: translate3d(100%, 0, 0); | |
transform: translate3d(100%, 0, 0) | |
} | |
100% { | |
/*opacity: 1;*/ | |
-webkit-transform: none; | |
transform: none | |
} | |
} | |
@keyframes fadeInRight { | |
0% { | |
/*opacity: 0;*/ | |
-webkit-transform: translate3d(100%, 0, 0); | |
-ms-transform: translate3d(100%, 0, 0); | |
transform: translate3d(100%, 0, 0) | |
} | |
100% { | |
/*opacity: 1;*/ | |
-webkit-transform: none; | |
-ms-transform: none; | |
transform: none | |
} | |
} | |
@-webkit-keyframes fadeOutLeft { | |
0% { | |
/*opacity: 1;*/ | |
-webkit-transform: none; | |
transform: none | |
} | |
100% { | |
/*opacity: 0;*/ | |
-webkit-transform: translate3d(-100%, 0, 0); | |
transform: translate3d(-100%, 0, 0) | |
} | |
} | |
@keyframes fadeOutLeft { | |
0% { | |
/*opacity: 1;*/ | |
-webkit-transform: none; | |
transform: none | |
} | |
100% { | |
/*opacity: 0;*/ | |
-webkit-transform: translate3d(-100%, 0, 0); | |
transform: translate3d(-100%, 0, 0) | |
} | |
} | |
/* animation definitions */ | |
@-webkit-keyframes fadeInLeft { | |
0% { | |
/*opacity: 0;*/ | |
-webkit-transform: translate3d(-100%, 0, 0); | |
transform: translate3d(-100%, 0, 0) | |
} | |
100% { | |
/*opacity: 1;*/ | |
-webkit-transform: none; | |
transform: none | |
} | |
} | |
@keyframes fadeInLeft { | |
0% { | |
/*opacity: 0;*/ | |
-webkit-transform: translate3d(-100%, 0, 0); | |
-ms-transform: translate3d(-100%, 0, 0); | |
transform: translate3d(-100%, 0, 0) | |
} | |
100% { | |
/*opacity: 1;*/ | |
-webkit-transform: none; | |
-ms-transform: none; | |
transform: none | |
} | |
} | |
@-webkit-keyframes fadeOutRight { | |
0% { | |
/*opacity: 1;*/ | |
-webkit-transform: none; | |
transform: none | |
} | |
100% { | |
/*opacity: 0;*/ | |
-webkit-transform: translate3d(100%, 0, 0); | |
transform: translate3d(100%, 0, 0) | |
} | |
} | |
@keyframes fadeOutRight { | |
0% { | |
/*opacity: 1;*/ | |
-webkit-transform: none; | |
transform: none | |
} | |
100% { | |
/*opacity: 0;*/ | |
-webkit-transform: translate3d(100%, 0, 0); | |
transform: translate3d(100%, 0, 0) | |
} | |
} |
This file contains 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
<template> | |
<require from="bootstrap/css/bootstrap.css"></require> | |
<require from="navigation-view"></require> | |
<require from="nav-bar"></require> | |
<require from="animate.css"></require> | |
<nav-bar nav.bind="nav"></nav-bar> | |
<div style="position: absolute;top: 100px;width: 100%;"> | |
<navigation-view navigation-view.ref="nav" title="Page 1" view-model="page1" model="{my-data: 'test'}"></navigation-view> | |
</div> | |
</template> |
This file contains 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
export class App { | |
} |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>Aurelia</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body aurelia-app="main"> | |
<h1>Loading...</h1> | |
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/jspm_packages/system.js"></script> | |
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/config.js"></script> | |
<script> | |
System.import('aurelia-bootstrapper'); | |
</script> | |
</body> | |
</html> |
This file contains 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 'bootstrap'; | |
export function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging(); | |
aurelia.use.plugin('aurelia-animator-css'); | |
aurelia.start().then(() => aurelia.setRoot()); | |
} |
This file contains 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
<template> | |
<div class="page au-animate"> | |
<p>This view instance title: ${nav.title}</p> | |
<a href="#" click.delegate="nav.navigate('page2', 'Page 2', {someData: 'test2'})">Create and navidate to a new page 2</a> | |
<div> | |
<form class="col-xs-10"> | |
<div class="form-group"> | |
<label for="testInput">This content will be intact when you navigate back to it</label> | |
<input type="text" class="form-control" id="testInput"> | |
</div> | |
</form> | |
</div> | |
</section> | |
</template> |
This file contains 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
export class Page1 { | |
activate(model, nav) { | |
this.nav = nav; | |
} | |
} |
This file contains 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
<template> | |
<div class="page au-animate"> | |
<p>This view instance title: ${nav.title}</p> | |
<a href="#" click.delegate="nav.navigate('page1', 'Another Page 1', {someData: 'test2'})">Create and navidate to a new page 1</a> | |
<div> | |
<form class="col-xs-10"> | |
<div class="form-group"> | |
<label for="testInput">This content will be intact when you navigate back to it</label> | |
<input type="text" class="form-control" id="testInput"> | |
</div> | |
</form> | |
</div> | |
</section> | |
</template> |
This file contains 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
export class Page1 { | |
activate(model, nav) { | |
this.nav = nav; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment