File tree Expand file tree Collapse file tree 2 files changed +35
-30
lines changed
Expand file tree Collapse file tree 2 files changed +35
-30
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,41 @@ const fullImageUrl = image.startsWith('http') ? image : `${siteUrl}${image}`;
7676 }
7777 });
7878 </script >
79+
80+ <script >
81+ import { gsap } from 'gsap';
82+
83+ // Custom cursor
84+ const cursorDot = document.querySelector('.cursor-dot');
85+ const cursorOutline = document.querySelector('.cursor-outline');
86+
87+ if (cursorDot && cursorOutline && window.matchMedia('(hover: hover)').matches) {
88+ window.addEventListener('mousemove', (e) => {
89+ gsap.to(cursorDot, {
90+ x: e.clientX,
91+ y: e.clientY,
92+ duration: 0.1,
93+ });
94+ gsap.to(cursorOutline, {
95+ x: e.clientX,
96+ y: e.clientY,
97+ duration: 0.3,
98+ });
99+ });
100+
101+ // Expand cursor on interactive elements
102+ document.querySelectorAll('a, button, [data-cursor]').forEach((el) => {
103+ el.addEventListener('mouseenter', () => {
104+ gsap.to(cursorOutline, { scale: 2, opacity: 1, duration: 0.3 });
105+ gsap.to(cursorDot, { scale: 0.5, duration: 0.3 });
106+ });
107+ el.addEventListener('mouseleave', () => {
108+ gsap.to(cursorOutline, { scale: 1, opacity: 0.5, duration: 0.3 });
109+ gsap.to(cursorDot, { scale: 1, duration: 0.3 });
110+ });
111+ });
112+ }
113+ </script >
79114 </body >
80115</html >
81116
Original file line number Diff line number Diff line change @@ -384,34 +384,4 @@ const supportLinks = [
384384 });
385385 });
386386
387- // Custom cursor
388- const cursorDot = document.querySelector('.cursor-dot');
389- const cursorOutline = document.querySelector('.cursor-outline');
390-
391- if (cursorDot && cursorOutline && window.matchMedia('(hover: hover)').matches) {
392- window.addEventListener('mousemove', (e) => {
393- gsap.to(cursorDot, {
394- x: e.clientX,
395- y: e.clientY,
396- duration: 0.1,
397- });
398- gsap.to(cursorOutline, {
399- x: e.clientX,
400- y: e.clientY,
401- duration: 0.3,
402- });
403- });
404-
405- // Expand cursor on interactive elements
406- document.querySelectorAll('a, button, [data-cursor]').forEach((el) => {
407- el.addEventListener('mouseenter', () => {
408- gsap.to(cursorOutline, { scale: 2, opacity: 1, duration: 0.3 });
409- gsap.to(cursorDot, { scale: 0.5, duration: 0.3 });
410- });
411- el.addEventListener('mouseleave', () => {
412- gsap.to(cursorOutline, { scale: 1, opacity: 0.5, duration: 0.3 });
413- gsap.to(cursorDot, { scale: 1, duration: 0.3 });
414- });
415- });
416- }
417387</script >
You can’t perform that action at this time.
0 commit comments