typescript more like gayscript

This commit is contained in:
amy 2024-06-23 22:11:02 +03:30
parent 9cdcae11d2
commit a8bf4b8a5a
19 changed files with 246 additions and 114 deletions

42
src/components/name.tsx Normal file
View file

@ -0,0 +1,42 @@
import { createSignal, onCleanup } from "solid-js";
import { removethething } from "./utils.ts";
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 = () => {
removethething()
startTimer();
};
onCleanup(() => {
clearTimer();
});
return (
<h1
class="removethisinstantly"
onMouseEnter={handleMouseEnter}
onMouseLeave={clearTimer}
>
{name() ? "ECHO" : "exhq"}
</h1>
);
}
export default HoverComponent;