v2.exhq.dev/src/components/name.tsx
2024-09-25 01:02:17 +03:30

47 lines
No EOL
902 B
TypeScript

// import { createSignal, onCleanup } from "solid-js";
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();
});
return (
<h1
class="removethisinstantly"
// disabled because uhh uhmm
onMouseEnter={removethething}
// onMouseLeave={clearTimer}
>
{getName()}
</h1>
);
}
export default HoverComponent;