css - 需要为像骑士骑士灯泡这样的图像制作动画

标签 css html animation

enter image description here

我确实有上面的“png”图像。你能告诉我如何像骑士骑士灯泡那样制作动画吗?我对动画没有太多经验。非常感谢任何帮助。

最佳答案

简单快速的示例如下:

i {
    display: inline-block;
    vertical-align:middle;
    width:10px;
    height:10px;
    border-radius:50%;
    background: red;
    -webkit-animation: kn 1.6s ease-in-out infinite;
    animation: kn 1.6s ease-in-out infinite;
}

i:nth-child(9){
    -webkit-animation-delay:0;
    animation-delay:0;
}
i:nth-child(8){
    -webkit-animation-delay:-0.2s;
    animation-delay:-0.2s;
}
i:nth-child(7){
    -webkit-animation-delay:-0.4s;
    animation-delay:-0.4s;
}
i:nth-child(6){
    -webkit-animation-delay:-0.6s;
    animation-delay:-0.6s;
}
i:nth-child(5){
    -webkit-animation-delay:-0.8s;
    animation-delay:-0.8s;
}
i:nth-child(4){
    -webkit-animation-delay:-1s;
    animation-delay:-1s;
}
i:nth-child(3){
    -webkit-animation-delay:-1.2s;
    animation-delay:-1.2s;
}
i:nth-child(2){
    -webkit-animation-delay:-1.4s;
    animation-delay:-1.4s;
}
i:nth-child(1){
    -webkit-animation-delay:-1.6s;
    animation-delay:-1.6s;
}

@-webkit-keyframes kn {
    0% {
        opacity: 0.1;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity:0.1;
    }
}

@keyframes kn {
    0% {
        opacity: 0.1;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity:0.1;
    }
}
<div> 
    <i></i>
    <i></i>
    <i></i>
    <i></i>
    <i></i>
    <i></i>
    <i></i>
    <i></i>
    <i></i>
</div>

用它来调整你想要的时间。

关于css - 需要为像骑士骑士灯泡这样的图像制作动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29248982/

相关文章:

css - SVG:内联或链接

javascript - 当满足 javascript/jquery 条件时显示 DIV(包括 jsFiddle 链接)

javascript - 一个简单的问题: Material-UI TextField,如何在不同的断点处设置不同的字体大小?

javascript - CSS 变换还是缩放?挂载动画

asp.net - 如何过滤上传对话框中可以看到哪些文件?

javascript - 如何使用 innerHTML 将对象值正确打印到 DIV?

performance - 如何以最佳效率在paperjs中重新定位路径线?

ios - 创建动画时,为什么要向 UIView 类属性发送消息?

jquery - 使用 jQuery 触发连续的 animated.css 动画

jquery - 如何在 Flask 应用程序的同一页面上发布输出结果?