hooyantsing's Blog

P165_14_图集效果案例

字数统计: 431阅读时长: 2 min
2020/04/22

P165 14 图集效果案例

filter

滤镜

blur

高斯模糊的效果。

e785fe9d68886475aa4cd629f5310c86.png

1
fliter: blur(25px);

实战案例

acf26f5157646f04f917b49df24da3a7.png

源码:

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
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }

        body {
            height: 100vh;
            width: 100vw;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #2c3e50;
        }

        main {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        div {
            width: 200px;
            height: 200px;
            margin-right: 20px;
            overflow: hidden;
            border: solid 2px #95a5a6;
            transition: 1s;
        }

        div > img {
            height: 100%;
        }

        main:hover div {
            filter: blur(15px);
            transform: scale(.6);
        }

        main:hover div:hover {
            filter: none;
            transform: scale(1.6);
        }
    </style>
</head>
<body>
<main>
    <div><img src="1.jpg" alt=""></div>
    <div><img src="2.jpg" alt=""></div>
    <div><img src="3.jpg" alt=""></div>
</main>
</body>
</html>

实战案例

介绍:常规,鼠标移动到图片上时,图片略微放大。

效果:

177cdc9d27cd49bbb538266363c6de25.png

源码:

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
55
56
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }

        body {
            height: 100vh;
            width: 100vw;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #2c3e50;
        }

        main {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        div {
            width: 200px;
            height: 200px;
            margin-right: 20px;
            overflow: hidden;
            border: solid 2px #95a5a6;
            transition: 1s;
        }

        div > img {
            height: 100%;
            filter: blur(1px);
            transition: 1s;
        }

        div>img:hover{
            filter: none;
            transform: scale(1.1);
        }
    </style>
</head>
<body>
<main>
    <div><img src="1.jpg" alt=""></div>
    <div><img src="2.jpg" alt=""></div>
    <div><img src="3.jpg" alt=""></div>
</main>
</body>
</html>
CATALOG