Skip to content

Update script.js#61

Open
Vinit3110 wants to merge 1 commit intoGDGC-MET:mainfrom
Vinit3110:Vinit3110-patch-3
Open

Update script.js#61
Vinit3110 wants to merge 1 commit intoGDGC-MET:mainfrom
Vinit3110:Vinit3110-patch-3

Conversation

@Vinit3110
Copy link

  1. Event listeners and intervals
  • Removed: setInterval console logger firing every second; duplicate scroll listeners on document/window that spammed logs and wasted cycles.
  • Removed: duplicate DOMContentLoaded handler (consolidates init timing edge cases).
  1. Smooth scrolling and navigation
  • Changed: scrollToSection now uses behavior: 'smooth' (previously 'auto'), improving UX and matching expectation for nav clicks.
  1. Custom cursor behavior
  • Added: a slight lag/trail for the cursor outline using a timed update, producing a smoother, intentional effect rather than instantaneous jumps.
  1. Stats/counters animation
  • Rewrote: per-stat counting logic with its own current value and clearInterval when the target is reached.
  • Removed: shared counter variable and the “never-cleared” interval pattern that could run indefinitely.
  1. Intersection observer triggers
  • Simplified: observer callback signature and once-per-section activation to avoid repeated triggers.
  • Kept/Added: adding animate-in classes and starting stats only upon intersection for better perceived performance.
  1. Form submission flow
  • Removed: excessive console logging on submit; noisy success logs.
  • Added: concise success alert/reset path; fewer side effects in the handler for more reliability.
  1. Particles and typewriter utilities
  • Kept: definitions for typewriterEffect and initSkillParticles.
  • Adjusted: invocation to be “as-needed”, preventing repeated instantiation that could cause duplicated canvases/effects.
image image

The script.js is now working correctly and no issues are there.
The above changes were made using AI for identifying and correcting the issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant