Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVG animation struggles with Safari 13.1 (Mac OS & IOS)

I just realized that the latest version of Safari (v13.1) that comes with macOs 10.15.4 and iOS 13.4 doesn't support css animations in SVG files anymore. I use this trick to display a loading animation on my portfolio. Now only the first frame of the sag file is display and the animation doesn't start. https://jbkaloya.com

Safari 13.1

No issues with Chrome or Firefox tho.

Chrome (working)

EDIT

Here's the corresponding CSS properties in where the file is embedded in the page

.loading {
  background-color: $black-color;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  text-align: center;
  z-index: 1100;
  opacity: 1;
  transition: opacity .4s 0s cubic-bezier(.455,.03,.515,.955), z-index 0s 0s linear;
  
  &::before {
    content: '';
    background-image: url(../images/logoanimated.svg);
    background-position: center;
    background-repeat: no-repeat;
	position: absolute;
	display: flex;
	width: 100%;
	height: 100%;
	max-width: 22rem;
	margin: auto;
	left: 0;
	right: 0;
  }

I guess it can also be related to those properties (that are located in the svg file and that start the animation sequence)

    {
-webkit-animation-duration: 3s;
animation-duration: 3s;
-webkit-animation-iteration-count: 1;
animation-iteration-count: 1
      }

Am I the only one concern by this issue ?

Safari 13.1 changelog: https://developer.apple.com/documentation/safari_release_notes/safari_13_1_beta_release_notes

like image 855
Jean-Baptiste Kaloya Avatar asked Mar 03 '23 15:03

Jean-Baptiste Kaloya


1 Answers

I had a similar issue. To resolve, I utilized an object with type set to image/svg+xml.

<object type="image/svg+xml" data="animation/some.svg">
like image 111
Brandy Avatar answered Mar 11 '23 13:03

Brandy