Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Cursor Animation #807

Closed
Closed
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
71 changes: 71 additions & 0 deletions appointment.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,48 @@
padding: 8px;
}
}

.cursor{
z-index: 999;
background: rgb(11, 173, 198);
position: fixed;
width: 20px;
height: 20px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
pointer-events: none;
box-shadow: 0 0 20px rgb(11, 173, 198),
0 0 60px rgb(11, 173, 198),
0 0 100px rgb(11, 173, 198);

animation: colors 5s infinite;
transform: translate(-50%,-50%);


}

@keyframes colors {
0%{
filter: hue-rotate(0deg);
}

}

.cursor:before{
size: 100px;
content: '';
position: absolute;
background: rgb(11, 173, 198);
width: 50px;
height: 50px;
opacity: 0.2;
transform: translate(-30%,-30%);
border-radius: 50%;

}

</style>
</head>
<body>
Expand Down Expand Up @@ -172,6 +214,7 @@

<button type="submit">Make an Appointment</button>
</form>
<div class="cursor"></div>

<script>
document.getElementById('appointmentForm').addEventListener('submit', function(event) {
Expand All @@ -184,6 +227,34 @@
document.getElementById('appointmentForm').reset();
}, 500); // Simulate a delay for form submission
});
const cursor = document.querySelector(".cursor");

//follow cursor on mouse move
document.addEventListener("mousemove",(e)=>{
let x = e.pageX;
let y = e.pageY;

cursor.style.top = y + "px";
cursor.style.left =x + "px";
cursor.style.display ="block";

//cursor effects on mouse stopped
function mouseStopped(){
cursor.style.display="none";

}
clearTimeout(timeout);
timeout = setTimeout(mouseStopped,1000);


});

//cursor effect on mouseout

document.addEventListener("mouseout",()=>{
cursor.style.display="none";

});
</script>

</body>
Expand Down
73 changes: 73 additions & 0 deletions aptmnt.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,48 @@
padding: 8px;
}
}

.cursor{
z-index: 999;
background: rgb(11, 173, 198);
position: fixed;
width: 20px;
height: 20px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
pointer-events: none;
box-shadow: 0 0 20px rgb(11, 173, 198),
0 0 60px rgb(11, 173, 198),
0 0 100px rgb(11, 173, 198);

animation: colors 5s infinite;
transform: translate(-50%,-50%);


}

@keyframes colors {
0%{
filter: hue-rotate(0deg);
}

}

.cursor:before{
size: 100px;
content: '';
position: absolute;
background: rgb(11, 173, 198);
width: 50px;
height: 50px;
opacity: 0.2;
transform: translate(-30%,-30%);
border-radius: 50%;

}

</style>
</head>
<body>
Expand Down Expand Up @@ -173,6 +215,37 @@

<button type="submit">Make an Appointment</button>
</form>
<div class="cursor"></div>
<script>
const cursor = document.querySelector(".cursor");

//follow cursor on mouse move
document.addEventListener("mousemove",(e)=>{
let x = e.pageX;
let y = e.pageY;

cursor.style.top = y + "px";
cursor.style.left =x + "px";
cursor.style.display ="block";

//cursor effects on mouse stopped
function mouseStopped(){
cursor.style.display="none";

}
clearTimeout(timeout);
timeout = setTimeout(mouseStopped,1000);


});

//cursor effect on mouseout

document.addEventListener("mouseout",()=>{
cursor.style.display="none";

});
</script>

</body>
</html>
70 changes: 70 additions & 0 deletions dex.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,47 @@
background-color: #3fbcc0;
z-index: 9999;
}
.cursor{
z-index: 999;
background: rgb(11, 173, 198);
position: fixed;
width: 20px;
height: 20px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
pointer-events: none;
box-shadow: 0 0 20px rgb(11, 173, 198),
0 0 60px rgb(11, 173, 198),
0 0 100px rgb(11, 173, 198);

animation: colors 5s infinite;
transform: translate(-50%,-50%);


}

@keyframes colors {
0%{
filter: hue-rotate(0deg);
}

}

.cursor:before{
size: 100px;
content: '';
position: absolute;
background: rgb(11, 173, 198);
width: 50px;
height: 50px;
opacity: 0.2;
transform: translate(-30%,-30%);
border-radius: 50%;

}

</style>
</head>
<body>
Expand Down Expand Up @@ -236,13 +277,42 @@ <h3 class="footer__title">Follow us</h3>

<p class="footer__copy">&#169; Talo. All right reserved</p>
</footer>
<div class="cursor"></div>

<!--=============== SCROLL UP ===============-->
<a href="#" class="scrollup" id="scroll-up">
<i class='bx bx-up-arrow-alt scrollup__icon'></i>
</a>

<!--=============== MAIN JS ===============-->
<script>const cursor = document.querySelector(".cursor");

//follow cursor on mouse move
document.addEventListener("mousemove",(e)=>{
let x = e.pageX;
let y = e.pageY;

cursor.style.top = y + "px";
cursor.style.left =x + "px";
cursor.style.display ="block";

//cursor effects on mouse stopped
function mouseStopped(){
cursor.style.display="none";

}
clearTimeout(timeout);
timeout = setTimeout(mouseStopped,1000);


});

//cursor effect on mouseout

document.addEventListener("mouseout",()=>{
cursor.style.display="none";

});</script>
<script src="assets/js/main.js"></script>
</body>
</html>
71 changes: 71 additions & 0 deletions faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,48 @@
z-index: 9999;
}

.cursor{
z-index: 999;
background: rgb(11, 173, 198);
position: fixed;
width: 20px;
height: 20px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
pointer-events: none;
box-shadow: 0 0 20px rgb(11, 173, 198),
0 0 60px rgb(11, 173, 198),
0 0 100px rgb(11, 173, 198);

animation: colors 5s infinite;
transform: translate(-50%,-50%);


}

@keyframes colors {
0%{
filter: hue-rotate(0deg);
}

}

.cursor:before{
size: 100px;
content: '';
position: absolute;
background: rgb(11, 173, 198);
width: 50px;
height: 50px;
opacity: 0.2;
transform: translate(-30%,-30%);
border-radius: 50%;

}


</style>
<body>

Expand Down Expand Up @@ -341,6 +383,7 @@ <h4>RAPIDOC Newsletter</h4><br>
</svg>
</div>
</div>
<div class="cursor"></div>

<!-- footer -->

Expand Down Expand Up @@ -380,6 +423,34 @@ <h4>RAPIDOC Newsletter</h4><br>
}
}
});
const cursor = document.querySelector(".cursor");

//follow cursor on mouse move
document.addEventListener("mousemove",(e)=>{
let x = e.pageX;
let y = e.pageY;

cursor.style.top = y + "px";
cursor.style.left =x + "px";
cursor.style.display ="block";

//cursor effects on mouse stopped
function mouseStopped(){
cursor.style.display="none";

}
clearTimeout(timeout);
timeout = setTimeout(mouseStopped,1000);


});

//cursor effect on mouseout

document.addEventListener("mouseout",()=>{
cursor.style.display="none";

});
</script>
</body>
</html>
Loading