代码需组合其他 css 扩展使用

1
2
3
4
5
6
7
8
9
10
<div class="ball-grid margin-top-xxl grid ring-col-4">
<div class="item text-center flex align-center flex-direction">
<div class="round flex justify-center align-center">
<div class="text-lg color txt">
Title
</div>
</div>
<div class="text-sm margin-top text-height color padding-lr">Description</div>
</div>
</div>
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
50
51
52
53
54
.ball-grid {
.item {
width: calc(25% - 20px) !important;
margin: 0px 10px;
.round {
background: #111111;
width: 250px;
height: 250px;
max-width: 100%;
position: relative;
&:after {
content: "";
position: absolute;
top: -3px;
left: -3px;
width: calc(100% + 6px);
height: calc(100% + 6px);
background-color: @---thime-color;
border-radius: 50%;
z-index: -1;
}
.txt {
position: relative;
z-index: 1;
color: #fff;
}
}
&:hover {
.round {
&:after {
background-image: -webkit-linear-gradient(to right, #421039, #b37631);
background-image: -moz-linear-gradient(to right, #421039, #b37631);
background-image: -o-linear-gradient(to right, #421039, #b37631);
background-image: -ms-linear-gradient(to right, #421039, #b37631);
background-image: linear-gradient(to right, #421039, #b37631);
-webkit-animation: spinBall 1s linear infinite;
animation: spinBall 1s linear infinite;
}
}
.color {
color: @---thime-color !important;
}
}
}
}

@-webkit-keyframes spinBall {
from { /*动画起始状态*/
-webkit-transform: rotate(0deg);
}
to { /*动画结束状态*/
-webkit-transform: rotate(360deg);
}
}

效果请参考 华软实业 网站