html - combine fade and slide ( left/top/bottom/right ) with AngularJS -
i see lot of single page app(s) uses fade-in
, slide-up
during scrolling etc ..
but can't seem find can integrate angular's nganimate
, in websites it's either install new code new lib , want stop myself keep installing 1000 modules @ point can't scale ( because don't know how combine 2 animation @ once )
i've seen code example: http://codepen.io/astrotim/pen/kdbbe , trying import , adjust used angularjs w/o luck :/
html
<div ng-if="front_wallpaper" class="animated fade-and-slide"> mytext </div>
angular's app js
angular.module('app', ['nganimate']) .controller('somectrl', function ($scope, $timeout) { $scope.front_wallpaper = false; $timeout(function () { $scope.front_wallpaper = true; },1000); });
css
div { font-size: 48pt; color: white; position: relative; left: -60%; top: 20%; opacity: 0; transition: .75s ease; transition-duration: 5s; } .fade-and-slide.ng-enter { top: 21%; opacity: 1; }
animation example: http://shapebootstrap.net/item/1524946-lucid-html5-and-bootstrap-responsive-template/live-demo
or white buttons here: http://wrapbootstrap.com/preview/wb0f82581
thanks in advance
just found answer, if we're using animation
( not transition
) can define several animations comma delimiter, i.e: openspace
& movein
-webkit-animation: openspace 2s ease forwards, movein 0.3s 0.2s ease forwards;
full example
.list-item.ng-enter { max-height: 0; opacity: 0; transform: translatex(100%); -webkit-animation: openspace 2s ease forwards, movein 0.3s 0.2s ease forwards; } @-webkit-keyframes openspace { { max-height: 300px; } } @-webkit-keyframes movein { { opacity: 1; transform: translatex(0); } }
Comments
Post a Comment