Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cursor Animation/Script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var cursor = document.getElementById("Cursor");

document.onmousemove = function(e){
cursor.style.left = (e.pageX-23)+"px";
cursor.style.top = (e.pageY-23)+"px";
cursor.style.background = "darkslateblue";
cursor.style.display = "block";
}
document.onclick = function(e){
cursor.style.background = "white";
}
Binary file added Cursor Animation/back.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions Cursor Animation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cursor Animation</title>
</head>

<body>
<div class="cursor" id="Cursor"></div>
</body>
<style>
* {
margin: 0;
padding: 0;
}

body {
background: url(back.jpg);
background-size: cover;
cursor:grab;
}

.cursor {
width: 40px;
height: 40px;
border-radius: 100%;
position: absolute;
transition: 0.05s all ease;
background-color: darkslateblue;
}
</style>
<script src="Script.js">
</script>

</html>