33< head >
44 < meta charset ="UTF-8 ">
55 < title > Mouse Shadow</ title >
6- < link rel ="icon " href ="https://fav.farm/✅ " />
6+ < link rel ="icon " href ="https://fav.farm/🔥 " />
77</ head >
88< body >
99
1010 < div class ="hero ">
11- < h1 contenteditable > 🔥WOAH! </ h1 >
11+ < h1 contenteditable > 🪷 Hey angela! 🪻 </ h1 >
1212 </ div >
1313
1414 < style >
1515 html {
1616 color : black;
17- font-family : sans-serif ;
17+ font-family : 'Courier New' , Courier , monospace ;
1818 }
1919
2020 body {
2121 margin : 0 ;
22+ background-color : rgb (35 , 35 , 93 );
2223 }
2324
2425 .hero {
2526 min-height : 100vh ;
2627 display : flex;
2728 justify-content : center;
2829 align-items : center;
29- color : black ;
30+ color : rgb ( 248 , 246 , 246 ) ;
3031 }
3132
3233 h1 {
@@ -38,27 +39,26 @@ <h1 contenteditable>🔥WOAH!</h1>
3839< script >
3940 const hero = document . querySelector ( '.hero' ) ;
4041 const text = hero . querySelector ( 'h1' ) ;
41- const walk = 500 ; // 500px
42+ const walk = 700 ; //700px
4243
4344 function shadow ( e ) {
4445 const { offsetWidth : width , offsetHeight : height } = hero ;
4546 let { offsetX : x , offsetY : y } = e ;
4647
47- if ( this !== e . target ) {
48+ if ( this !== e . target ) {
4849 x = x + e . target . offsetLeft ;
49- y = y + e . target . offsetTop ;
50+ y = y + e . target . offsetTop ;
5051 }
5152
52- const xWalk = Math . round ( ( x / width * walk ) - ( walk / 2 ) ) ;
53- const yWalk = Math . round ( ( y / height * walk ) - ( walk / 2 ) ) ;
53+ const xWalk = Math . round ( ( x / width * walk ) - ( walk / 2 ) ) ;
54+ const yWalk = Math . round ( ( y / height * walk ) - ( walk / 2 ) ) ;
5455
5556 text . style . textShadow = `
56- ${ xWalk } px ${ yWalk } px 0 rgba(255,0,255,0.7),
57- ${ xWalk * - 1 } px ${ yWalk } px 0 rgba(0,255,255,0.7),
58- ${ yWalk } px ${ xWalk * - 1 } px 0 rgba(0,255,0,0.7),
59- ${ yWalk * - 1 } px ${ xWalk } px 0 rgba(0,0,255,0.7)
60- ` ;
61-
57+ ${ xWalk } px ${ yWalk } px 0 rgb(190, 190, 226),
58+ ${ xWalk * - 1 } px ${ yWalk } px 0 rgb(126, 126, 179),
59+ ${ yWalk } px ${ xWalk * - 1 } px 0 rgb(72, 72, 236),
60+ ${ yWalk * - 1 } px ${ xWalk } px 0 rgb(186, 186, 211)
61+ ` ;
6262 }
6363
6464 hero . addEventListener ( 'mousemove' , shadow ) ;
0 commit comments