仿网易nec首页动画效果

简介: 仿网页nec首页动画效果nec链接:http://nec.netease.com/首先,介绍animationanimation检索或设置对象所应用的动画特效。animation由“keyframes”这个属性来实现这样的效果。

仿网页nec首页动画效果
nec链接:http://nec.netease.com/

首先,介绍animation
animation检索或设置对象所应用的动画特效。
animation由“keyframes”这个属性来实现这样的效果。
keyframes具有其自己的语法规则,他的命名是由"@keyframes"开头,后面紧接着是这个“动画的名称”加上一对花括号“{}”,括号中就是一些不同时间段样式规则,有点像我们css的样式写法一样。

关于animation属性介绍:
animation-name:检索或设置对象所应用的动画名称
animation-duration:检索或设置对象动画的持续时间
animation-timing-function:检索或设置对象动画的过渡类型
animation-delay:检索或设置对象动画延迟的时间
animation-iteration-count:检索或设置对象动画的循环次数
animation-direction:检索或设置对象动画在循环中是否反向运动
animation-play-state:检索或设置对象动画的状态。w3c正考虑是否将该属性移除,因为动画的状态可以通过其它的方式实现,比如重设样式

nec动画实现原理:
采用三层背景层、气泡层、文字镂空层。气泡层通过animation属性实现了运动效果。


html结构:

<div class="kbanner">
    <div class="knecbg knecone"></div>
    <div class="knecbg knectwo">
        <i></i>
        <i></i>
        <i></i>
        <i></i>
        <i></i>
    </div>
    <div class="knecbg knecthree"></div>
</div>


css样式:

.kbanner{
    position: relative;
    width: 856px;
    height: 366px;
    background: url(http://images.cnblogs.com/cnblogs_com/kuikui/354173/o_banner1.jpg) center top no-repeat;
}
.knecbg{
    position: absolute;
    left: 150px;
    top: 77px;
    width: 487px;
    height: 186px;
    overflow: hidden;
}
.knecone{
    background: url(http://images.cnblogs.com/cnblogs_com/kuikui/354173/o_pao.png) left top no-repeat;
    z-index: 1;
}
.knectwo{
    z-index: 2;
}
.knecthree{
    background: url(http://images.cnblogs.com/cnblogs_com/kuikui/354173/o_pao.png) left bottom no-repeat;
    z-index: 3;
}
.knectwo i{
    position: absolute;
    display: block;
    top: -50px;
    width: 53px;
    height: 56px;
    overflow: hidden;
    background: url(http://images.cnblogs.com/cnblogs_com/kuikui/354173/o_pao.png) no-repeat -9999px -9999px;
    -webkit-animation: paoi 7s 2s infinite;
    -moz-animation: paoi 7s 2s infinite;
    -ms-animation: paoi 7s 2s infinite;
    animation: paoi 7s 2s infinite;
}
.knectwo i:nth-child(1){
    left: 25px;
    -webkit-animation-delay: 3s;
    -moz-animation-delay: 3s;
    -ms-animation-delay: 3s;
    animation-delay: 3s;
    background-position: -507px 0;
}
.knectwo i:nth-child(2){
    left: 85px;
    -webkit-animation-delay: 6s;
    -moz-animation-delay: 6s;
    -ms-animation-delay: 6s;
    animation-delay: 6s;
    background-position: -507px -64px;
}
.knectwo i:nth-child(3){
    left: 190px;
    -webkit-animation-delay: 4s;
    -moz-animation-delay: 4s;
    -ms-animation-delay: 4s;
    animation-delay: 4s;
    background-position: -507px -140px;
}
.knectwo i:nth-child(4){
    left: 285px;
    -webkit-animation-delay: 8s;
    -moz-animation-delay: 8s;
    -ms-animation-delay: 8s;
    animation-delay: 8s;
    background-position: -507px 0;
}
.knectwo i:nth-child(5){
    left: 400px;
    -webkit-animation-delay: 5s;
    -moz-animation-delay: 5s;
    -ms-animation-delay: 5s;
    animation-delay: 5s;
    background-position: -507px 0;
}
@-webkit-keyframes paoi {
    0% {
    top:186px;
}
100% {
    top:-56px;
}
}@-moz-keyframes paoi {
    0% {
    top:186px;
}
100% {
    top:-56px;
}
}@-ms-keyframes paoi {
    0% {
    top:186px;
}
100% {
    top:-56px;
}
}@keyframes paoi {
    0% {
    top:186px;
}
100% {
    top:-56px;
}



nec动画效果:

<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>仿网易nec首页动画效果</title> <style> *{padding: 0px; margin: 0px;} .kbanner{ position: relative; width: 856px; height: 366px; background: url(http://images.cnblogs.com/cnblogs_com/kuikui/354173/o_banner1.jpg) center top no-repeat; } .knecbg{ position: absolute; left: 150px; top: 77px; width: 487px; height: 186px; overflow: hidden; } .knecone{ background: url(http://images.cnblogs.com/cnblogs_com/kuikui/354173/o_pao.png) left top no-repeat; z-index: 1; } .knectwo{ z-index: 2; } .knecthree{ background: url(http://images.cnblogs.com/cnblogs_com/kuikui/354173/o_pao.png) left bottom no-repeat; z-index: 3; } .knectwo i{ position: absolute; display: block; top: -50px; width: 53px; height: 56px; overflow: hidden; background: url(http://images.cnblogs.com/cnblogs_com/kuikui/354173/o_pao.png) no-repeat -9999px -9999px; -webkit-animation: paoi 7s 2s infinite; -moz-animation: paoi 7s 2s infinite; -ms-animation: paoi 7s 2s infinite; animation: paoi 7s 2s infinite; } .knectwo i:nth-child(1){ left: 25px; -webkit-animation-delay: 3s; -moz-animation-delay: 3s; -ms-animation-delay: 3s; animation-delay: 3s; background-position: -507px 0; } .knectwo i:nth-child(2){ left: 85px; -webkit-animation-delay: 6s; -moz-animation-delay: 6s; -ms-animation-delay: 6s; animation-delay: 6s; background-position: -507px -64px; } .knectwo i:nth-child(3){ left: 190px; -webkit-animation-delay: 4s; -moz-animation-delay: 4s; -ms-animation-delay: 4s; animation-delay: 4s; background-position: -507px -140px; } .knectwo i:nth-child(4){ left: 285px; -webkit-animation-delay: 8s; -moz-animation-delay: 8s; -ms-animation-delay: 8s; animation-delay: 8s; background-position: -507px 0; } .knectwo i:nth-child(5){ left: 400px; -webkit-animation-delay: 5s; -moz-animation-delay: 5s; -ms-animation-delay: 5s; animation-delay: 5s; background-position: -507px 0; } @-webkit-keyframes paoi { 0% { top:186px; } 100% { top:-56px; } }@-moz-keyframes paoi { 0% { top:186px; } 100% { top:-56px; } }@-ms-keyframes paoi { 0% { top:186px; } 100% { top:-56px; } }@keyframes paoi { 0% { top:186px; } 100% { top:-56px; } </style> </head> <body> <div class="kbanner"> <div class="knecbg knecone"></div> <div class="knecbg knectwo"> <i></i> <i></i> <i></i> <i></i> <i></i> </div> <div class="knecbg knecthree"></div> </div> </body> </html>

目录
相关文章
|
8天前
|
域名解析 人工智能 Linux
|
18天前
|
Linux Go 开发工具
手机上跑 DeepSeek 智能体:开源安卓客户端 DSH Go 安装与使用指南
DSH Go 是一款开源安卓客户端,将 DeepSeek Harness 智能体引擎装进手机:免 Root、免 Termux,一键安装即用;支持本机运行(内置 Ubuntu+Node.js)或远程接管电脑会话;具备插话打断、过程折叠、屏幕操控、端到端加密分享等特色功能,真正实现智能体“口袋化”。
16872 62
|
16天前
|
人工智能
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
进不去 Antigravity 或 Gemini,提示所在地区不可用?三步查清 Google 账号关联地区、官方更正表单理由选法与改区注意事项。
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
|
2天前
|
人工智能 安全 网络安全
|
5天前
|
云安全 数据采集 人工智能
|
7天前
|
Linux API iOS开发
【DSH】DeepSeek Harness新手保姆教程(下载+安装+配置+使用,2026最新实测)
DeepSeek Harness(dsh)是 DeepSeek AI 开源的智能体框架,秉持“一切皆插件”理念,支持读文件、改代码、执行命令、处理表格等自动化任务;免费开源,兼容 Win/macOS,需配 API 密钥使用。(239字)
1227 2
|
13天前
|
人工智能 开发工具 开发者
2026最新codex下载安装保姆级使用教程(下载+安装+登录+使用,含所有历史版本)
Codex 是 OpenAI 推出的开源 AI 编程智能体,跑在本地终端和桌面客户端里,能读懂整个代码仓库,一句自然语言就能让它改代码、执行命令、跑测试、修 Bug,支持 Windows、macOS、Linux 三大平台。本文把 Codex下载、安装、登录、汉化、基础使用一次讲全,并整理了国内用户最常踩的坑,跟着做 10 分钟就能跑起来。
2323 7
|
18天前
|
弹性计算 人工智能 API
Codex超详细入门指南(下载·安装·登录·上手,全版本覆盖,2026最新版)
建议收藏本教程,2026 全年各版本更新随时回来查阅。如果你在搭建过程中遇到任何问题,欢迎结合 阿里云工单系统 提交技术支持请求,或在 阿里云开发者社区 搜索 Codex 相关话题交流。 祝你编码愉快,效率翻倍!
3794 22
|
19天前
|
Linux API iOS开发
【DSH】DeepSeek Harness新手保姆教程(下载+安装+配置+使用,2026最新实测)
DeepSeek Harness(dsh)是DeepSeek AI开源的智能体框架,秉持“一切皆插件”理念,支持读文件、改代码、跑命令、处理表格、联网搜索等操作。免费开源,兼容Windows/macOS/Linux,提供桌面端与网页端,可灵活安装插件扩展能力。