make multiprobe buttons show hover cursors

This commit is contained in:
Holly Stubbs 2024-10-02 19:26:26 +01:00
parent a2ce6c3515
commit 1c9fbe522c
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E

View file

@ -42,6 +42,12 @@ const SITE_DEFAULT_CURSOR = {
"heavenonline.xyz": "https://heavenonline.xyz/core/cursor/frame1.png"
};
const SITE_DEFAULT_HOVER_CURSOR = {
"localhost": "https://angusnicneven.com/cursor/rrw2.png",
"angusnicneven.com": "https://angusnicneven.com/cursor/rrw2.png",
"heavenonline.xyz": "https://heavenonline.xyz/core/cursor_hover/frame1.png"
};
console.log("[MP] MultiProbe init");
(function() {
@ -76,6 +82,15 @@ console.log("[MP] MultiProbe init");
if (cssCursor.includes("undefined")) {
cssCursor = "auto";
}
let hoverChangeElement = document.querySelector("a");
if (!hoverChangeElement) {
hoverChangeElement = document.querySelector(".probedata");
}
let cursorHoverImageI = window.getComputedStyle(hoverChangeElement).cursor;
let cssHoverCursor = `${cursorHoverImageI === "auto" || !cursorHoverImageI.includes("url") ? `url(${SITE_DEFAULT_HOVER_CURSOR[window.location.href.split("//")[1].split("/")[0].split(":")[0]]}) 11 11, auto` : cursorHoverImageI}`;
if (cssHoverCursor.includes("undefined")) {
cssHoverCursor = "auto";
}
console.log("[MP] Injecting custom styles...");
const styles = document.createElement("style");
styles.innerHTML = `
@ -322,6 +337,10 @@ mp_container {
font-family: Arial,sans-serif;
}
mp_container a {
cursor: ${cssHoverCursor};
}
mp_container ul {
/* base t00 ul style */
background: #d2738a!important;
@ -360,6 +379,7 @@ mp_button {
padding: 4px 8px;
margin: 2px;
text-align: center;
cursor: ${cssHoverCursor};
}
.out-of-the-way {