From 4ab571290f64527bc321df8f1267376ad9b9043d Mon Sep 17 00:00:00 2001 From: salmonik Date: Sat, 7 Feb 2026 00:45:28 +0100 Subject: demake the site, and remove external components --- js/gradient.js | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 js/gradient.js (limited to 'js/gradient.js') diff --git a/js/gradient.js b/js/gradient.js deleted file mode 100644 index 28178f7..0000000 --- a/js/gradient.js +++ /dev/null @@ -1,53 +0,0 @@ -document.addEventListener('DOMContentLoaded', () => { - // Get the body element to update the cursor position - const body = document.documentElement; - let mouseX = 0; - let mouseY = 0; - let smoothX = 0; - let smoothY = 0; - - // Smoothing factor (lower = smoother, higher = snappier) - const smoothing = 0.1; - - // Handle mouse movement - const handleMouseMove = (e) => { - mouseY = e.clientY - mouseX = e.clientX - - }; - - // Smooth the cursor movement - const updateCursorLight = () => { - // Apply smoothing - smoothX += (mouseX - smoothX) * smoothing; - smoothY += (mouseY - smoothY) * smoothing; - - // Update CSS variables for the cursor position - body.style.setProperty('--cursor-x', `${smoothX}px`); - body.style.setProperty('--cursor-y', `${smoothY}px`); - - // Continue the animation loop - requestAnimationFrame(updateCursorLight); - }; - - // Add event listeners - window.addEventListener('mousemove', handleMouseMove); - - // Handle touch events for mobile - window.addEventListener('touchmove', (e) => { - const touch = e.touches[0]; - handleMouseMove({ - clientX: touch.clientX, - clientY: touch.clientY - }); - }, { passive: false }); - - // Initialize cursor position to center of screen - mouseX = window.innerWidth / 2; - mouseY = window.innerHeight / 2; - smoothX = mouseX; - smoothY = mouseY; - - // Start the animation loop - updateCursorLight(); -}); -- cgit v1.2.3