0

我在这里看到了这个线程SVG 动画与 Safari 13.1 (Mac OS & IOS) 斗争,这似乎解决了“为什么”它不起作用但我不知道如何修改我的代码来添加这个建议:

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

这是我的代码..

// 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>

同样在这里我还想为动画图标添加代码:

           <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>

我有 SVG 图标,它们运行良好,并且可以在 PC 上的 chrome 中运行。

谢谢你的帮助

4

0 回答 0