-
Notifications
You must be signed in to change notification settings - Fork 0
/
MOUSE-CRSR.html
118 lines (107 loc) · 2.86 KB
/
MOUSE-CRSR.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
margin: 0;
padding: 0;
text-decoration: none;
font-family: Monospace;
}
main{
position: relative;
}
body {
overflow: hidden;
background-color: black;
}
ul {
font-size: 1.5rem;
display: flex;
justify-content: space-around;
align-items: center;
list-style: none;
padding: 1rem;
}
li {
color: white;
}
#tital {
text-align: center;
border-bottom: 2px solid white;
border-top: 2px solid white;
margin: 1rem;
color: white;
}
</style>
<title>DOM Projects</title>
<style>
.card {
width: 100%;
height: 100%;
color: white;
display: flex;
justify-content: center;
}
.card h1 {
margin-block: 1.8em;
font-size: 18vh;
font-weight: 600;
font-family:Verdana, Geneva, Tahoma, sans-serif;
cursor: pointer;
}
.follower{
width: 5rem;
height: 5rem;
background: wheat;
mix-blend-mode: difference;
border-radius: 50%;
position: absolute;
transform: translate(-50%,-50%) ;
transition: all linear 0.3s ;
}
</style>
</head>
<body>
<main>
<nav>
<ul>
<a href="index.html">
<li>FB-FEATURE</li>
</a>
<a href="INSTA-HEART.html">
<li>INSTA-HEART</li>
</a>
<a href="MOUSE-CRSR.html">
<li>MOUSE-CRSR</li>
</a>
<a href="M-IMG-Hover.html">
<li>M-IMG-Hover</li>
</a>
<a href="INSTA_STORY.html">
<li>INSTA_STORY</li>
</a>
</ul>
</nav>
<h1 id="tital">MOUSE FOLOWER</h1>
<div class="card">
<h1>ZISHAN AKHTAR</h1>
<div class="follower"></div>
</div>
</main>
<script>
//when i hover in card div i want to follower-div to follow mouse.
function mouseFollower() {
let main = document.querySelector('.card');
let follower = document.querySelector('.follower');
main.addEventListener('mousemove',function (dets) {
follower.style.top = dets.y+"px";
follower.style.left = dets.x+"px";
});
};
mouseFollower();
</script>
</body>
</html>