css3几个常用动效

1.放大的圈

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@keyframes zoom3 {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
}
 
.play {
  position: absolute;
  left: 14.62rem;
  top: 4.12rem;
  margin: 1rem auto;
  width: 0.38rem;
  height: 0.43rem;
  cursor: pointer;
  background: url(./images/play.png) no-repeat center / 100% 100%;
 
  &::after {
    content: "";
    .size(0.7rem, 0.7rem);
    animation: zoom3 2s ease-in-out infinite;
    border: 1px solid hsla(0, 0%, 100%, 0.6);
    border-radius: 100%;
    position: absolute;
    transform-origin: center;
    right: -0.12rem;
    bottom: -0.12rem;
  }
  &::before {
    content: "";
    .size(0.6rem, 0.6rem);
    animation: zoom3 2s ease-in-out 0.4s infinite;
    right: -0.08rem;
    bottom: -0.08rem;
    border: 1px solid hsla(0, 0%, 100%, 0.6);
    border-radius: 100%;
    position: absolute;
    transform-origin: center;
  }
}

  

2.呼吸(忽大忽小)

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.play {
  position: absolute;
  left: 14.62rem;
  top: 4.12rem;
  margin: 1rem auto;
  width: 0.38rem;
  height: 0.43rem;
  cursor: pointer;
  background: url(./images/play.png) no-repeat center / 100% 100%;
 
  animation: zoom2 2s ease-in-out infinite alternate;
}
 
@keyframes zoom2 {
  from {
    transform: scale(1);
  }
 
  to {
    transform: scale(0.8);
  }
}

  

3.小圈旋转

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.play {
  position: absolute;
  left: 14.62rem;
  top: 4.12rem;
  margin: 1rem auto;
  width: 0.38rem;
  height: 0.43rem;
  cursor: pointer;
  background: url(./images/play.png) no-repeat center / 100% 100%;
 
  &::before {
    content: "";
    .size(0.6rem, 0.6rem);
    background: url(./images/circle2.png) no-repeat center / 100% 100%;
    position: absolute;
    right: -0.08rem;
    bottom: -0.08rem;
    pointer-events: none;
    animation: circle 6s linear infinite;
  }
  &::after {
    content: "";
    .size(0.66rem, 0.66rem);
    background: url(./images/circle2.png) no-repeat center / 100% 100%;
    position: absolute;
    right: -0.11rem;
    bottom: -0.11rem;
    pointer-events: none;
    animation: circle2 6s linear infinite;
  }
}
 
@keyframes circle {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
 
@keyframes circle2 {
  0% {
    transform: rotate(-315deg);
  }
  100% {
    transform: rotate(45deg);
  }
}

  

 

posted @   芝麻小仙女  阅读(60)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
历史上的今天:
2019-09-20 React实现块依次从下到上进入的动画
点击右上角即可分享
微信分享提示