@@ -8,6 +8,12 @@ document.addEventListener("DOMContentLoaded", function () {
8
8
} ) ;
9
9
}
10
10
11
+ function scrollToHowItWorks ( ) {
12
+ document . getElementById ( "how-it-works" ) . scrollIntoView ( {
13
+ behavior : "smooth" ,
14
+ } ) ;
15
+ }
16
+
11
17
// Add scroll effect to navigation
12
18
window . addEventListener ( "scroll" , function ( ) {
13
19
const nav = document . querySelector ( ".landing-nav" ) ;
@@ -69,6 +75,20 @@ document.addEventListener("DOMContentLoaded", function () {
69
75
}
70
76
} ) ;
71
77
} ) ;
78
+
79
+ // Add event listeners for anchor links to prevent default and smooth scroll
80
+ document . querySelectorAll ( 'a[href="#features"]' ) . forEach ( ( el ) => {
81
+ el . addEventListener ( "click" , ( e ) => {
82
+ e . preventDefault ( ) ;
83
+ scrollToFeatures ( ) ;
84
+ } ) ;
85
+ } ) ;
86
+ document . querySelectorAll ( 'a[href="#how-it-works"]' ) . forEach ( ( el ) => {
87
+ el . addEventListener ( "click" , ( e ) => {
88
+ e . preventDefault ( ) ;
89
+ scrollToHowItWorks ( ) ;
90
+ } ) ;
91
+ } ) ;
72
92
} ) ;
73
93
// Animated counters for stats
74
94
function animateCounter ( el ) {
@@ -123,9 +143,15 @@ function validateEmail(email) {
123
143
return re . test ( email ) ;
124
144
}
125
145
126
- // Add to global scope for inline onclick handlers
127
- window . scrollToFeatures = function ( ) {
128
- document . getElementById ( "features" ) . scrollIntoView ( {
129
- behavior : "smooth" ,
130
- } ) ;
131
- } ;
146
+ // Add to global scope for inline onclick handlers
147
+ window . scrollToFeatures = function ( ) {
148
+ document . getElementById ( "features" ) . scrollIntoView ( {
149
+ behavior : "smooth" ,
150
+ } ) ;
151
+ } ;
152
+
153
+ window . scrollToHowItWorks = function ( ) {
154
+ document . getElementById ( "how-it-works" ) . scrollIntoView ( {
155
+ behavior : "smooth" ,
156
+ } ) ;
157
+ } ;
0 commit comments