Changed parts of animation system

This commit is contained in:
Tim Stallard 2016-01-08 08:10:21 +00:00
parent 9a54f7bc25
commit 8e47626282
5 changed files with 19 additions and 13 deletions

View File

@ -4,6 +4,6 @@ title: "Home"
icon: "home" icon: "home"
order: 0 order: 0
--- ---
<div> <div class="animated">
Hello World! Hello World!
</div> </div>

View File

@ -5,15 +5,15 @@ $(document).ready(function(){
prefetch: true, prefetch: true,
debug: true, debug: true,
onStart: { onStart: {
duration: 250, duration: 400,
render: function (container, url) { render: function (container, url) {
container.addClass('is-exiting'); container.addClass("is-exiting");
smoothState.restartCSSAnimations(); smoothState.restartCSSAnimations();
} }
}, },
onReady: { onReady: {
duration: 0, duration: 0,
render: function (container, newContent) { render: function (container, newContent){
container.removeClass("is-exiting"); container.removeClass("is-exiting");
container.attr("data-slug", $(newContent).filter("meta").data("slug")) container.attr("data-slug", $(newContent).filter("meta").data("slug"))
container.html(newContent); container.html(newContent);

View File

@ -81,16 +81,22 @@ body{
} }
.m-scene .scene_element { .animations .animated{
animation-duration: 0.25s; animation-duration: 0.4s;
transition-timing-function: ease-in; transition-timing-function: ease-in;
animation-fill-mode: both; animation-fill-mode: both;
} }
.m-scene .scene_element--fadein { .animations.is-exiting .animated{
animation-name: slideInUp;
}
.m-scene.is-exiting .scene_element {
animation-direction: alternate-reverse; animation-direction: alternate-reverse;
} }
.animations[data-slug="index"]{
>div{
animation-name: slideInRight;
}
}
.animations #lightcontent{
animation-name: slideInUp;
}

View File

@ -2,7 +2,7 @@
layout: core.html layout: core.html
--- ---
<div id="lightcontent" class="scene_element scene_element--fadein"> <div id="lightcontent" class="animated">
<div> <div>
<%- content %> <%- content %>
</div> </div>

View File

@ -20,7 +20,7 @@
<% }) %> <% }) %>
</div> </div>
</div> </div>
<div id="content" class="m-scene" data-slug="<%- document.slug %>"> <div id="content" class="animations" data-slug="<%- document.slug %>">
<meta data-menu="<%= document.url.split("/")[1] %>" data-slug="<%- document.slug %>" /> <meta data-menu="<%= document.url.split("/")[1] %>" data-slug="<%- document.slug %>" />
<%- content %> <%- content %>
</div> </div>