#-webkit-keyframe animation "content" isn't working in Safari and iOS - safari

Problem
Having trouble getting CSS #-webkit-keyframe animations to work with the content-tag. The following code works great on Chrome and Firefox, but Safari doesn't shows still “STRING1”.
I've tried everything from the forum, but it still doesn't work.
Can someone help me? Thank you so much.
html:
<h1>TEST:<span></span></h1>
css:
#-webkit-keyframes textchange {
0% {content: 'STRING1';}
30% {content: 'SRING2';}
60% {content: 'STRING3';}
100% {content: 'STRING1';}
}
#-moz-keyframes textchange {
0% {content: 'STRING1';}
30% {content: 'SRING2';}
60% {content: 'STRING3';}
100% {content: 'STRING1';}
}
#-o-keyframes textchange {
0% {content: 'STRING1';}
30% {content: 'SRING2';}
60% {content: 'STRING3';}
100% {content: 'STRING1';}
}
#keyframes textchange {
0% {content: 'STRING1';}
30% {content: 'SRING2';}
60% {content: 'STRING3';}
100% {content: 'STRING1';}
}
h1 span::before{
content:'STRING1';
-webkit-animation-name: textchange;
-webkit-animation-duration: 6s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-webkit-animation-play-state: running;
-webkit-animation-direction: normal;
-webkit-animation-delay:0.01s;
-webkit-animation-fill-mode: forwards;
-o-animation: textchange 6s linear 0.01s infinite;
-ms-animation: textchange 6s linear 0.01s infinite;
-moz-animation: textchange 6s linear 0.01s infinite;
animation: textchange 6s linear 0.01s infinite;
}

According to this thread : css animation on "content:" doesn't work on Safari and Firefox
It is not possible to animate the content property of a pseudo element except in Chrome on desktop. So you cannot achieve this threw css for IOS
You have to use Javascript
I would use a loop with an if statement checking the current inner.html value to change the value text after a certain time (setTimeOut or setInterval)

Related

set an element initially hidden and stay visible after finishing animation

in the example below:
wrap should be initially hidden
after one second - in should be outside of page
next second - it should go into page
finishing animation - it should stay visible - and here is the problem - it goes hidden
If I remove visibility:hidden at start - it is visible the first second - that's not allowed
how to do this ?
.wrap{
visibility:hidden; width:54px; height:54px; background:orange;
}
.wrap{animation: wrap 1s; animation-delay:1s}
#keyframes wrap{
0% {transform: translateX(-300px); visibility:visible}
100% {transform: translateX(0);}
}
<div class='wrap'></div>
This is happens, when the animation finished, the swap class gets its initial value from itself. To solve this you need add in the last keyframe (100%) visibility: visible; and also add animation-fill-mode: forwards; to stop the animation on the last keyframe.
.wrap {
visibility: hidden;
width: 54px;
height: 54px;
background: orange;
}
.wrap {
animation: wrap 1s;
animation-delay: 1s;
animation-fill-mode: forwards; /* new line */
}
#keyframes wrap {
0% {
transform: translateX(-300px);
visibility: visible;
}
100% {
transform: translateX(0);
visibility: visible; /* new line */
}
}
.wrap {
visibility: hidden;
width: 54px;
height: 54px;
background: orange;
}
.wrap {
animation: wrap 1s;
animation-delay: 1s;
animation-fill-mode: forwards; /* new line */
}
#keyframes wrap {
0% {
transform: translateX(-300px);
visibility: visible;
}
100% {
transform: translateX(0);
visibility: visible; /* new line */
}
}
<div class="wrap"></div>

Primeng v12.x how to add css to animate p-component-overlay-leave which is not happening automatically

I am new to animations in css.
I have just upgraded primeng version to v12 to my angular application 11.
I am using primeng sidebar. the sidebar after closed, the overlay is not disappearing.
Can see p-component-overlay-leave classes is added to the overlay but since there is no corresponding animation css available it is not disappearing. can anyone show me how to add this so the overlay disappears after the sidebar is closed.
css added for overlay enter:
.p-component-overlay-enter {
animation: p-component-overlay-enter-animation 150ms forwards;
animation-duration: 150ms;
animation-timing-function: ease;
animation-delay: 0s;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: forwards;
animation-play-state: running;
animation-name: p-component-overlay-enter-animation;
}
trying to add the following but not sure how to add the respective css:
.p-component-overlay-leave {
animation: p-component-overlay-leave-animation 150ms forward;
}
Added the following and it worked
.p-component-overlay-leave {
animation: p-component-overlay-leave-animation 150ms forwards;
}
#keyframes p-component-overlay-leave-animation {
from {
background-color: rgba(0, 0, 0, 0.4);
}
to {
background-color: transparent;
}
}

Nuxt scroll up before page transition

I have created a transition to be run between route changes:
.page-enter-active {
position: absolute;
width: 100%;
//max-height: 100vh;
overflow: hidden;
animation: slideScaleRight 2s ease;
}
.page-leave-active {
position: absolute;
width: 100%;
//max-height: 100vh;
overflow: hidden;
animation: scaleSlideRight 2s ease;
}
#keyframes scaleSlideRight {
0% {
transform: scale(1);
}
33% {
transform: scale(0.75) translateX(0);
opacity: 0.5;
}
66% {
transform: scale(0.75) translateX(150%);
}
100% {
transform: scale(0.75) translateX(150%);
}
}
#keyframes slideScaleRight {
0% {
transform: scale(0.75) translateX(-150%);
}
33% {
transform: scale(0.75) translateX(-150%);
}
66% {
opacity: 0.5;
transform: scale(0.75) translateX(0);
}
100% {
transform: scale(1) translateX(0);
}
}
The transition run smooth but I just discover that if the page is not at top position, before leaving, nuxt force an scroll to the top making the experience really bad...
I can guess nuxt is scrolling up before triggering the transition and I really would like to keep the page where it is before leaving.
Any ideas?
You could set scrollToTop: false on an upper page (or even in /layouts/default.vue?) to prevent the scrolling of the page as shown in the documentation.
If you want more granularity, you could also look into scrollBehavior.

Aurelia router animation

I'm using au-animate in each view to make a page transition:
the current view slides left out (from center to left) and the next view slides left in (from right to center).
#keyframes slideLeftIn {
0% {transform: translate(100%, 0);}
100% {transform: translate(0, 0);}
}
#keyframes slideLeftOut {
0% {transform: translate(0, 0);}
100% {transform: translate(-100%, 0);}
}
.pages.au-enter-active {
animation: slideLeftIn 0.8s;
}
.pages.au-leave-active {
animation: slideLeftOut 0.8s;
}
Based on: Aurelia router view animation with swap-order="with"
Now, I need to have both views in the DOM during the transition, like in W3 slide.
Is there a way to achieve this in aurelia?
UPDATE:
It appears to be a bug preventing this:
error aurelia-templating-router 1.0.1 with swap-order
UPDATE2:
In the last release this bug was fixed! Aurelia rocks.
#keyframes slideLeftIn {
0% {
-webkit-transform: translate(100%, 0);
transform: translate(100%, 0); }
100% {
-webkit-transform: none;
transform: none; } }
#keyframes slideLeftOut {
0% {
-webkit-transform: none;
transform: none; }
100% {
-webkit-transform: translate(-100%, 0);
transform: translate(-100%, 0); } }

Animation Stopping In Process

** Sorry about previous post. It submitted before I was done and I couldn't edit it. *
I have an image that has two animations. It will first zoom in and then rotate. It works except for when the rotation starts, it jumps to the end in the process. I am new to coding so it probably is an oversight on my part but I would love some help. Code below as well as a fiddle.
HTML
<div class="pageLoad">
<img id ="ox-logo" src="http://demo.alphaomegawebservices.net/weboxsmiles/wp-content/uploads/2014/11/weboxsmiles-logo-600.png">
</div>
CSS
#ox-logo {
position: absolute;
max-width: 50%;
margin-left: 150px;
top: 5%;
z-index: 20;
animation: zoomLogo 3s ease-in 1s, rotateLogo 4s ease-in 1s forwards;
transition: 3s ease-in;
transform-origin: 50% 50%;
-webkit-animation: zoomLogo 3s ease-in 1s, rotateLogo 6s ease-in 1s forwards;
-webkit-transition: 6s ease-in;
-webkit-transform-origin: 50% 50%;
-moz-animation: zoomLogo 3s ease-in 1s, rotateLogo 6s ease-in 1s forwards;
-moz-transition: 3s ease-in;
-moz-transform-origin: 50% 50%;
-o-animation: zoomLogo 3s ease-in 1s, rotateLogo 6s ease-in 1s forwards;
-o-transition: 3s ease-in;
-o-transform-origin: 50% 50%;
-ms-animation: zoomLogo 3s ease-in 1s, rotateLogo 6s ease-in 1s forwards;
-ms-transition: 3s ease-in;
-ms-transform-origin: 50% 50%;
}
#keyframes rotateLogo {
0% {
transform: translate(0px,0px) rotate(0deg) ;
}
100% {
transform: scale(.2) translate(249px,150px) rotate(-720deg);
}
}
#-webkit-keyframes rotateLogo {
0% {
-webkit-transform: translate(0px,0px) rotate(0deg) ;
}
100% {
-webkit-transform: scale(.2) translate(249px,150px) rotate(-720deg);
}
}
#-moz-keyframes rotateLogo {
0% {
-moz-transform: translate(0px,0px) rotate(0deg) ;
}
100% {
-moz-transform: scale(.2) translate(249px,150px) rotate(-720deg);
}
}
#-o-keyframes rotateLogo {
0% {
-o-transform: translate(0px,0px) rotate(0deg) ;
}
100% {
-o-transform: scale(.2) translate(249px,150px) rotate(-720deg);
}
}
#-ms-keyframes rotateLogo {
0% {
-ms-transform: translate(0px,0px) rotate(0deg) ;
}
100% {
-ms-transform: scale(.2) translate(249px,150px) rotate(-720deg);
}
}
#keyframes zoomLogo {
0% {
opacity: 0;
transform: scale(.3);
}
50% {
opacity: 1;
}
}
#-webkit-keyframes zoomLogo {
0% {
opacity: 0;
-webkit-transform: scale(.3);
}
50% {
opacity: 1;
}
}
#-moz-keyframes zoomLogo {
0% {
opacity: 0;
-moz-transform: scale(.3);
}
50% {
opacity: 1;
}
}
#-o-keyframes zoomLogo {
0% {
opacity: 0;
-o-transform: scale(.3);
}
50% {
opacity: 1;
}
}
#-ms-keyframes zoomLogo {
0% {
opacity: 0;
-ms-transform: scale(.3);
}
50% {
opacity: 1;
}
}
FIDDLE
http://jsfiddle.net/SRVIVR/stgb3fdL/51/
Use a single animation instead. Here's a jsfiddle that has only webkit-specific code:
http://jsfiddle.net/stgb3fdL/56/
Code:
#-webkit-keyframes zoomAndRotate {
0% {
opacity: 0;
-webkit-transform: scale(.3);
}
50% {
opacity: 1;
}
51% {
-webkit-transform: translate(0px,0px) rotate(0deg) ;
}
100% {
-webkit-transform: scale(.2) translate(249px,150px) rotate(-720deg);
}
}