snow-flow 3.4.36 → 3.4.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +412 -287
- package/dist/cli/deploy-artifact.js +2 -2
- package/dist/mcp/servicenow-deployment-mcp.js +1 -1
- package/dist/mcp/servicenow-mcp-server.js +2 -2
- package/dist/queen/agent-factory.js +134 -52
- package/dist/queen/servicenow-queen.d.ts +127 -2
- package/dist/queen/servicenow-queen.js +978 -618
- package/dist/services/widget-deployment-service.d.ts +1 -1
- package/dist/services/widget-deployment-service.js +1 -1
- package/dist/templates/claude-md-template.d.ts +1 -1
- package/dist/templates/claude-md-template.js +2 -2
- package/dist/types/servicenow.types.d.ts +1 -1
- package/dist/utils/dependency-detector.d.ts +1 -1
- package/dist/utils/dependency-detector.js +1 -1
- package/dist/utils/servicenow-client.d.ts +1 -1
- package/dist/utils/servicenow-client.js +4 -8
- package/package.json +1 -1
- package/website/components/README.md +419 -0
- package/website/components/code-display/CodeDisplay.css +583 -0
- package/website/components/code-display/CodeDisplay.html +200 -0
- package/website/components/code-display/CodeDisplay.js +375 -0
- package/website/components/code-display/CodeDisplay.jsx +268 -0
- package/website/components/demo/ComponentLibraryDemo.html +845 -0
- package/website/components/feature-cards/FeatureCards.css +573 -0
- package/website/components/feature-cards/FeatureCards.html +247 -0
- package/website/components/feature-cards/FeatureCards.js +382 -0
- package/website/components/feature-cards/FeatureCards.jsx +235 -0
- package/website/components/hero/Hero.css +558 -0
- package/website/components/hero/Hero.html +98 -0
- package/website/components/hero/Hero.js +415 -0
- package/website/components/hero/Hero.jsx +214 -0
- package/website/components/interactive/InteractiveElements.css +776 -0
- package/website/components/interactive/InteractiveElements.html +283 -0
- package/website/components/interactive/InteractiveElements.js +489 -0
- package/website/components/interactive/InteractiveElements.jsx +444 -0
- package/website/components/layout/LayoutComponents.css +697 -0
- package/website/components/layout/LayoutComponents.html +374 -0
- package/website/components/layout/LayoutComponents.js +447 -0
- package/website/components/layout/LayoutComponents.jsx +379 -0
- package/website/components/navigation/Navigation.css +383 -0
- package/website/components/navigation/Navigation.html +89 -0
- package/website/components/navigation/Navigation.js +248 -0
- package/website/components/navigation/Navigation.jsx +124 -0
- package/website/css/animations.css +854 -0
- package/website/css/style.css +916 -948
- package/website/index.html +394 -424
- package/website/js/animations.js +707 -0
- package/website/js/main.js +310 -383
- package/website/mcp-servers.html +310 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/* Navigation Component - Black/White Minimalist Design */
|
|
2
|
+
|
|
3
|
+
.sf-nav {
|
|
4
|
+
position: fixed;
|
|
5
|
+
top: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
z-index: 1000;
|
|
9
|
+
background: rgba(255, 255, 255, 0.95);
|
|
10
|
+
backdrop-filter: blur(20px);
|
|
11
|
+
-webkit-backdrop-filter: blur(20px);
|
|
12
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
13
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.sf-nav--scrolled {
|
|
17
|
+
background: rgba(255, 255, 255, 0.98);
|
|
18
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.sf-nav__container {
|
|
22
|
+
max-width: 1200px;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
padding: 0 2rem;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
height: 70px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Brand */
|
|
32
|
+
.sf-nav__brand {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 0.75rem;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
text-decoration: none;
|
|
38
|
+
color: inherit;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.sf-nav__logo {
|
|
42
|
+
font-size: 1.75rem;
|
|
43
|
+
background: linear-gradient(135deg, #000000 0%, #333333 50%, #000000 100%);
|
|
44
|
+
background-size: 200% 200%;
|
|
45
|
+
-webkit-background-clip: text;
|
|
46
|
+
-webkit-text-fill-color: transparent;
|
|
47
|
+
background-clip: text;
|
|
48
|
+
animation: sf-gradient-shift 3s ease-in-out infinite;
|
|
49
|
+
transition: transform 0.3s ease;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.sf-nav__brand:hover .sf-nav__logo {
|
|
53
|
+
transform: scale(1.1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.sf-nav__brand-name {
|
|
57
|
+
font-size: 1.5rem;
|
|
58
|
+
font-weight: 700;
|
|
59
|
+
background: linear-gradient(135deg, #000000 0%, #666666 50%, #000000 100%);
|
|
60
|
+
background-size: 200% 200%;
|
|
61
|
+
-webkit-background-clip: text;
|
|
62
|
+
-webkit-text-fill-color: transparent;
|
|
63
|
+
background-clip: text;
|
|
64
|
+
animation: sf-gradient-shift 3s ease-in-out infinite reverse;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes sf-gradient-shift {
|
|
68
|
+
0%, 100% {
|
|
69
|
+
background-position: 0% 50%;
|
|
70
|
+
}
|
|
71
|
+
50% {
|
|
72
|
+
background-position: 100% 50%;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Navigation Menu */
|
|
77
|
+
.sf-nav__menu {
|
|
78
|
+
display: flex;
|
|
79
|
+
list-style: none;
|
|
80
|
+
margin: 0;
|
|
81
|
+
padding: 0;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: 2rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.sf-nav__item {
|
|
87
|
+
position: relative;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.sf-nav__link {
|
|
91
|
+
position: relative;
|
|
92
|
+
text-decoration: none;
|
|
93
|
+
color: #333333;
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
font-size: 0.95rem;
|
|
96
|
+
padding: 0.75rem 0;
|
|
97
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.sf-nav__link::before {
|
|
103
|
+
content: '';
|
|
104
|
+
position: absolute;
|
|
105
|
+
bottom: 0;
|
|
106
|
+
left: 0;
|
|
107
|
+
width: 0;
|
|
108
|
+
height: 2px;
|
|
109
|
+
background: linear-gradient(90deg, #000000, #666666);
|
|
110
|
+
transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.sf-nav__link:hover {
|
|
114
|
+
color: #000000;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.sf-nav__link:hover::before,
|
|
118
|
+
.sf-nav__link--active::before {
|
|
119
|
+
width: 100%;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.sf-nav__link--active {
|
|
123
|
+
color: #000000;
|
|
124
|
+
font-weight: 600;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.sf-nav__link-indicator {
|
|
128
|
+
position: absolute;
|
|
129
|
+
top: 50%;
|
|
130
|
+
right: -12px;
|
|
131
|
+
transform: translateY(-50%) scale(0);
|
|
132
|
+
width: 4px;
|
|
133
|
+
height: 4px;
|
|
134
|
+
background: #000000;
|
|
135
|
+
border-radius: 50%;
|
|
136
|
+
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.sf-nav__link--active .sf-nav__link-indicator {
|
|
140
|
+
transform: translateY(-50%) scale(1);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* CTA Button */
|
|
144
|
+
.sf-nav__cta {
|
|
145
|
+
background: linear-gradient(135deg, #000000 0%, #333333 100%);
|
|
146
|
+
color: white;
|
|
147
|
+
padding: 0.75rem 1.5rem;
|
|
148
|
+
border-radius: 50px;
|
|
149
|
+
text-decoration: none;
|
|
150
|
+
font-weight: 600;
|
|
151
|
+
font-size: 0.9rem;
|
|
152
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
153
|
+
position: relative;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.sf-nav__cta::before {
|
|
158
|
+
content: '';
|
|
159
|
+
position: absolute;
|
|
160
|
+
top: 0;
|
|
161
|
+
left: -100%;
|
|
162
|
+
width: 100%;
|
|
163
|
+
height: 100%;
|
|
164
|
+
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
|
|
165
|
+
transition: left 0.5s ease;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.sf-nav__cta:hover {
|
|
169
|
+
transform: translateY(-2px);
|
|
170
|
+
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.sf-nav__cta:hover::before {
|
|
174
|
+
left: 100%;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.sf-nav__cta:active {
|
|
178
|
+
transform: translateY(0);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* Mobile Hamburger */
|
|
182
|
+
.sf-nav__hamburger {
|
|
183
|
+
display: none;
|
|
184
|
+
flex-direction: column;
|
|
185
|
+
background: none;
|
|
186
|
+
border: none;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
padding: 0.5rem;
|
|
189
|
+
width: 30px;
|
|
190
|
+
height: 24px;
|
|
191
|
+
position: relative;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.sf-nav__hamburger span {
|
|
195
|
+
width: 100%;
|
|
196
|
+
height: 2px;
|
|
197
|
+
background: #333333;
|
|
198
|
+
border-radius: 2px;
|
|
199
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
200
|
+
transform-origin: center;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.sf-nav__hamburger span:nth-child(1) {
|
|
204
|
+
position: absolute;
|
|
205
|
+
top: 6px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.sf-nav__hamburger span:nth-child(2) {
|
|
209
|
+
position: absolute;
|
|
210
|
+
top: 50%;
|
|
211
|
+
transform: translateY(-50%);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.sf-nav__hamburger span:nth-child(3) {
|
|
215
|
+
position: absolute;
|
|
216
|
+
bottom: 6px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Hamburger Animation */
|
|
220
|
+
.sf-nav__hamburger--open span:nth-child(1) {
|
|
221
|
+
transform: rotate(45deg) translate(5px, 5px);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.sf-nav__hamburger--open span:nth-child(2) {
|
|
225
|
+
opacity: 0;
|
|
226
|
+
transform: translateY(-50%) scale(0);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.sf-nav__hamburger--open span:nth-child(3) {
|
|
230
|
+
transform: rotate(-45deg) translate(7px, -6px);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* Progress Indicator */
|
|
234
|
+
.sf-nav__progress {
|
|
235
|
+
position: absolute;
|
|
236
|
+
bottom: 0;
|
|
237
|
+
left: 0;
|
|
238
|
+
right: 0;
|
|
239
|
+
height: 3px;
|
|
240
|
+
background: rgba(0, 0, 0, 0.1);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.sf-nav__progress-bar {
|
|
244
|
+
height: 100%;
|
|
245
|
+
background: linear-gradient(90deg, #000000, #666666, #000000);
|
|
246
|
+
background-size: 200% 100%;
|
|
247
|
+
animation: sf-progress-flow 2s linear infinite;
|
|
248
|
+
transition: width 0.1s ease-out;
|
|
249
|
+
border-radius: 0 3px 3px 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@keyframes sf-progress-flow {
|
|
253
|
+
0% {
|
|
254
|
+
background-position: 200% 0;
|
|
255
|
+
}
|
|
256
|
+
100% {
|
|
257
|
+
background-position: -200% 0;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* Mobile Styles */
|
|
262
|
+
@media (max-width: 768px) {
|
|
263
|
+
.sf-nav__container {
|
|
264
|
+
padding: 0 1rem;
|
|
265
|
+
height: 60px;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.sf-nav__hamburger {
|
|
269
|
+
display: flex;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.sf-nav__menu {
|
|
273
|
+
position: fixed;
|
|
274
|
+
top: 60px;
|
|
275
|
+
left: 0;
|
|
276
|
+
right: 0;
|
|
277
|
+
background: rgba(255, 255, 255, 0.98);
|
|
278
|
+
backdrop-filter: blur(20px);
|
|
279
|
+
-webkit-backdrop-filter: blur(20px);
|
|
280
|
+
flex-direction: column;
|
|
281
|
+
padding: 2rem 0;
|
|
282
|
+
gap: 0;
|
|
283
|
+
transform: translateX(-100%);
|
|
284
|
+
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
285
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
286
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.sf-nav__menu--open {
|
|
290
|
+
transform: translateX(0);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.sf-nav__item {
|
|
294
|
+
width: 100%;
|
|
295
|
+
text-align: center;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.sf-nav__link {
|
|
299
|
+
padding: 1rem;
|
|
300
|
+
justify-content: center;
|
|
301
|
+
font-size: 1.1rem;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.sf-nav__link::before {
|
|
305
|
+
bottom: 0.5rem;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.sf-nav__link-indicator {
|
|
309
|
+
display: none;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.sf-nav__cta {
|
|
313
|
+
margin-top: 1rem;
|
|
314
|
+
display: inline-block;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.sf-nav__brand {
|
|
318
|
+
gap: 0.5rem;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.sf-nav__logo {
|
|
322
|
+
font-size: 1.5rem;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.sf-nav__brand-name {
|
|
326
|
+
font-size: 1.25rem;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/* Touch Device Optimizations */
|
|
331
|
+
@media (hover: none) {
|
|
332
|
+
.sf-nav__link:hover::before {
|
|
333
|
+
width: 0;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.sf-nav__link--active::before {
|
|
337
|
+
width: 100%;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.sf-nav__cta:hover {
|
|
341
|
+
transform: none;
|
|
342
|
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* Reduced Motion */
|
|
347
|
+
@media (prefers-reduced-motion: reduce) {
|
|
348
|
+
.sf-nav,
|
|
349
|
+
.sf-nav__logo,
|
|
350
|
+
.sf-nav__brand-name,
|
|
351
|
+
.sf-nav__link,
|
|
352
|
+
.sf-nav__link::before,
|
|
353
|
+
.sf-nav__link-indicator,
|
|
354
|
+
.sf-nav__cta,
|
|
355
|
+
.sf-nav__hamburger span,
|
|
356
|
+
.sf-nav__menu,
|
|
357
|
+
.sf-nav__progress-bar {
|
|
358
|
+
animation: none;
|
|
359
|
+
transition: none;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/* High Contrast Mode */
|
|
364
|
+
@media (prefers-contrast: high) {
|
|
365
|
+
.sf-nav {
|
|
366
|
+
background: white;
|
|
367
|
+
border-bottom: 2px solid black;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.sf-nav__logo,
|
|
371
|
+
.sf-nav__brand-name {
|
|
372
|
+
-webkit-text-fill-color: black;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.sf-nav__link {
|
|
376
|
+
color: black;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.sf-nav__cta {
|
|
380
|
+
background: black;
|
|
381
|
+
color: white;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Snow-Flow Navigation Component</title>
|
|
7
|
+
<link rel="stylesheet" href="Navigation.css">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<!-- Navigation Component -->
|
|
11
|
+
<nav class="sf-nav" id="sf-navigation">
|
|
12
|
+
<div class="sf-nav__container">
|
|
13
|
+
<!-- Logo and Brand -->
|
|
14
|
+
<div class="sf-nav__brand" id="sf-nav-brand">
|
|
15
|
+
<span class="sf-nav__logo">⚡</span>
|
|
16
|
+
<span class="sf-nav__brand-name">Snow-Flow</span>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<!-- Desktop Navigation -->
|
|
20
|
+
<ul class="sf-nav__menu" id="sf-nav-menu">
|
|
21
|
+
<li class="sf-nav__item">
|
|
22
|
+
<a href="#home" class="sf-nav__link sf-nav__link--active" data-section="home">
|
|
23
|
+
Home
|
|
24
|
+
<span class="sf-nav__link-indicator"></span>
|
|
25
|
+
</a>
|
|
26
|
+
</li>
|
|
27
|
+
<li class="sf-nav__item">
|
|
28
|
+
<a href="#features" class="sf-nav__link" data-section="features">
|
|
29
|
+
Features
|
|
30
|
+
<span class="sf-nav__link-indicator"></span>
|
|
31
|
+
</a>
|
|
32
|
+
</li>
|
|
33
|
+
<li class="sf-nav__item">
|
|
34
|
+
<a href="#about" class="sf-nav__link" data-section="about">
|
|
35
|
+
About
|
|
36
|
+
<span class="sf-nav__link-indicator"></span>
|
|
37
|
+
</a>
|
|
38
|
+
</li>
|
|
39
|
+
<li class="sf-nav__item">
|
|
40
|
+
<a href="#contact" class="sf-nav__link" data-section="contact">
|
|
41
|
+
Contact
|
|
42
|
+
<span class="sf-nav__link-indicator"></span>
|
|
43
|
+
</a>
|
|
44
|
+
</li>
|
|
45
|
+
|
|
46
|
+
<!-- CTA Button -->
|
|
47
|
+
<li class="sf-nav__item">
|
|
48
|
+
<a href="#get-started" class="sf-nav__cta">Get Started</a>
|
|
49
|
+
</li>
|
|
50
|
+
</ul>
|
|
51
|
+
|
|
52
|
+
<!-- Mobile Hamburger -->
|
|
53
|
+
<button class="sf-nav__hamburger" id="sf-nav-hamburger" aria-label="Toggle navigation menu">
|
|
54
|
+
<span></span>
|
|
55
|
+
<span></span>
|
|
56
|
+
<span></span>
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<!-- Scroll Progress Indicator -->
|
|
61
|
+
<div class="sf-nav__progress">
|
|
62
|
+
<div class="sf-nav__progress-bar" id="sf-progress-bar"></div>
|
|
63
|
+
</div>
|
|
64
|
+
</nav>
|
|
65
|
+
|
|
66
|
+
<!-- Demo Sections -->
|
|
67
|
+
<section id="home" style="height: 100vh; background: linear-gradient(135deg, #f5f5f5, #e0e0e0); display: flex; align-items: center; justify-content: center;">
|
|
68
|
+
<h1>Home Section</h1>
|
|
69
|
+
</section>
|
|
70
|
+
|
|
71
|
+
<section id="features" style="height: 100vh; background: linear-gradient(135deg, #e0e0e0, #d0d0d0); display: flex; align-items: center; justify-content: center;">
|
|
72
|
+
<h1>Features Section</h1>
|
|
73
|
+
</section>
|
|
74
|
+
|
|
75
|
+
<section id="about" style="height: 100vh; background: linear-gradient(135deg, #d0d0d0, #c0c0c0); display: flex; align-items: center; justify-content: center;">
|
|
76
|
+
<h1>About Section</h1>
|
|
77
|
+
</section>
|
|
78
|
+
|
|
79
|
+
<section id="contact" style="height: 100vh; background: linear-gradient(135deg, #c0c0c0, #b0b0b0); display: flex; align-items: center; justify-content: center;">
|
|
80
|
+
<h1>Contact Section</h1>
|
|
81
|
+
</section>
|
|
82
|
+
|
|
83
|
+
<section id="get-started" style="height: 100vh; background: linear-gradient(135deg, #b0b0b0, #a0a0a0); display: flex; align-items: center; justify-content: center;">
|
|
84
|
+
<h1>Get Started Section</h1>
|
|
85
|
+
</section>
|
|
86
|
+
|
|
87
|
+
<script src="Navigation.js"></script>
|
|
88
|
+
</body>
|
|
89
|
+
</html>
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
// Snow-Flow Navigation Component JavaScript
|
|
2
|
+
|
|
3
|
+
class SnowFlowNavigation {
|
|
4
|
+
constructor(options = {}) {
|
|
5
|
+
this.nav = document.getElementById(options.navId || 'sf-navigation');
|
|
6
|
+
this.menu = document.getElementById(options.menuId || 'sf-nav-menu');
|
|
7
|
+
this.hamburger = document.getElementById(options.hamburgerId || 'sf-nav-hamburger');
|
|
8
|
+
this.progressBar = document.getElementById(options.progressId || 'sf-progress-bar');
|
|
9
|
+
this.brand = document.getElementById(options.brandId || 'sf-nav-brand');
|
|
10
|
+
|
|
11
|
+
this.isOpen = false;
|
|
12
|
+
this.activeSection = 'home';
|
|
13
|
+
this.scrollThreshold = options.scrollThreshold || 50;
|
|
14
|
+
|
|
15
|
+
this.init();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
init() {
|
|
19
|
+
this.bindEvents();
|
|
20
|
+
this.updateActiveSection();
|
|
21
|
+
this.updateProgressBar();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
bindEvents() {
|
|
25
|
+
// Mobile menu toggle
|
|
26
|
+
if (this.hamburger) {
|
|
27
|
+
this.hamburger.addEventListener('click', () => this.toggleMobileMenu());
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Navigation link clicks
|
|
31
|
+
const navLinks = this.nav.querySelectorAll('.sf-nav__link');
|
|
32
|
+
navLinks.forEach(link => {
|
|
33
|
+
link.addEventListener('click', (e) => this.handleNavClick(e, link));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Brand click
|
|
37
|
+
if (this.brand) {
|
|
38
|
+
this.brand.addEventListener('click', (e) => this.handleNavClick(e, this.brand, '#home'));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Scroll events
|
|
42
|
+
window.addEventListener('scroll', () => {
|
|
43
|
+
this.handleScroll();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Resize events
|
|
47
|
+
window.addEventListener('resize', () => {
|
|
48
|
+
if (window.innerWidth > 768 && this.isOpen) {
|
|
49
|
+
this.closeMobileMenu();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Close mobile menu on outside click
|
|
54
|
+
document.addEventListener('click', (e) => {
|
|
55
|
+
if (this.isOpen && !this.nav.contains(e.target)) {
|
|
56
|
+
this.closeMobileMenu();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Handle escape key
|
|
61
|
+
document.addEventListener('keydown', (e) => {
|
|
62
|
+
if (e.key === 'Escape' && this.isOpen) {
|
|
63
|
+
this.closeMobileMenu();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
toggleMobileMenu() {
|
|
69
|
+
if (this.isOpen) {
|
|
70
|
+
this.closeMobileMenu();
|
|
71
|
+
} else {
|
|
72
|
+
this.openMobileMenu();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
openMobileMenu() {
|
|
77
|
+
this.isOpen = true;
|
|
78
|
+
this.menu.classList.add('sf-nav__menu--open');
|
|
79
|
+
this.hamburger.classList.add('sf-nav__hamburger--open');
|
|
80
|
+
this.hamburger.setAttribute('aria-expanded', 'true');
|
|
81
|
+
|
|
82
|
+
// Prevent body scroll
|
|
83
|
+
document.body.style.overflow = 'hidden';
|
|
84
|
+
|
|
85
|
+
// Focus management for accessibility
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
const firstLink = this.menu.querySelector('.sf-nav__link');
|
|
88
|
+
if (firstLink) firstLink.focus();
|
|
89
|
+
}, 300);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
closeMobileMenu() {
|
|
93
|
+
this.isOpen = false;
|
|
94
|
+
this.menu.classList.remove('sf-nav__menu--open');
|
|
95
|
+
this.hamburger.classList.remove('sf-nav__hamburger--open');
|
|
96
|
+
this.hamburger.setAttribute('aria-expanded', 'false');
|
|
97
|
+
|
|
98
|
+
// Restore body scroll
|
|
99
|
+
document.body.style.overflow = '';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
handleNavClick(e, element, customHref = null) {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
|
|
105
|
+
const href = customHref || element.getAttribute('href');
|
|
106
|
+
this.closeMobileMenu();
|
|
107
|
+
|
|
108
|
+
if (href && href.startsWith('#')) {
|
|
109
|
+
this.smoothScrollTo(href);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
smoothScrollTo(target) {
|
|
114
|
+
const element = document.querySelector(target);
|
|
115
|
+
if (element) {
|
|
116
|
+
const offset = 80; // Account for fixed navbar
|
|
117
|
+
const targetPosition = element.offsetTop - offset;
|
|
118
|
+
|
|
119
|
+
window.scrollTo({
|
|
120
|
+
top: targetPosition,
|
|
121
|
+
behavior: 'smooth'
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
handleScroll() {
|
|
127
|
+
const scrollTop = window.pageYOffset;
|
|
128
|
+
|
|
129
|
+
// Update navbar appearance on scroll
|
|
130
|
+
if (scrollTop > this.scrollThreshold) {
|
|
131
|
+
this.nav.classList.add('sf-nav--scrolled');
|
|
132
|
+
} else {
|
|
133
|
+
this.nav.classList.remove('sf-nav--scrolled');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Update active section
|
|
137
|
+
this.updateActiveSection();
|
|
138
|
+
|
|
139
|
+
// Update progress bar
|
|
140
|
+
this.updateProgressBar();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
updateActiveSection() {
|
|
144
|
+
const sections = document.querySelectorAll('section[id]');
|
|
145
|
+
const scrollTop = window.pageYOffset;
|
|
146
|
+
let current = 'home';
|
|
147
|
+
|
|
148
|
+
sections.forEach(section => {
|
|
149
|
+
const sectionTop = section.offsetTop;
|
|
150
|
+
const sectionHeight = section.offsetHeight;
|
|
151
|
+
|
|
152
|
+
if (scrollTop >= sectionTop - 100 && scrollTop < sectionTop + sectionHeight - 100) {
|
|
153
|
+
current = section.getAttribute('id');
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
if (current !== this.activeSection) {
|
|
158
|
+
this.activeSection = current;
|
|
159
|
+
this.updateActiveNavLink();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
updateActiveNavLink() {
|
|
164
|
+
const navLinks = this.nav.querySelectorAll('.sf-nav__link');
|
|
165
|
+
|
|
166
|
+
navLinks.forEach(link => {
|
|
167
|
+
const linkSection = link.getAttribute('data-section') ||
|
|
168
|
+
link.getAttribute('href')?.replace('#', '');
|
|
169
|
+
|
|
170
|
+
if (linkSection === this.activeSection) {
|
|
171
|
+
link.classList.add('sf-nav__link--active');
|
|
172
|
+
} else {
|
|
173
|
+
link.classList.remove('sf-nav__link--active');
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
updateProgressBar() {
|
|
179
|
+
if (!this.progressBar) return;
|
|
180
|
+
|
|
181
|
+
const scrollTop = window.pageYOffset;
|
|
182
|
+
const documentHeight = document.documentElement.scrollHeight;
|
|
183
|
+
const windowHeight = window.innerHeight;
|
|
184
|
+
const progress = Math.min(100, (scrollTop / (documentHeight - windowHeight)) * 100);
|
|
185
|
+
|
|
186
|
+
this.progressBar.style.width = `${progress}%`;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Public API methods
|
|
190
|
+
setActiveSection(sectionId) {
|
|
191
|
+
this.activeSection = sectionId;
|
|
192
|
+
this.updateActiveNavLink();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
scrollToSection(sectionId) {
|
|
196
|
+
this.smoothScrollTo(`#${sectionId}`);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
updateNavItems(newItems) {
|
|
200
|
+
// Method to dynamically update navigation items
|
|
201
|
+
const menuHTML = newItems.map((item, index) => `
|
|
202
|
+
<li class="sf-nav__item">
|
|
203
|
+
<a href="${item.href}" class="sf-nav__link" data-section="${item.href.replace('#', '')}">
|
|
204
|
+
${item.label}
|
|
205
|
+
<span class="sf-nav__link-indicator"></span>
|
|
206
|
+
</a>
|
|
207
|
+
</li>
|
|
208
|
+
`).join('');
|
|
209
|
+
|
|
210
|
+
// Add CTA button
|
|
211
|
+
const ctaHTML = `
|
|
212
|
+
<li class="sf-nav__item">
|
|
213
|
+
<a href="#get-started" class="sf-nav__cta">Get Started</a>
|
|
214
|
+
</li>
|
|
215
|
+
`;
|
|
216
|
+
|
|
217
|
+
this.menu.innerHTML = menuHTML + ctaHTML;
|
|
218
|
+
|
|
219
|
+
// Rebind events for new links
|
|
220
|
+
const navLinks = this.nav.querySelectorAll('.sf-nav__link');
|
|
221
|
+
navLinks.forEach(link => {
|
|
222
|
+
link.addEventListener('click', (e) => this.handleNavClick(e, link));
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
destroy() {
|
|
227
|
+
// Cleanup method
|
|
228
|
+
this.closeMobileMenu();
|
|
229
|
+
// Remove event listeners if needed
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Auto-initialize on DOM content loaded
|
|
234
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
235
|
+
// Check if navigation exists before initializing
|
|
236
|
+
const navElement = document.getElementById('sf-navigation');
|
|
237
|
+
if (navElement) {
|
|
238
|
+
window.snowFlowNav = new SnowFlowNavigation();
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// Export for module usage
|
|
243
|
+
if (typeof module !== 'undefined' && module.exports) {
|
|
244
|
+
module.exports = SnowFlowNavigation;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Global access
|
|
248
|
+
window.SnowFlowNavigation = SnowFlowNavigation;
|