Animating Ng-view - animation

I have been trying for too long to try and get transitions animated as I can in angular.js, with no success.
ng-view works, I can move between views with no issue and the url updates correctly, but no animation is triggered.
My HTML for this is:
<div flex horizontal wrap layout>
<ng-view class="slide"></ng-view>
</div>
My css (taken from http://dfsq.github.io/ngView-animation-effects/app/#/code) is:
.slide {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.slide.ng-enter,
.slide.ng-leave {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
.slide.ng-enter {
left: 100%;
}
.slide.ng-enter-active {
left: 0;
}
.slide.ng-leave {
left: 0;
}
.slide.ng-leave-active {
left: -100%;
}
and I am including the animation module:
...
import 'package:angular/animate/module.dart';
import 'package:ch_padart/main_module.dart'; //Main Module set
void main() {
initPolymer()
.run(() {
applicationFactory()
.addModule(new NodeBindModule())
.addModule(new MainModule())
.addModule(new AnimationModule()) //<-- installed animation module
.run();
});
}
...

Related

GSAP, animation with translateX/Y, macOS Safari <= 13 version

I have this scene with animation, also I have an issue with Safari v.13(and lower) and glitching blurred balls (.intro-circle) in my scene.
So, when I open my scene on Safari v.13 and lower, my blurred balls very sad, and I don't know how can I solve this issue.
Thanks a lot in advance!
This is my pen
html:
<section class="intro">
<img class="intro-circle js_image intro-circle--yellow"
src="https://studiogalo.dev.cheitgroup.com/wp-content/themes/studio-galo/assets/img/intro/intro-circle-yellow.svg" alt="">
<img class="intro-circle js_image intro-circle--blue"
src="https://studiogalo.dev.cheitgroup.com/wp-content/themes/studio-galo/assets/img/intro/intro-circle-blue.svg" alt="">
<h1 class="intro-title">Welcome to <br>Paradise</h1>
<h2 class="intro-sub_title">We empower dreamers <br>who dare to make a difference.</h2>
</section>
css:
.intro {
position: fixed;
background-color: #F6F5F0;
-webkit-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
overflow: hidden;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1500;
visibility: visible; }
.intro-bg {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
-webkit-transform: scale(1.001);
-ms-transform: scale(1.001);
transform: scale(1.001); }
.intro-bg--mobile {
display: none; }
.intro.animationEnd {
-webkit-transition: all 1.2s ease;
-o-transition: all 1.2s ease;
transition: all 1.2s ease;
opacity: 0;
visibility: hidden;
pointer-events: none; }
.intro-title {
position: absolute;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-size: 3.05vw;
text-align: center;
font-weight: 300;
opacity: 0;
-webkit-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease; }
.intro-sub_title {
position: absolute;
left: 4.86vw;
top: 4.16vw;
font-size: 3.05vw;
text-align: left;
line-height: 1.1;
font-weight: 300;
-webkit-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease; }
.intro-circle {
position: absolute;
-webkit-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease;
-webkit-transform-origin: center;
-ms-transform-origin: center;
transform-origin: center;
will-change: transform; }
.intro-circle--yellow {
left: -3.75%;
top: -22.03%;
width: 48.61vw;
height: 48.61vw; }
.intro-circle--blue {
left: -18.75%;
top: 25.97%;
width: 54.16vw;
height: 54.16vw;
opacity: 0; }
.intro-circle--mobile {
display: none; }
js:
introAnimationStart()
function clearEntrance() {
$('.intro').addClass('animationEnd');
$('.site-wrapper, .header, body').addClass('load');
canMoveOn = true;
setTimeout(() => {
$('.intro').remove();
}, 1000);
}
function introAnimationStart() {
// /* intro animation GSAP */
window.history.scrollRestoration = 'manual';
window.scrollTo(0,0);
if (window.innerWidth >= 992) {
let introAnim = gsap.timeline({
defaults: {
duration: 1,
},
ease: Power1.easeInOut,
onComplete: function onComplete() {
// setTimeout(clearEntrance, 1000);
}
});
introAnim
.to(".intro-circle--yellow", {
delay: 1,
top: '-20%',
left: '70%',
}, 'subtitleAndYellow2')
.to(".intro-sub_title", {
delay: 1,
opacity: 0
}, 'subtitleAndYellow2')
.to(".intro-circle--blue", {
opacity: 1,
})
.to(".intro-circle--yellow", {
duration: 1.5,
left: '50%',
top: '50%',
translateX: '-50%',
translateY: '-50%',
}, 'YellowBlueTitle')
.to(".intro-circle--blue", {
duration: 1.5,
left: '50%',
top: '50%',
translateX: '-50%',
translateY: '-50%',
}, 'YellowBlueTitle')
.to(".intro-title", {
duration: 1.5,
opacity: 1,
}, 'YellowBlueTitle');
$('.intro').click(function () {
introAnim.timeScale(14);
});
} else {
/**
* Mobile animation-OPTIMIZATION
*/
// 1st step
setTimeout(() => {
$(".intro-circle--yellow, .intro-sub_title").addClass('fst_step');
}, 1000);
// 2nd step
setTimeout(() => {
$(".intro-circle--blue").addClass('snd_step');
}, 2200);
// 3rd step
setTimeout(() => {
$(".intro-circle--yellow, .intro-circle--blue, .intro-title").addClass('trd_step');
}, 3000);
setTimeout(clearEntrance, 6000);
}
}

How to use :hover affects to child element?

I have this html structure:
.Gallery > .Gallery__container > .Gallery__container-item > .Gallery__container-item-image
I want to :hover on .Gallery__container-item affects to .Gallery__container-item-image
&-item{
background-color: $darkgray;
padding: 20px;
border-radius: 20px;
cursor: pointer;
&:hover{
&-image{ //doesn't recognized
transition: scale 1s linear;
transform: scale(1.1);
}
}
}
Using SCSS
The ampersand & in your code will not compile to what you want.
Here is a simplified example (with less markup and less styling):
.Gallery {
&-item {
&:hover {
&-image {
transition: scale 1s linear;
}
}
}
}
will compile to:
.Gallery-item:hover-image {
transition: scale 1s linear;
}
Now, you have few possibilities, first one would be to write the full class name:
.Gallery {
&-item {
&:hover {
.Gallery-item-image {
transition: scale 1s linear;
}
}
}
}
You could also define a variable that will take the value of the selector before the :hover, that's probably what you want to do:
.Gallery {
&-item {
$selector : &;
&:hover {
#{$selector}-image {
transition: scale 1s linear;
}
}
}
}

How to apply the bootstrap 3 modal animation transition effect in bootstrap 4

In bootstrap 3 I liked the transition animation effect that came by default when the modal window appeared:
https://getbootstrap.com/docs/3.4/javascript/#live-demo
But in bootstrap 4 this effect has disappeared, I have been trying to do it manually but it does not come out the same, there is a way to activate it again in such a way that it remains the same as in 3, here we can see how it has no effect when showing the modal:
https://getbootstrap.com/docs/4.6/components/modal/
I have found the solution, I saw in the version 4.0 still working the modal like bootstrap 3, but in the version 4.6 is different, then I take with inspector browser and the code when click in the modal is the same I'm putting here, you can try in this page:
https://getbootstrap.com/docs/4.0/components/modal/#live-demo
The code that you put in your style.css:
.modal.fade .modal-dialog {
transition: -webkit-transform .3s ease-out;
transition: transform .3s ease-out;
-webkit-transform: translate(0, -25%);
transform: translate(0, -25%);
}
.modal.show .modal-dialog {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-open {
overflow: hidden;
}
.fade {
opacity: 0;
transition: opacity .15s linear;
}
.fade.show {
opacity: 1;
}
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
display: none;
overflow: hidden;
outline: 0;
}
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}

sass question. transition of transform effect not applied

Can someone help me why transition doesn't get applied?
html
<div class="box">
<div class="box__faces">
<div class="box__faces--front">
FRONT
</div>
<div class="box__faces--back">
BACK
</div>
</div>
</div>
sass
.box
{
width: 500px;
height: 500px;
background: #eee;
&__faces
{
transition: all 0.8s ease; // this doesn't seem to be applied.
&--front
{
width:150px;
height:150px;
background: blue;
}
&--back
{
width:150px;
height:150px;
background: red;
transform: rotateY(180deg);
}
}
&__faces:hover &__faces--front
{
transform: rotateY(180deg);
}
&__faces:hover &__faces--back
{
transform: rotateY(0deg);
}
}
I have a working codepen here:
https://codepen.io/loganlee/pen/RwNJPdZ?editors=1100
I expect rotateY transform for both .box__faces--front and .box__faces--back to be transitioned and I placed transition on the parent element which in this case is .box__faces.
transition: all 0.8s ease; // this doesn't seem to be applied.
Thanks.
You have set transition on .box__faces class when you need to specify it on the &--front and &--back classes.
.box
{
width: 500px;
height: 500px;
background: #eee;
&__faces
{
&--front
{
width:150px;
height:150px;
background: blue;
transition: all 0.8s ease;
}
&--back
{
width:150px;
height:150px;
background: red;
transform: rotateY(180deg);
transition: all 0.8s ease;
}
}
&__faces:hover &__faces--front
{
transform: rotateY(180deg);
}
&__faces:hover &__faces--back
{
transform: rotateY(0deg);
}
}

CSS rotation slow

http://jsfiddle.net/egEq2/
.badge {
-webkit-transform-style: preserve-3d;
-webkit-perspective: 1000;
position: relative;
}
.back, .front {
position: absolute;
-webkit-backface-visibility: hidden;
-webkit-transition: -webkit-transform 1s ease-in;
width: 100%;
height: 100%;
}
.back {
-webkit-transform: rotateY(180deg);
overflow: hidden;
}
.front {
}
.product-action {
display: inline-block;
}
.product-action:hover .back {
-webkit-transform: rotateY(0deg);
}
.product-action:hover .front {
-webkit-transform: rotateY(-180deg);
}​
... works, but flips too slow, can I change the speed?
Also, can I add width somehow so the flip looks like a board and not a thin paper? :)
Thanks!
You specified the speed already:
-webkit-transition: -webkit-transform 1s ease-in;
^^
Change it to something like 0.3s: http://jsfiddle.net/egEq2/1/

Resources