balls gaming

This commit is contained in:
amy 2024-06-25 17:46:16 +03:30
parent 237d7487ab
commit a57684306a

View file

@ -1,16 +1,17 @@
import { createSignal, onCleanup } from "solid-js";
// import { createSignal, onCleanup } from "solid-js";
import { onCleanup } from "solid-js";
import { removethething } from "./utils.ts";
function HoverComponent() {
let timerId: number|null;
const [name, setname] = createSignal(true)
// const [name, setname] = createSignal(true)
const startTimer = () => {
timerId = setTimeout(() => {
setname(!name())
}, 3000);
};
// const startTimer = () => {
// timerId = setTimeout(() => {
// setname(!name())
// }, 3000);
// };
const clearTimer = () => {
if (timerId) {
@ -19,9 +20,9 @@ function HoverComponent() {
}
};
const handleMouseEnter = () => {
startTimer();
};
// const handleMouseEnter = () => {
// startTimer();
// };
onCleanup(() => {
clearTimer();
@ -34,7 +35,7 @@ function HoverComponent() {
onMouseEnter={removethething}
// onMouseLeave={clearTimer}
>
{name() ? "ECHO" : "exhq"}
{/* {name() ? "ECHO" : "exhq"} */}
</h1>
);
}