From 1796cb3f9422adb9f24f5cbdca0cd338cccc052f Mon Sep 17 00:00:00 2001 From: Jonathan <69540930+mirdukkkkk@users.noreply.github.com> Date: Tue, 20 Aug 2024 02:20:21 +1200 Subject: [PATCH] remove cursor --- src/components/Cursor/Cursor.module.css | 8 ---- src/components/Cursor/Cursor.tsx | 31 ------------ .../Windows/Palette/Palette/Palette.tsx | 3 -- src/pages/Home/index.tsx | 47 +++++++++---------- 4 files changed, 21 insertions(+), 68 deletions(-) delete mode 100644 src/components/Cursor/Cursor.module.css delete mode 100644 src/components/Cursor/Cursor.tsx diff --git a/src/components/Cursor/Cursor.module.css b/src/components/Cursor/Cursor.module.css deleted file mode 100644 index 7f9e7e5..0000000 --- a/src/components/Cursor/Cursor.module.css +++ /dev/null @@ -1,8 +0,0 @@ -.cursor { - position: fixed; - width: 10px; - height: 10px; - pointer-events: none; - transform: translate(-50%, -50%); - z-index: 9999; -} \ No newline at end of file diff --git a/src/components/Cursor/Cursor.tsx b/src/components/Cursor/Cursor.tsx deleted file mode 100644 index ed01ad8..0000000 --- a/src/components/Cursor/Cursor.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { useEffect, useState, useContext } from 'preact/hooks'; -import styles from './Cursor.module.css'; -import { CursorContext } from "../../managers/cursor"; - -export function Cursor() { - const cursor = useContext(CursorContext); - const [visible, setVisible] = useState(false); - const [position, setPosition] = useState({ x: 0, y: 0 }); - const updateCursor = function(e: MouseEvent) { - setPosition({ x: e.clientX, y: e.clientY }); - } - - useEffect(() => { - document.addEventListener('mouseover', (e) => { - updateCursor(e); - setVisible(true); - }); - document.addEventListener('mouseout', () => setVisible(false)); - document.addEventListener('mousemove', updateCursor); - }, []); - - return
; -} \ No newline at end of file diff --git a/src/components/Windows/Palette/Palette/Palette.tsx b/src/components/Windows/Palette/Palette/Palette.tsx index aad99b6..e696414 100644 --- a/src/components/Windows/Palette/Palette/Palette.tsx +++ b/src/components/Windows/Palette/Palette/Palette.tsx @@ -1,7 +1,6 @@ import { useContext } from "preact/hooks"; import { PaletteGroup } from "../PaletteGroup/PaletteGroup"; import { PaletteContext } from "../../../../managers/palette"; -import { CursorContext } from "../../../../managers/cursor"; import { ColorSelect } from "../ColorSelect/ColorSelect"; import { ColorCreate } from "../ColorCreate/ColorCreate"; import { ColorDelete } from "../ColorDelete/ColorDelete"; @@ -11,10 +10,8 @@ import styles from "./Palette.module.css"; export function Palette() { const palette = useContext(PaletteContext) - const cursor = useContext(CursorContext); palette.load() - cursor.setColor(palette.palette.value.selected) return (