彩色阴影

html
<div class="color-shadow">
<img src="..." alt="" />
</div>1
2
3
2
3
scss
.color-shadow {
position: relative;
width: 200px;
height: 200px;
img {
width: 100%;
height: 100%;
border-radius: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
object-fit: cover;
}
&::after {
content: "";
position: absolute;
left: 0;
top: 10%;
width: 100%;
height: 100%;
border-radius: 100%;
background: url(...) no-repeat center/cover;
filter: blur(10px) brightness(80%) opacity(0.8);
transform: scale(0.95);
z-index: 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
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
详细代码
vue
<template>
<div class="container">
<div class="color-shadow">
<img src="/images/bg11.jpg" alt="" />
</div>
</div>
</template>
<style lang="scss" scoped>
.container {
padding: 30px 0;
display: flex;
justify-content: center;
align-items: center;
}
.color-shadow {
position: relative;
width: 200px;
height: 200px;
img {
width: 100%;
height: 100%;
border-radius: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
object-fit: cover;
}
&::after {
content: "";
position: absolute;
left: 0;
top: 10%;
width: 100%;
height: 100%;
border-radius: 100%;
background: url(/images/bg11.jpg) no-repeat center/cover;
filter: blur(10px) brightness(80%) opacity(0.8);
transform: scale(0.95);
z-index: 1;
}
}
</style>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
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