CSS3 2D模拟摩天轮旋转
来源:互联网 发布:电梯算法 编辑:程序博客网 时间:2024/06/03 01:04
先看效果图:
由于上传的大小原因,只能录制成这种效果,原图是无限循环的转圈。
代码:
<span style="font-size:18px;"><!DOCTYPE html><html><head><meta charset="utf-8" /> <title>模拟摩天轮动画</title> <style>*{margin:0;padding:0;}.image{width:80px;height:80px;}.image1{width:620px;height:620px;}.div1{position:relative;margin:10px auto;width:638px;animation:run 20s linear infinite;-webkit-animation:run 20s linear infinite;-moz-animation:run 20s linear infinite;-o-animation:run 20s linear infinite;}img:nth-child(2){position:absolute;top:25px;left:270px;opacity:0.7;animation:run2 20s linear infinite;-webkit-animation:run2 20s linear infinite;-moz-animation:run2 20s linear infinite;-o-animation:run2 20s linear infinite;transform-origin:top center;-webkit-transform-origin:top center;-moz-transform-origin:top center;-o-transform-origin:top center;}img:nth-child(3){position:absolute;top:580px;left:270px;opacity:0.7;animation:run2 20s linear infinite;-webkit-animation:run2 20s linear infinite;-moz-animation:run2 20s linear infinite;-o-animation:run2 20s linear infinite;transform-origin:top center;-webkit-transform-origin:top center;-moz-transform-origin:top center;-o-transform-origin:top center;}img:nth-child(4){position:absolute;top:300px;left:550px;opacity:0.7;animation:run2 20s linear infinite;-webkit-animation:run2 20s linear infinite;-moz-animation:run2 20s linear infinite;-o-animation:run2 20s linear infinite;transform-origin:top center;-webkit-transform-origin:top center;-moz-transform-origin:top center;-o-transform-origin:top center;}img:nth-child(5){position:absolute;top:300px;left:0px;opacity:0.7;animation:run2 20s linear infinite;-webkit-animation:run2 20s linear infinite;-moz-animation:run2 20s linear infinite;-o-animation:run2 20s linear infinite;transform-origin:top center;-webkit-transform-origin:top center;-moz-transform-origin:top center;-o-transform-origin:top center;}@keyframes run{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@-webkit-keyframes run{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes run{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(360deg)}}@-o-keyframes run{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(360deg)}}@keyframes run2{0%{transform:rotate(0deg)}100%{transform:rotate(-360deg)}}@-webkit-keyframes run2{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(-360deg)}}@-moz-keyframes run2{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(-360deg)}}@-o-keyframes run2{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(-360deg)}}</style></head><body><div class="div1"> <img src="1.png" class="image1"> <img src="1.jpg" class="image"> <img src="2.jpg" class="image"> <img src="3.jpg" class="image"> <img src="4.jpg" class="image"> </div></body></html></span>
摩天轮原图:
注释:transform-origin 属性允许您改变被转换元素的位置。
这个属性主要的作用就是选择一个位置,然后绕着这个位置旋转。
0 0
- CSS3 2D模拟摩天轮旋转
- CSS3 2D旋转
- CSS3 模拟文字3D旋转
- css3值2d旋转
- css3 动画之 2D旋转 3D旋转 放大
- CSS3 2D平移,旋转,缩放,倾斜
- CSS3 3D旋转
- css3 3D旋转
- css3 2D和3D旋转效果
- CSS3旋转3D正方形
- CSS3 3d旋转效果
- css3之3d旋转
- CSS3动画-3D旋转
- CSS3 3D旋转透视
- CSS3 3D旋转动画
- CSS3 3D旋转魔方
- css3 3D旋转特效
- css3 3D旋转效果
- 数据结构之自建算法库——顺序表
- 【UML】— 用例图
- 基础知识之真静态实现
- 聪明人的活法!(深度好文)
- .net MVC 微信公众号 点击菜单拉取消息时的事件推送
- CSS3 2D模拟摩天轮旋转
- 主流浏览器的CSS hack
- 安卓---屏幕适配
- MDK st-link下载STM32程序出现Internal command error和Error:Flash download failed. Target DLL
- POJ-1328-Radar Installation
- 基础知识之伪静态实现
- gulp 之 React + ES6 自动编译随笔
- Android中UI控件的详细介绍(七)——ImageButton
- 互斥的数