Skip to content

Instantly share code, notes, and snippets.

@Vheissu
Last active December 14, 2016 00:17
Show Gist options
  • Save Vheissu/43a18d196635de1211f2940814416bde to your computer and use it in GitHub Desktop.
Save Vheissu/43a18d196635de1211f2940814416bde to your computer and use it in GitHub Desktop.
Animation example
<template>
<require from="./styles.css"></require>
<div class="my-cool-element">
<div class="au-animate">
<h1>My element animates</h1>
</div>
</div>
</template>
export class App {
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body aurelia-app="main">
<h1>Loading...</h1>
<script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/config.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script>
<script>
require(['aurelia-bootstrapper']);
</script>
</body>
</html>
export function configure(aurelia) {
aurelia.use.basicConfiguration();
aurelia.start().then(() => aurelia.setRoot());
}
.my-cool-element > .au-enter {
opacity: 0 !important;
}
.my-cool-element > .au-enter-active {
-webkit-animation: fadeIn 2s;
animation: fadeIn 2s;
}
.my-cool-element > .au-leave-active {
-webkit-animation: fadeOut 2s;
animation: fadeOut 2s;
}
@-webkit-keyframes fadeIn {
0% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes fadeIn {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-webkit-keyframes fadeOut {
0% { opacity: 1; }
100% { opacity: 0; }
}
@keyframes fadeOut {
0% { opacity: 1; }
100% { opacity: 0; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment