CSS特效

简介: CSS特效

水波球

HTML

<div class="container">
     <div class="wave"></div>
</div>

CSS3代码

/*容器显示外层圆框和居中*/
        .container {
            position: absolute;
            width: 150px;
            height: 150px;
            padding: 5px;
            /*外层圆框及颜色*/
            border: 5px solid rgb(118, 218, 255);
            /*居中核心代码*/
            /*先让container左上角和父容器中心对齐*/
            top: 50%;
            left: 50%;
            /*在向左和向上平移container宽和高的一半*/
            transform: translate(-50%, -50%);
            /*这会让container变成一个圆形*/
            border-radius: 50%;
            overflow: hidden;
        }
        .wave {
            position: relative;
            width: 150px;
            height: 150px;
            background-color: rgb(118, 218, 255);
            border-radius: 50%;
            box-shadow: inset 0 0 30px 0 rgba(0,0,0,.5), 0 4px 10px 0 rgba(0,0,0,.5);
            /*水波通用代码*/
            &::before,
            &::after{
                content: "";
                position: absolute;
                /*大小一定要是显示部分的二倍*/
                width: 300px;
                height: 300px;
                top: 0;
                left: 50%;
                background-color: rgba(255, 255, 255, .4);
                /*圆角45度市水波的关键*/
                border-radius: 45%;
                transform: translate(-50%, -70%) rotate(0);
                animation: rotatekeyframe 6s linear infinite;
                z-index: 10;
            }
            /*为了做两层水波*/
            &::after {
                border-radius: 47%;
                background-color: rgba(255, 255, 255, .9);
                transform: translate(-50%, -70%) rotate(0);
                animation: rotatekeyframe 10s linear -5s infinite;
                z-index: 20;
            }
        }
        /*&::before和&::after的旋转效果*/
        @keyframes rotatekeyframe {
            50% {
                transform: translate(-50%, -73%) rotate(180deg);
            } 100% {
                  transform: translate(-50%, -70%) rotate(360deg);
            }
        }

相关文章
|
JavaScript Linux 数据安全/隐私保护
node内网安装npm私服以及依赖包上传发布verdaccio
node内网安装npm私服以及依赖包上传发布verdaccio
2136 1
|
9月前
|
人工智能 IDE API
Trae、VS Code、Cursor如何接入阿里云百炼Coding Plan?
阿里云百炼Coding Plan支持VS Code、Cursor、Trae等编辑器,通过Claude Code、Kilo Code、Qwen Code等插件一键接入,提供AI编程、智能补全与调试能力。需先订阅服务,仅限AI编程工具及OpenClaw类Agent使用。
|
11月前
|
人工智能 自然语言处理 安全
Claude Code 插件登陆 VS Code:开发者迎来 AI 编程新利器
Anthropic正式发布Claude Code——VS Code官方插件,支持多语言智能补全、代码解释、错误诊断与安全重构。隐私优先、长上下文(200K tokens)处理能力强,显著优于Copilot的可解释性与代码质量,已获开发者广泛好评。(239字)
9553 5
|
前端开发 JavaScript API
前端开发:axios在项目中的应用
前端开发:axios在项目中的应用
102 0
前端开发:axios在项目中的应用
|
9天前
|
域名解析 人工智能 Linux
|
19天前
|
Linux Go 开发工具
手机上跑 DeepSeek 智能体:开源安卓客户端 DSH Go 安装与使用指南
DSH Go 是一款开源安卓客户端,将 DeepSeek Harness 智能体引擎装进手机:免 Root、免 Termux,一键安装即用;支持本机运行(内置 Ubuntu+Node.js)或远程接管电脑会话;具备插话打断、过程折叠、屏幕操控、端到端加密分享等特色功能,真正实现智能体“口袋化”。
17344 63
|
17天前
|
人工智能
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
进不去 Antigravity 或 Gemini,提示所在地区不可用?三步查清 Google 账号关联地区、官方更正表单理由选法与改区注意事项。
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
|
3天前
|
人工智能 安全 网络安全
|
6天前
|
云安全 数据采集 人工智能
|
7天前
|
Linux API iOS开发
【DSH】DeepSeek Harness新手保姆教程(下载+安装+配置+使用,2026最新实测)
DeepSeek Harness(dsh)是 DeepSeek AI 开源的智能体框架,秉持“一切皆插件”理念,支持读文件、改代码、执行命令、处理表格等自动化任务;免费开源,兼容 Win/macOS,需配 API 密钥使用。(239字)
1332 3