summaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-01-04 12:01:04 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-01-04 12:01:04 +0800
commit8639cad0078cd5d36920bba13a2cdb775cd6588a (patch)
tree6292156f9b970f5501f2f4ecc5369a8870bc34e9 /src/js
parent0a268c4c73d8d8999bd044c2046e417484124e49 (diff)
add support for safari
Diffstat (limited to 'src/js')
-rw-r--r--src/js/mouseblob.js45
1 files changed, 39 insertions, 6 deletions
diff --git a/src/js/mouseblob.js b/src/js/mouseblob.js
index 71fdd631..4b30a80a 100644
--- a/src/js/mouseblob.js
+++ b/src/js/mouseblob.js
@@ -9,10 +9,43 @@
// }, { duration: 1000, fill: "forwards" });
// }
-window.onpointermove = event => {
- const { pageX, pageY } = event;
- blob.animate({
- left: `${pageX}px`,
- top: `${pageY}px`
- }, { duration: 1000, fill: "forwards" });
+// window.onpointermove = event => {
+// const { pageX, pageY } = event;
+// blob.animate({
+// left: `${pageX}px`,
+// top: `${pageY}px`
+// }, { duration: 1000, fill: "forwards" });
+// }
+
+// window.onpointermove = event => {
+// var x = event.pageX;
+// var y = event.pageY;
+
+// // We can then use these coordinates to position the blob
+// blob.style.left = x + 'px';
+// blob.style.top = y + 'px';
+// }
+
+
+window.onpointermove = event => {
+ // The event object gives us the x and y coordinates of the mouse pointer
+ var x = event.pageX;
+ var y = event.pageY;
+
+ blob.animate({
+ left: `${x}px`,
+ top: `${y}px`
+ }, { duration: 1000, fill: "forwards" });
+
+ // We can then use these coordinates to position the blob
+ blob.style.left = x + 'px';
+ blob.style.top = y + 'px';
}
+
+// window.onpointermove = event => {
+// const { pageX, pageY } = event;
+// blob.animate({
+// left: `${pageX}px`,
+// top: `${pageY}px`
+// }, { duration: 1000, fill: "forwards" });
+// }