css3animation + box-shadow not working in Safari & Opera - safari

I have implemented box-shadow effect in an div using CSS3 Animation... The code works fine in firefox and chrome but i dont know why my code is not working in Safari and Opera...
Safari Version i am using 5.1.7...
and Opera Version 12.12...
JsFiddle Link
My Code:
#-moz-keyframes glowz {
0% { -moz-box-shadow:0px 0px 10px 10px rgba(64,142,0,1); }
33% { -moz-box-shadow:0px 0px 7px 7px rgba(64,142,0,1); }
66% { -moz-box-shadow:0px 0px 2px 2px rgba(64,142,0,1); }
100% { -moz-box-shadow:0px 0px 9px 9px rgba(64,142,0,1); }
}
#-webkit-keyframes glowz {
0% { -webkit-box-shadow:0px 0px 10px 10px rgba(64,142,0,1); }
33% { -webkit-box-shadow:0px 0px 7px 7px rgba(64,142,0,1); }
66% { -webkit-box-shadow:0px 0px 2px 2px rgba(64,142,0,1); }
100% { -webkit-box-shadow:0px 0px 9px 9px rgba(64,142,0,1); }
}
#-o-keyframes glowz {
0% { -o-box-shadow:0px 0px 10px 10px rgba(64,142,0,1); }
33% { -o-box-shadow:0px 0px 7px 7px rgba(64,142,0,1); }
66% { -o-box-shadow:0px 0px 2px 2px rgba(64,142,0,1); }
100% { -o-box-shadow:0px 0px 9px 9px rgba(64,142,0,1); }
}
#keyframes glowz {
0% { box-shadow:0px 0px 10px 10px rgba(64,142,0,1); }
33% { box-shadow:0px 0px 7px 7px rgba(64,142,0,1); }
66% { box-shadow:0px 0px 2px 2px rgba(64,142,0,1); }
100% { box-shadow:0px 0px 9px 9px rgba(64,142,0,1); }
}
.blinker {
background-color: #FF0000;
display: block;
height: 27px;
position: absolute;
width: 27px;
left:50%; top:50%;
border-radius: 5em; -webkit-border-radius: 5em; -moz-border-radius: 5em; -o-border-radius: 5em;
-ms-animation: 5s ease-in-out 0s alternate none infinite glowz;
-webkit-animation: 5s ease-in-out 0s alternate none infinite glowz;
-moz-animation: 5s ease-in-out 0s alternate none infinite glowz;
-o-animation: 5s ease-in-out 0s alternate none infinite glowz;
animation: 5s ease-in-out 0s alternate none infinite glowz;
}
Is css3 animation is buggy in safari and opera ??

Tweak your CSS little bit and it will work.
Replace Following code:
-ms-animation: 5s ease-in-out 0s alternate none infinite glowz;
-webkit-animation: 5s ease-in-out 0s alternate none infinite glowz;
-moz-animation: 5s ease-in-out 0s alternate none infinite glowz;
-o-animation: 5s ease-in-out 0s alternate none infinite glowz;
animation: 5s ease-in-out 0s alternate none infinite glowz;
With following Code:
-webkit-animation-name: glowz;
-webkit-animation-duration: 5s;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: alternate;
-webkit-animation-delay: 0;
-webkit-animation-fill-mode: none;
-moz-animation-name: glowz;
-moz-animation-duration: 5s;
-moz-animation-timing-function: ease-in-out;
-moz-animation-iteration-count: infinite;
-moz-animation-direction: alternate;
-moz-animation-delay: 0;
-moz-animation-fill-mode: none;
-o-animation-name: glowz;
-o-animation-duration: 5s;
-o-animation-timing-function: ease-in-out;
-o-animation-iteration-count: infinite;
-o-animation-direction: alternate;
-o-animation-delay: 0;
-o-animation-fill-mode: none;
animation-name: glowz;
animation-duration: 5s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-delay: 0;
animation-fill-mode: none;
DEMO

Related

why my 3D animation runs smoothly on desktop but not on mobile?

it runs great on desktop but so janky on mobile :( sorry can't show you the result bcs I can't get permission TT_TT basically the animation is about having objects in 3D context of one perspective flying through z-index to your direction (and gets blurry when nearer)
I suspect it might have something to do with moving thousands of pixels? :(
How can I improve performance for mobile? Thanks!
HTML:
`
<template>
<div :class="{'js-loading': !hasLoaded}">
<img class="circle-bg" src="../assets/scene2-coins/circle-big-bg.svg" alt="circle-bg" #load="onImgLoad">
<img class="circle-bg--2" src="../assets/scene2-coins/circle-big-bg.svg" alt="circle-bg--2" #load="onImgLoad">
<img class="coin-silver" src="../assets/scene2-coins/coin-silver.svg" alt="coin-silver" #load="onImgLoad">
<img class="stars" src="../assets/scene2-coins/stars.svg" alt="stars" #load="onImgLoad">
<img class="confetti" src="../assets/scene2-coins/confetti.svg" alt="confetti" #load="onImgLoad">
<img class="confetti--2" src="../assets/scene2-coins/confetti.svg" alt="confetti--2" #load="onImgLoad">
<img class="coin-platinum" src="../assets/scene2-coins/coin-platinum.svg" alt="coin-platinum" #load="onImgLoad">
<img class="coin-gold" src="../assets/scene2-coins/coin-gold.svg" alt="coin-gold" #load="onImgLoad">
<img class="coin-diamond" src="../assets/scene2-coins/coin-diamond.svg" alt="coin-diamond" #load="onImgLoad">
</div>
</template>
`
SCSS:
`
<style lang="scss" scoped>
.js-loading *,
.js-loading *:before,
.js-loading *:after {
animation-play-state: paused !important;
}
div {
display: flex;
justify-content: center;
align-items: center;
perspective: 500px;
perspective-origin: 50% 50%;
img {
position: inherit;
display: block;
}
///////////////////////////// BACKGROUND
.circle-bg {
min-width: 1200px;
min-height: 1200px;
// animation: circle-bg 1000ms linear both 2000ms;
animation-name: circle-bg;
animation-duration: 1000ms;
animation-timing-function: linear;
animation-delay: 2000ms;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: both;
}
#keyframes circle-bg {
0% { transform: rotate(180deg) scale3D(.65); }
25% { transform: rotate(180deg) scale3D(.7375); }
50% { transform: rotate(180deg) scale3D(.825); }
75% { transform: rotate(180deg) scale3D(.9125); }
100% { transform: rotate(180deg) scale3D(1); }
}
.circle-bg--2 {
min-width: 1500px;
min-height: 1500px;
// animation: circle-bg--2 1500ms linear both 2000ms;
animation-name: circle-bg--2;
animation-duration: 1500ms;
animation-timing-function: linear;
animation-delay: 2000ms;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: both;
}
#keyframes circle-bg--2 {
0% { transform: translate3D(0, 0, -3000px); }
25% { transform: translate3D(0, 0, -2250px); }
50% { transform: translate3D(0, 0, -1500px); }
75% { transform: translate3D(0, 0, -750px); }
100% { transform: translate3D(0, 0, 0px); }
}
///////////////////////////// STARS & CONFETTI
.stars {
// animation: stars 1500ms linear both 2000ms;
animation-name: stars;
animation-duration: 1500ms;
animation-timing-function: linear;
animation-delay: 2000ms;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: both;
}
#keyframes stars {
0% { transform: translateZ(-500px); }
100% { transform: translateZ(500px); }
}
.confetti {
width: 50px;
height: 50px;
top: 120px;
left: 250px;
// animation: confetti 1500ms linear both 2000ms;
animation-name: confetti;
animation-duration: 1500ms;
animation-timing-function: linear;
animation-delay: 2000ms;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: both;
}
#keyframes confetti {
0% { transform: translateZ(-500px); filter: blur(0px); }
100% { transform: translateZ(500px); filter: blur(2px); }
}
.confetti--2 {
width: 100px;
height: 100px;
top: 480px;
left: 20px;
// animation: confetti--2 1500ms linear both 2000ms;
animation-name: confetti--2;
animation-duration: 1500ms;
animation-timing-function: linear;
animation-delay: 2000ms;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: both;
}
#keyframes confetti--2 {
0% { transform: skew(-20deg, 10deg) translateZ(-500px); filter: blur(0px); }
100% { transform: skew(-20deg, 10deg) translateZ(500px); filter: blur(2px); }
}
///////////////////////////// COINS
#mixin all-coins {
width: 100px;
height: 100px;
}
.coin-diamond {
#include all-coins;
top: 330px;
left: 180px;
// animation: coin-diamond 1500ms linear both 2000ms;
animation-name: coin-diamond;
animation-duration: 1500ms;
animation-timing-function: linear;
animation-delay: 2000ms;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: both;
}
#keyframes coin-diamond {
0% { transform: rotate(-45deg) translateZ(100px); filter: blur(0px); }
100% { transform: rotate(20deg) translateZ(1100px); filter: blur(5px); }
}
.coin-gold {
#include all-coins;
top: 300px;
left: 50px;
// animation: coin-gold 1500ms linear both 2000ms;
animation-name: coin-gold;
animation-duration: 1500ms;
animation-timing-function: linear;
animation-delay: 2000ms;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: both;
}
#keyframes coin-gold {
0% { transform: rotate(20deg) translateZ(-100px); filter: blur(0px); }
100% { transform: rotate(-40deg) translateZ(900px); filter: blur(4px); }
}
.coin-platinum {
#include all-coins;
top: 220px;
left: 200px;
// animation: coin-platinum 1500ms linear both 2000ms;
animation-name: coin-platinum;
animation-duration: 1500ms;
animation-timing-function: linear;
animation-delay: 2000ms;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: both;
}
#keyframes coin-platinum {
0% { transform: rotate(20deg) translateZ(-300px); filter: blur(0px); }
100% { transform: rotate(60deg) translateZ(700px); filter: blur(3px); }
}
.coin-silver {
#include all-coins;
top: 180px;
left: 50px;
// animation: coin-silver 1500ms linear both 2000ms;
animation-name: coin-silver;
animation-duration: 1500ms;
animation-timing-function: linear;
animation-delay: 2000ms;
animation-iteration-count: 1;
animation-direction: normal;
animation-fill-mode: both;
}
#keyframes coin-silver {
0% { transform: rotate(0deg) translateZ(-500px); filter: blur(0px); }
100% { transform: rotate(60deg) translateZ(500px); filter: blur(2px); }
}
}
</style>
`
I've tried to optimize by adding several trick code:
display block on all
not using shorthand animation
using class animation paused until img #load is true
have tried to use will-change, but later deleted it since somebody said it's better to be used in JS - now using translate3D and scale3D (on some, haven't changed the rest of the code)
using more than 2 keyframes (on some, haven't changed the rest of the code)
btw all assets are compressed under 100kb
I suspect is the blur animation, filter blur is a GPU destroyer when you abuse of that. Hope it helps!

Jssor slider Transitions fade in and fade out the 2 arrow

i have Jssor Slider , i want to make the 2 arrows left and right appear and display with fadein and fadeout
- when mouse over the 2 arrow fadein
- when mouse out the 2 arrows fadeout
any suggestion
thanks
Given there is an arrow navigator skin 'skin\arrow-01.source.html', please add following css code to to this job.
#slider1_container .jssora01l, #slider1_container .jssora01r {
opacity: 0;
}
#slider1_container:hover .jssora01l, #slider1_container:hover .jssora01r {
opacity: 1;
}
.jssora01l, .jssora01r {
-webkit-transition: opacity 0.25s linear;
-moz-transition: opacity 0.25s linear;
-o-transition: opacity 0.25s linear;
transition: opacity 0.25s linear;
}
And finally you will get the following arrow navigator skin,
<!-- Arrow Navigator Skin Begin -->
<style>
/* jssor slider arrow navigator skin 01 css */
/*
.jssora01l (normal)
.jssora01r (normal)
.jssora01l:hover (normal mouseover)
.jssora01r:hover (normal mouseover)
.jssora01ldn (mousedown)
.jssora01rdn (mousedown)
*/
.jssora01l, .jssora01r, .jssora01ldn, .jssora01rdn
{
position: absolute;
cursor: pointer;
display: block;
background: url(../img/a01.png) no-repeat;
overflow:hidden;
}
.jssora01l { background-position: -8px -38px; }
.jssora01r { background-position: -68px -38px; }
.jssora01l:hover { background-position: -128px -38px; }
.jssora01r:hover { background-position: -188px -38px; }
.jssora01ldn { background-position: -8px -38px; }
.jssora01rdn { background-position: -68px -38px; }
#slider1_container .jssora01l, #slider1_container .jssora01r {
opacity: 0;
}
#slider1_container:hover .jssora01l, #slider1_container:hover .jssora01r {
opacity: 1;
}
.jssora01l, .jssora01r {
-webkit-transition: opacity 0.25s linear;
-moz-transition: opacity 0.25s linear;
-o-transition: opacity 0.25s linear;
transition: opacity 0.25s linear;
}
</style>
<!-- Arrow Left -->
<span u="arrowleft" class="jssora01l" style="width: 45px; height: 45px; top: 123px; left: 8px;">
</span>
<!-- Arrow Right -->
<span u="arrowright" class="jssora01r" style="width: 45px; height: 45px; top: 123px; right: 8px">
</span>
<!-- Arrow Navigator Skin End -->

Is there away to make CSS animations and gradients work across all browsers?

I am currently trying to make my CSS3 animations work across most browsers but at the minute I am only getting it to work on web kit browsers.
Here is my code:
h1 {
font-family: 'BebasRegular', sans-serif;
font-size: 150px;
padding-bottom: 100px;
padding-top: 50px;
background: #E9AB17 -webkit-gradient(linear,left top, right top, from(#e8a917), to(#f4b011), color-stop(0.5, #fff)) 0 0 no-repeat ;
-webkit-background-size: 75px 200px;
color: rgba(255, 255, 255, 0.1);
-webkit-background-clip: text;
-webkit-animation-name: shine;
-webkit-animation-duration: 5s;
-webkit-animation-iteration-count: infinite;
text-align:center;
}
I have since added to code to and I am still having problems.
h1 {
font-family: 'BebasRegular', sans-serif;
font-size: 150px;
padding-bottom: 100px;
padding-top: 50px;
background: #E9AB17 -webkit-gradient(linear,left top, right top, from(#e8a917), to(#f4b011), color-stop(0.5, #fff)) 0 0 no-repeat ;
background: #E9AB17 -moz-gradient(linear,left top, right top, from(#e8a917), to(#f4b011), color-stop(0.5, #fff)) 0 0 no-repeat ;
background: #E9AB17 -o-gradient(linear,left top, right top, from(#e8a917), to(#f4b011), color-stop(0.5, #fff)) 0 0 no-repeat ;
background: #E9AB17 linear-gradient(linear,left top, right top, from(#e8a917), to(#f4b011), color-stop(0.5, #fff)) 0 0 no-repeat ;
-webkit-background-size: 75px 200px;
background-size: 75px 200px; /* Chrome, Firefox 4+, IE 9+, Opera, Safari 5+ */
color: rgba(255, 255, 255, 0.1);
-webkit-background-clip: text;
background-clip: text;
-webkit-animation-name: shine;
-moz-animation-name: shine;
-o-animation-name: shine;
animation-name: shine;
-webkit-animation-duration: 5s;
-moz-animation-duration: 5s;
-o-animation-duration: 5s;
animation-duration: 5s;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
animation-iteration-count: infinite;
text-align:center;
}
#-webkit-keyframes shine
{
0%
{
background-position: bottom left;
}
28%,100%
{
background-position: top right;
}
}
#-moz-keyframes shine {
0%
{
background-position: bottom left;
}
28%,100%
{
background-position: top right;
}
}#-o-keyframes shine {
0%
{
background-position: bottom left;
}
28%,100%
{
background-position: top right;
}
}#keyframes shine {
0%
{
background-position: bottom left;
}
28%,100%
{
background-position: top right;
}
}
Colorzilla
I guess thats probably what you need for the gradients.
as for animations
here
For more information regarding CSS compatibility see
here

Border radius cutting/image overlapping in Safari

I have looked through a few other questions and answers but still can't get this working in Safari (v 5.1.7).
Here is my code - jsfiddle
.services {
width: 218px;
float: left;
margin-right: 29px;
}
.services img {
border: solid 8px #ccc;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
}
.services a img:hover {
border: solid 8px #333;
-o-transition: all 1s ease 0s;
-ms-transition: all 1s ease 0s;
-moz-transition: all 1s ease 0s;
-webkit-transition: all 1s ease 0s;
transition: all 1s ease 0s;
}
The image is square 218px x 218px, so I'm guessin that has something to do with it, but I wanted it like that so it would look decent enough in older browsers that don't support border radius.
It's probably something simple, but I'm still stuck on this.
Thanks.
Al.
Answer from Sitepoint:
Hm, tricky. It works if you put the border on the instead:
Code:
.services {
width: 218px;
float: left;
margin-right: 29px;
}
.services img {
vertical-align: top;
}
.services img, .services a {
border-radius: 50%;
}
.services a {
border: 8px solid #ccc;
display: inline-block;
}
.services a:hover {
border: 8px solid #333;
-o-transition: all 1s ease 0s;
-ms-transition: all 1s ease 0s;
-moz-transition: all 1s ease 0s;
-webkit-transition: all 1s ease 0s;
transition: all 1s ease 0s;
}
You can just use border-radius now, without the vendor prefixes, as all browsers that are going to support it now.

inheritance in lesscss, doesn't inherit sub classes

this is my style.less code:
.transition {
-ms-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.shadow {
padding: 10px 10px 10px 10px;
margin: 10px 10px 10px 10px;
-moz-box-shadow: 0px 0px 10px #808080;
-o-box-shadow: 0px 0px 10px #808080;
-webkit-box-shadow: 0px 0px 10px #808080;
box-shadow: 0px 0px 10px #808080;
}
.shadow:hover {
-moz-box-shadow: 0px 0px 10px #a5a5a5;
-o-box-shadow: 0px 0px 10px #a5a5a5;
-webkit-box-shadow: 0px 0px 10px #a5a5a5;
box-shadow: 0px 0px 10px #a5a5a5;
}
.radius {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
#t1 {
.shadow;
.transition;
.radius;
}
but when I hover #t1 the shadow doesn't change. I want to know why it doesn't work and expect add #t1:hover and inherit the style is there any other way?
You need to change the .hover class to include the :hover state as part of the class definition:
.hover {
...styles...
&:hover {
...hover state styles...
}
}
.someOtherClass {
.hover;
}
Example
In order to have the :hover styles generated correctly you need to connect .shadow and .shadow:hover via the & operator so they belong together:
.shadow {
/*normal styles*/
&:hover{
/* hover styles */
}
}
The rest can stay the same, because
#t1{
.shadow;
}
will now automatically generate both, the normal and the hover rules.
You can try it out here: Online-Less-Converter
Every additional block you add to .shadow via the & operator will automatically be applied to #t1 as well, so if you add another:
.shadow{
&:hover{}
&.foo{
/* another set of rules*/
}
}
#t1{
.shadow; /* this will now generate 3 ruleblocks for #t1*/
}
the .foo ruleblock will be generated for #t1 as well:
#t1{...}
#t1:hover{...}
#t1.foo{/* another set of rules*/}