写在前面
- CSS 动画与绘制
- 3个小时的舞跳下来,这周竟然还不累?好吧,其实是我中间划水了 🙃
- 以后周六早课,一定要在8点前享受完早餐!今早跳舞低血糖,双耳一直耳鸣
动画与绘制
Animation
@keyframes 定义
animation: 使用
1
2
3
4
5
6
7
8
9
10@keyframes mykf {
from {background: red;}
to {background: yellow;}
}
div {
width: 100px;
height: 100px;
animation: mykf 5s infinite;
}
Animation Shortcut
- animation-name: 时间曲线
- animation-duration: 动画时长
- animation-timing-function: 动画的时间曲线
- animation-delay: 动画开始前的延迟
- animation-iteration-count: 动画的播放次数
- <single-animation-iteration-count> = infinite | <number>
- animation-direction: 动画方向
- <single-animation-direction> = normal | reverse | alternate | alternate-reverse
1 | /* @keyframes duration | timing-function | delay | |
贝瑟尔曲线拟合
Transition
Transition Shortcut
- transition-property: 要变换的属性
- transition-duration: 变换的时长
- transition-timing-function: 时间曲线
- transition-delay: 延迟
1 | /* Apply to 1 property */ |
渲染与颜色
颜色
CMYK 与 RGB
HSL 与 HSV
- Hue 色相(360度) Saturaiotn 饱和度、纯度 Lightness 明度
- 补色,对角色 –> Hue + 180
- Hue Saturation Value
形状
- border
- box-shadow
- border-radius
data uri + svg
- encodeUriComponent
1 | data:image/svg+xml,%3csvg%20width=%22100%25%22%20height=%22100%25%22%20version=%221.1%22%20xmlns=%22http://www.w3.org/2000/svg%22%3e%3cellipse%20cx=%22300%22%20cy=%22150%22%20rx=%22200%22%20ry=%2280%22%20style=%22fill:rgb(200,100,50);%20stroke:rgb(0,0,100);stroke-width:2%22/%3e%20%3c/svg%3e |
将 ComputedStyle 分类
写在后面
- 祝大家多多发财