SVG Animation in iOS 13.4 (Safari) with js

316 Views Asked by At

I have seen this thread here SVG animation struggles with Safari 13.1 (Mac OS & IOS) which seems to address the 'why' it's not working but I am not sure how to modify my code to add this suggestion:

<object type="image/svg+xml" data="animation/some.svg">

Here is my code..

// Build HTML
    return html`
      <style>
      ${this.style()}
      </style>
      <ha-card class = "card">
        <span class="icon bigger" id="icon-bigger" style="background: none, url(${this._hass.hassUrl("/local/icons/weather_icons/" + (this.config.static_icons ? "static" : "animated") + "/" + this.weatherIcons[this.current.conditions] + ".svg")}) no-repeat; background-size: contain;">${this.current.conditions}</span>

also here I also want to add code for animated icons:

           <div class="forecast clear">
              ${this.forecast.map(daily => html`
                <div class="day fcasttooltip">
                  <span class="dayname" id="fcast-dayName-${daily.dayIndex}">${(daily.date).toLocaleDateString(this.config.locale,{weekday: 'short'})}</span>
                  <br><i class="icon" id="fcast-icon-${daily.dayIndex}" style="background: none, url(${this._hass.hassUrl("/local/icons/weather_icons/" + (this.config.static_icons ? "static" : "animated") + "/" + this.weatherIcons[this._hass.states[daily.condition].state] + ".svg")}) no-repeat; background-size: contain;"></i>

I have SVG icons that have been working perfectly and do work in chrome on a PC.

Thanks for any help

0

There are 0 best solutions below