首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >能否将HTML+CSS动画(png扩展图像)转换为.gif扩展图像?

能否将HTML+CSS动画(png扩展图像)转换为.gif扩展图像?
EN

Stack Overflow用户
提问于 2019-01-09 14:48:52
回答 1查看 727关注 0票数 1

我需要创建加载器GIF,但加载器是用HTML + CSS动画(png扩展图像),我想转换的网络加载器到GIF图像,任何可用来转换HTML到GIF的工具。

这是链接:https://jsfiddle.net/6uedrb89/6/

以下是演示:

有人能帮我解决这个问题吗?

提前感谢

代码语言:javascript
复制
<div class="tc-play-animated-loading">
    <img src="https://s27138.pcdn.co/wp-content/uploads/2018/09/favIcon.png" alt="play" class="tc-play-animated">
</div>

<style>
div.tc-play-animated-loading {
    position: absolute;
    width: 100px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50% );
}

img.tc-play-animated {
    -webkit-animation: play-filter-animation 8s linear infinite;
    -moz-animation: play-filter-animation 8s linear infinite;
    -o-animation: play-filter-animation 8s linear infinite;
    -ms-animation: play-filter-animation 8s linear infinite;
    animation: play-filter-animation 8s linear infinite; 
}
@-webkit-keyframes play-filter-animation{
    from{
        -webkit-filter:hue-rotate(-360deg)
    }
    to{
        -webkit-filter:hue-rotate(360deg)
    }
}
@-o-keyframes play-filter-animation{
    from{
        -o-filter:hue-rotate(-360deg)
    }
    to{
        -o-filter:hue-rotate(360deg)
    }
}
@-moz-keyframes play-filter-animation{
    from{
        -moz-filter:hue-rotate(-360deg)
    }
    to{
        -moz-filter:hue-rotate(360deg)
    }
}
@-ms-keyframes play-filter-animation{
    from{
        -ms-filter:hue-rotate(-360deg)
    }
    to{
        -ms-filter:hue-rotate(360deg)
    }
}
@keyframes play-filter-animation{
    0%{
        filter:hue-rotate(-360deg)
    }
    50%{
        filter:hue-rotate(360deg)
    }
    100%{
        filter:hue-rotate(0)
    }
}
</style>
EN

回答 1

Stack Overflow用户

发布于 2019-01-09 14:58:32

filter:hue更改为transform

代码语言:javascript
复制
@-webkit-keyframes play-filter-animation{
   0%{-webkit-transform: rotate(0deg)}
   100%{-webkit-transform: rotate(360deg)}
}

@keyframes play-filter-animation{

  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }

}

https://jsfiddle.net/lalji1051/u7fw4jd5/6/

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54104578

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档