`

CSS模仿加速球

阅读更多

CSS模仿加速球

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <style>
        #tout, html, body {
            width: 100%;
            height: 100%;
        }

        #tout {
            position: relative;
        }

        #tout:first-child div {
            display: block;
            width: 100px;
            height: 100px;
            border: 2px solid #000;
            border-radius: 50%;
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            margin: auto;
        }

        #tout:first-child>div>div {
            width: 90px;
            height: 90px;
            border: 5px solid #fff;
            border-radius: 50%;
            margin: auto;
            overflow: hidden;
        }

        #tout:first-child div div div {
            width: 110px;
            height: 110px;
            margin: auto;
            top: 360px;
            background-color: #ddd;
            border-radius: 0%;
            border: none;
            animation-name: anim, color;
            animation-duration: 5s;
            animation-timing-function:ease;
            animation-iteration-count:infinite;
            animation-direction: alternate;
        }

        @keyframes anim{

            100% { top:0 }
        }

        /* @keyframes color{
          0%  { background-color: green; }
          25%  { background-color: green; }
          50% { background-color: red; }
          75% { background-color: yellow; }
          100% { background-color: blue; }
        } */
    </style>
</head>
<body>
<div id="tout">
    <div>
        <div>
            <div>
            </div>
        </div>
    </div>
</div>
</body>
</html>

 

 

 

 

 

.

分享到:
评论

相关推荐

    模仿搜狗浏览器加载小球

    1. 使用CSS3硬件加速:通过`transform`和`opacity`属性实现动画,而非`left`、`top`等属性,以利用GPU加速,提高性能。 2. 减少重排和重绘:合理布局和设置动画属性,减少不必要的DOM操作,避免频繁触发浏览器的...

    仿支付宝蚂蚁森林能量球效果

    可以使用硬件加速,合理设置动画的持续时间和帧率,以及避免不必要的重绘。 7. **动画监听器**: 可以添加Animation监听器来感知动画的开始、结束和重复等状态,这样可以添加额外的逻辑,如播放音效或更新UI。 通过...

    仿UC加载动画

    7. **性能优化**:为了确保动画的流畅性,开发者需要关注性能优化,如合理使用硬件加速、减少不必要的重绘和回流,以及控制动画的帧率,以防止过度消耗系统资源。 8. **可扩展性**:好的加载动画设计应考虑到未来的...

    Twitter-Feed-Clone

    【描述】:该项目的核心目标是创建一个用户界面,模仿Twitter的主要特性,如发布推文、查看时间线、用户资料展示等。这将涉及到前端开发技术,特别是CSS,用于样式设计和布局管理。通过完成这个项目,开发者可以提升...

    HTML5-Animation-with-JavaScript

    - **缓动与弹簧效应**:缓动技术可以使动画的起始和结束更加平滑,避免突然的加速或减速。而弹簧效应则是模仿物体在受到外力作用后,像弹簧一样弹回原位的行为。 - **碰撞检测**:在复杂的场景中,准确判断两个或多...

    simple_babylonjs:最小的巴比伦JS示例

    BabylonJS是基于WebGL的,因此它能够利用现代浏览器的硬件加速能力来呈现高质量的3D图形。这个框架支持多种特性,包括光照、阴影、纹理、动画、物理引擎、粒子系统等。它的设计目标是易于上手,同时为高级开发者提供...

Global site tag (gtag.js) - Google Analytics