This commit is contained in:
Baptiste 2022-08-28 00:57:07 +02:00
parent 7f7975a279
commit 4ac9718ac0
3 changed files with 33 additions and 0 deletions

31
assets/fonts/cursor.php Normal file
View file

@ -0,0 +1,31 @@
<script type="text/javascript">
document.onmousemove = suitsouris;
function suitsouris(evenement)
{
if(navigator.appName=="Microsoft Internet Explorer")
{
var x = event.x+document.body.scrollLeft;
var y = event.y+document.body.scrollTop;
}
else
{
var x = evenement.pageX;
var y = evenement.pageY;
}
document.getElementById("image_suit_souris").style.left = (x+1/*+1-43*/)+'px';
document.getElementById("image_suit_souris").style.top = (y+1/*-17*/)+'px';
}
</script>
<style>
.cursor {
position: absolute;
display: block;
z-index: 5;
width: 75px;
transform: translateX(-22px) translateY(-106px);
pointer-events: none;
}
</style>
<img src="assets/img/cursor.png" alt="Image qui suit la souris" id="image_suit_souris" class="cursor" />

BIN
assets/img/cursor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -2,6 +2,8 @@
ob_start(); // Start reading html ob_start(); // Start reading html
include "assets/fonts/color.php"; include "assets/fonts/color.php";
include "assets/fonts/cursor.php";
?> ?>
<main> <main>