Skip to content

Commit 271ebd6

Browse files
committed
fix: 마우스 커서 위치 수정
1 parent 875c3f1 commit 271ebd6

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

src/app/components/mouseTrail/CustomCursor.tsx

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function CustomCursor() {
1212

1313
useEffect(() => {
1414
const updatePosition = (e: MouseEvent) => {
15-
setPosition({ x: e.clientX, y: e.clientY });
15+
setPosition({ x: e.clientX + window.scrollX, y: e.clientY + window.scrollY });
1616
};
1717

1818
window.addEventListener("mousemove", updatePosition);
@@ -30,7 +30,6 @@ export default function CustomCursor() {
3030
top: position.y,
3131
zIndex: 9999,
3232
pointerEvents: "none",
33-
transform: "translate(-50%, -50%)",
3433
}}
3534
>
3635
<TreeSVG />
@@ -41,30 +40,26 @@ export default function CustomCursor() {
4140
function TreeSVG() {
4241
return (
4342
<svg
43+
version="1.0"
4444
xmlns="http://www.w3.org/2000/svg"
45-
viewBox="0,0,255.98959,255.98959"
46-
width="32px"
47-
height="32px"
48-
fillRule="nonzero"
45+
width="20.000000pt"
46+
height="20.000000pt"
47+
viewBox="0 0 96.000000 96.000000"
48+
preserveAspectRatio="xMidYMid meet"
4949
>
50-
<g
51-
fill="rgba(34, 197, 94, 1)"
52-
fillRule="nonzero"
53-
stroke="none"
54-
strokeWidth="1"
55-
strokeLinecap="butt"
56-
strokeLinejoin="miter"
57-
strokeMiterlimit="10"
58-
strokeDasharray=""
59-
strokeDashoffset="0"
60-
fontFamily="none"
61-
fontWeight="none"
62-
fontSize="none"
63-
textAnchor="none"
64-
>
65-
<g transform="translate(-48.38052,89.01673) rotate(-34) scale(16,16)">
66-
<path d="M7.5,0.62891l-4.46094,6.37109h1.80469l-2.82812,5h4.98438v2h1v-2h5l-0.44141,-0.75391l-2.49609,-4.24609h1.89844zM7.5,2.375l2.53906,3.625h-1.72656l2.9375,5h-7.51562l2.82031,-5h-1.59375z"></path>
67-
</g>
50+
<g transform="translate(0.000000,96.000000) scale(0.100000,-0.100000)" fill="rgba(34, 197, 94, 1)" stroke="none">
51+
<path
52+
d="M24 925 c-7 -18 0 -542 8 -550 3 -4 25 7 49 24 23 17 45 31 49 31 4
53+
0 11 -37 14 -82 12 -134 34 -320 40 -325 3 -3 66 38 140 91 75 53 142 99 150
54+
102 9 4 27 -14 53 -50 21 -30 41 -55 44 -56 4 0 18 9 33 21 l26 20 -42 60
55+
c-25 36 -38 62 -32 68 5 4 71 52 147 105 125 90 154 116 127 116 -10 0 -293
56+
125 -346 153 l-28 14 53 38 c29 21 49 41 44 45 -4 4 -89 36 -188 70 -99 34
57+
-215 75 -258 90 -57 20 -80 24 -83 15z m226 -145 c78 -27 144 -51 147 -54 2
58+
-2 -16 -19 -41 -36 -25 -18 -43 -36 -41 -40 2 -4 88 -44 190 -90 102 -46 185
59+
-86 185 -89 -1 -3 -101 -77 -223 -164 l-222 -157 -6 37 c-4 21 -9 63 -12 93
60+
-25 236 -31 280 -42 280 -6 0 -26 -11 -45 -25 -19 -14 -35 -25 -37 -25 -2 0
61+
-3 72 -3 160 0 88 2 160 4 160 1 0 67 -22 146 -50z"
62+
/>
6863
</g>
6964
</svg>
7065
);

src/app/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ input[type="checkbox"]:disabled {
314314

315315
/* 마우스 커스텀 */
316316
* {
317-
/* cursor: none !important; */
317+
cursor: none !important;
318318
}
319319

320320
html,

0 commit comments

Comments
 (0)