博客
关于我
css3转换
阅读量:320 次
发布时间:2019-03-03

本文共 1976 字,大约阅读时间需要 6 分钟。

1 2D转换

1.1 二维坐标系

1.2 2D转换之移动translate

    
Document

实现盒子中的盒子水平居中,垂直居中

 

    
Document

123

1.2 2D旋转之rotate

鼠标经过,图片旋转360度

    
Document

三角形

    
Document

旋转中心点transform-origin

    
Document

图片从左下角逆时针旋转出现

    
Document

1.3 2D转换之缩放scale

    
Document
123123

鼠标经过,图片变大

    
Document

    
Document
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

1.4 2D转换综合写法

    
Document

 

2 css3动画

2.1 什么是动画

  • 动画是 CSS3 中最具颠覆性的特征之一,可通过设置多个节点来精确的控制一个或者一组动画,从而实现复杂的动画效果

2.2 动画的基本使用

  • 先定义动画

  • 在调用定义好的动画

2.3 语法格式(定义动画)

@keyframes 动画名称 {    0% {        width: 100px;    }    100% {        width: 200px    }}

2.4 语法格式(使用动画)

div {    /* 调用动画 */    animation-name: 动画名称;    /* 持续时间 */    animation-duration: 持续时间;}

2.5 动画序列

  • 0% 是动画的开始,100 % 是动画的完成,这样的规则就是动画序列

  • 在 @keyframs 中规定某项 CSS 样式,就由创建当前样式逐渐改为新样式的动画效果

  • 动画是使元素从一个样式逐渐变化为另一个样式的效果,可以改变任意多的样式任意多的次数

  • 用百分比来规定变化发生的时间,或用 fromto,等同于 0% 和 100%

2.6 代码演示

    
Document

2.7 常见的属性

代码演示

    
Document

2.8 动画简写方式

  1. 动画简写方式

    /* animation: 动画名称 持续时间 运动曲线 何时开始 播放次数 是否反方向 起始与结束状态 */animation: name duration timing-function delay iteration-count direction fill-mode
  2. 知识要点

    • 简写属性里面不包含 animation-paly-state

    • 暂停动画 animation-paly-state: paused; 经常和鼠标经过等其他配合使用

    • 要想动画走回来,而不是直接调回来:animation-direction: alternate

    • 盒子动画结束后,停在结束位置:animation-fill-mode: forwards

  3. 代码演示

    animation: move 2s linear 1s infinite alternate forwards;

2.9 热点图案例

 

2.10 速度曲线细节

  1. 速度曲线细节

    
Document
世纪佳缘我在这里等你

奔跑的熊大  

    
Document

 

转载地址:http://gsql.baihongyu.com/

你可能感兴趣的文章
nodejs包管理工具对比:npm、Yarn、cnpm、npx
查看>>
NodeJs单元测试之 API性能测试
查看>>
nodejs图片转换字节保存
查看>>
nodejs在Liunx上的部署生产方式-PM2
查看>>
nodejs基于art-template模板引擎生成
查看>>
nodejs字符与字节之间的转换
查看>>
NodeJs学习笔记001--npm换源
查看>>
NodeJs学习笔记002--npm常用命令详解
查看>>
nodejs学习笔记一——nodejs安装
查看>>
vue3+Element-plus icon图标无法显示的问题(已解决)
查看>>
NodeJS实现跨域的方法( 4种 )
查看>>
nodejs封装http请求
查看>>
nodejs常用组件
查看>>
nodejs开发公众号报错 40164,白名单配置找不到,竟然是这个原因
查看>>
Nodejs异步回调的处理方法总结
查看>>
NodeJS报错 Fatal error: ENOSPC: System limit for number of file watchers reached, watch ‘...path...‘
查看>>
nodejs支持ssi实现include shtml页面
查看>>
Nodejs教程09:实现一个带接口请求的简单服务器
查看>>
nodejs服务端实现post请求
查看>>
nodejs框架,原理,组件,核心,跟npm和vue的关系
查看>>