File tree Expand file tree Collapse file tree 1 file changed +82
-0
lines changed Expand file tree Collapse file tree 1 file changed +82
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+
4
+ < head >
5
+ < meta charset ="UTF-8 ">
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7
+ < title > Backdrop-filter:blur</ title >
8
+ < style >
9
+ * {
10
+ padding : 0 ;
11
+ margin : 0 ;
12
+ box-sizing : border-box;
13
+ font-family : 'Ribeye' , cursive;
14
+ }
15
+
16
+ section {
17
+ position : relative;
18
+ display : flex;
19
+ justify-content : center;
20
+ align-items : center;
21
+ min-height : 100vh ;
22
+ background : url (img/leaves-15757_1280.jpg) no-repeat fixed center;
23
+ background-size : cover;
24
+ overflow : hidden;
25
+ }
26
+
27
+ section h1 {
28
+ font-size : 4rem ;
29
+ color : whitesmoke;
30
+ pointer-events : none;
31
+ text-shadow : 0 10px 20px rgba (0 , 0 , 0 , 0.5 );
32
+ }
33
+
34
+ section .glass {
35
+ position : absolute;
36
+ pointer-events : none;
37
+ transform : translate (-50% , -50% );
38
+ width : 300px ;
39
+ height : 200px ;
40
+ background : transparent;
41
+ box-shadow : 0 25px 50px rgba (0 , 0 , 0 , 0.5 );
42
+ backdrop-filter : blur (10px );
43
+ -webkit-backdrop-filter : blur (10px );
44
+ -moz-backdrop-filter : blur (10px );
45
+ transition : 0.2s ;
46
+
47
+ }
48
+
49
+ p {
50
+ text-align : center;
51
+ font-weight : bold;
52
+ font-size : 18px ;
53
+ }
54
+ </ style >
55
+ </ head >
56
+
57
+ < body >
58
+ < section >
59
+ < h1 >
60
+ Backdrop-Filter:Blur;
61
+ </ h1 >
62
+ < div class ="glass ">
63
+
64
+ </ div >
65
+
66
+ </ section >
67
+ < p >
68
+ Note: Backdrop-filter has issue with firefox. < br >
69
+ Works on Chrome and Edge.
70
+ </ p >
71
+ <!-- JS Script -->
72
+ < script >
73
+ document . addEventListener ( "mousemove" , function ( e ) {
74
+ const glass = document . querySelector ( '.glass' ) ;
75
+ glass . style . left = e . offsetX + 'px' ;
76
+ glass . style . top = e . offsetY + 'px' ;
77
+
78
+ } )
79
+ </ script >
80
+ </ body >
81
+
82
+ </ html >
You can’t perform that action at this time.
0 commit comments