Added initial class to prevent animations on plain pages

This commit is contained in:
Tim Stallard 2016-11-28 21:53:20 +00:00
parent 0e21c8aa48
commit ef566fe7b3
3 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,7 @@ $(document).ready(function(){
$("body").animate({
scrollTop: 0
}, 400);
container.removeClass("initial-load");
container.addClass("is-exiting");
smoothState.restartCSSAnimations();
}

View File

@ -74,6 +74,9 @@ body{
@at-root .animations#{&}{
animation-name: slideInUp;
}
@at-root .animations.initial-load#{&}{
animation-name: none;
}
background-color: white;
color: black;
flex-grow: 1;
@ -99,6 +102,9 @@ body{
@at-root .animations#{&}{
animation-name: fadeInUp;
}
@at-root .animations.initial-load#{&}{
animation-name: none;
}
>#headerimg{
width: 100%;
height: calc(100vh - 165px + 50px);

View File

@ -23,7 +23,7 @@
<% }) %>
</div>
</div>
<div id="content" class="animations<% if(document.addclass){ %> <%= document.addclass %><% } %>" data-slug="<%- document.slug %>">
<div id="content" class="animations<% if(document.addclass){ %> <%= document.addclass %><% } %> initial-load" data-slug="<%- document.slug %>">
<meta data-menu="<%= document.url.split("/")[1] %>" data-slug="<%- document.slug %>" />
<%- content.replace("-split-", "") %>
</div>