theballs
This commit is contained in:
parent
1f94464b3a
commit
7765c6af9f
5 changed files with 8 additions and 24 deletions
|
|
@ -2,31 +2,17 @@
|
|||
import { onCleanup } from "solid-js";
|
||||
import { removethething } from "./utils.tsx";
|
||||
|
||||
function getName(): string{
|
||||
return Math.random() < 0.2? "EHCO" : "ECHO"
|
||||
}
|
||||
|
||||
function HoverComponent() {
|
||||
let timerId: number|null;
|
||||
|
||||
// const [name, setname] = createSignal(true)
|
||||
|
||||
// const startTimer = () => {
|
||||
// timerId = setTimeout(() => {
|
||||
// setname(!name())
|
||||
// }, 3000);
|
||||
// };
|
||||
|
||||
const clearTimer = () => {
|
||||
if (timerId) {
|
||||
clearTimeout(timerId);
|
||||
timerId = null;
|
||||
}
|
||||
};
|
||||
|
||||
// const handleMouseEnter = () => {
|
||||
// startTimer();
|
||||
// };
|
||||
|
||||
|
||||
onCleanup(() => {
|
||||
clearTimer();
|
||||
|
|
@ -40,10 +26,9 @@ function HoverComponent() {
|
|||
if (e.target.textContent !== "ECHO") {
|
||||
e.target.textContent = "ECHO"
|
||||
}
|
||||
}}
|
||||
// onMouseLeave={clearTimer}
|
||||
}}
|
||||
>
|
||||
{getName()}
|
||||
Amy
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue