-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackdrop-fliter-blur.html
82 lines (71 loc) · 1.96 KB
/
backdrop-fliter-blur.html
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Backdrop-filter:blur</title>
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: 'Ribeye', cursive;
}
section {
position: relative;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: url(img/leaves-15757_1280.jpg) no-repeat fixed center;
background-size: cover;
overflow: hidden;
}
section h1 {
font-size: 4rem;
color: whitesmoke;
pointer-events: none;
text-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
section .glass {
position: absolute;
pointer-events: none;
transform: translate(-50%, -50%);
width: 300px;
height: 200px;
background: transparent;
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
-moz-backdrop-filter: blur(10px);
transition: 0.2s;
}
p {
text-align: center;
font-weight: bold;
font-size: 18px;
}
</style>
</head>
<body>
<section>
<h1>
Backdrop-Filter:Blur;
</h1>
<div class="glass">
</div>
</section>
<p>
Note: Backdrop-filter has issue with firefox. <br>
Works on Chrome and Edge.
</p>
<!-- JS Script -->
<script>
document.addEventListener("mousemove", function (e) {
const glass = document.querySelector('.glass');
glass.style.left = e.offsetX + 'px';
glass.style.top = e.offsetY + 'px';
})
</script>
</body>
</html>