当前位置: 首页 > news >正文

css 动画之旋转视差

序:网上看到的一个例子,做一下

效果图:

 

代码:

<style>.content{width: 300px;height: 300px;margin: 139px auto;display: grid;grid-template-columns: repeat(3,1fr);grid-template-rows: repeat(3,1fr);grid-template: "A A B""C D B""C E E";gap: 5px;--r: 360deg;}.item{display: flex;align-items: center;justify-content: center;overflow: hidden;border: 2px solid;border-radius: 20%;}.item:nth-child(1){grid-area: A;}.item:nth-child(2){grid-area: B;}.item:nth-child(3){grid-area: C;}.item:nth-child(4){grid-area: D;}.item:nth-child(5){grid-area: E;}.image{width: 240px;height: 240px;--r: -360deg;}.content,.image{animation: rotation 5s linear infinite;}@keyframes rotation {to{transform: rotate(var(--r));}}
</style>
<div class="content"><div class="item"><img class="image" src="https://image.happyacomma.top/images/2022/12/22/1.jpg" alt="1"/></div><div class="item"><img class="image" src="https://image.happyacomma.top/images/2022/12/22/2.jpg" alt="2"/></div><div class="item"><img class="image" src="https://image.happyacomma.top/images/2022/12/22/3.jpg" alt="3"/></div><div class="item"><img class="image" src="https://image.happyacomma.top/images/2022/12/22/4.jpg" alt="4"/></div><div class="item"><img class="image" src="https://image.happyacomma.top/images/2022/12/22/5.jpg" alt="5"/></div>
</div>

原理比较简单,旋转一顺一逆,效果则出来了

http://www.lryc.cn/news/102728.html

相关文章:

  • maven项目、springboot项目复制文件进来后没反应、不编译解决方法
  • android jetpack App Startup 应用启动时初始化组件(java)
  • 【设计模式|行为型】命令模式(Command Pattern)
  • SqlServer 批量删除表
  • [Linux]线程基本知识
  • STM32 串口基础知识学习
  • 页面滚动时隐藏element-ui下拉框/时间弹框
  • C#中i++和++i的底层原理
  • 在win10下安装verilator
  • java设计模式-建造者(Builder)设计模式
  • iOS开发-实现获取下载主题配置动态切换主题
  • react经验4:动态组件
  • Java maven的下载解压配置(保姆级教学)
  • Java课题笔记~数据库连接池
  • 设计模式-单例模式
  • golang mysql
  • uniapp使用echarts
  • Python命令模式介绍、使用
  • #typescript 使用file-saver模块#
  • 移动端适配布局rem和vw
  • 【Java基础教程】(四十八)集合体系篇 · 上:全面解析 Collection、List、Set常用子接口及集合元素迭代遍历方式~【文末送书】
  • 什么是 DNS ANAME 解析?
  • Neo4j 集群和负载均衡
  • go web框架 gin-gonic源码解读01————Engine
  • windows版docker部署springcloud项目
  • 探索工程机械远程控制新纪元:Intewell-Hyper II震撼发布!
  • DM8 DSC集群实时主备搭建
  • 配置IPv4 over IPv6隧道示例
  • 在中国区部署日志通2.0
  • centos下安装jdk