File tree Expand file tree Collapse file tree 4 files changed +39
-0
lines changed
53. CSS Clip Path Animation Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ let pos = document . documentElement ;
2+
3+ pos . addEventListener ( "mousemove" , ( e ) => {
4+ pos . style . setProperty ( "--1" , e . clientX + "px" ) ;
5+ pos . style . setProperty ( "--2" , e . clientY + "px" ) ;
6+ } ) ;
Original file line number Diff line number Diff line change 1+ < html lang ="en ">
2+ < head >
3+ < meta charset ="UTF-8 " />
4+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6+ < title > CSS Clip Path Animation</ title >
7+ < link rel ="stylesheet " href ="style.css " />
8+ </ head >
9+ < body >
10+ < div class ="container "> </ div >
11+
12+ < script src ="app.js "> </ script >
13+ </ body >
14+ </ html >
Original file line number Diff line number Diff line change 1+ * {
2+ margin : 0 ;
3+ padding : 0 ;
4+ box-sizing : border-box;
5+ font-family : sans-serif;
6+ }
7+
8+ body {
9+ background : black;
10+ }
11+
12+ .container {
13+ position : relative;
14+ width : 100% ;
15+ height : 100vh ;
16+ background : url (jonatan-pie-3l3RwQdHRHg-unsplash.jpg) no-repeat center;
17+ background-size : cover;
18+ clip-path : circle (200px at var (--1 ) var (--2 ));
19+ }
You can’t perform that action at this time.
0 commit comments