@ali-hajeh/purple-navbar 1.0.0

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.
@@ -0,0 +1,563 @@
1
+ /* ============================================
2
+ Purple Navbar - @ali-hajeh/purple-navbar
3
+ Self-contained styles with pn- prefix
4
+ ============================================ */
5
+
6
+ /* ==========================================
7
+ CSS Variables
8
+ ========================================== */
9
+ :root {
10
+ --pn-bg-primary: #0f0e11;
11
+ --pn-bg-secondary: #0f101f;
12
+ --pn-text-primary: #ffffff;
13
+ --pn-accent-purple: #7d6ff6;
14
+ --pn-accent-pink: #ae15f5;
15
+ --pn-accent-cyan: #58e1d9;
16
+ --pn-gradient-primary: linear-gradient(270deg, #58e1d9 -76.1%, #7d6ff6 154.41%);
17
+ --pn-gradient-button: linear-gradient(to right, #758bf0, #65bce3, #54a3c1, #6073cb);
18
+ --pn-gradient-border: linear-gradient(130deg, #7d6ff6 0% 40%, #ae15f5 70% 100%);
19
+ --pn-font-primary: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
20
+ --pn-font-secondary: "Russo One", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
21
+ --pn-font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
22
+ --pn-font-display: "Euclid Circular B", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
23
+ }
24
+
25
+ /* ==========================================
26
+ Animations
27
+ ========================================== */
28
+ @keyframes pn-rotate {
29
+ 0% {
30
+ transform: rotate(0deg);
31
+ }
32
+ 100% {
33
+ transform: rotate(180deg);
34
+ }
35
+ }
36
+
37
+ @keyframes pn-animate-border {
38
+ 0% {
39
+ background-position: 0% 50%;
40
+ }
41
+ 50% {
42
+ background-position: 100% 50%;
43
+ }
44
+ 100% {
45
+ background-position: 0% 50%;
46
+ }
47
+ }
48
+
49
+ @keyframes pn-fadein-fast {
50
+ from {
51
+ opacity: 0;
52
+ }
53
+ to {
54
+ opacity: 1;
55
+ }
56
+ }
57
+
58
+ @keyframes pn-drawer-slide-in {
59
+ from {
60
+ right: -234px;
61
+ }
62
+ to {
63
+ right: 0;
64
+ }
65
+ }
66
+
67
+ @keyframes pn-expand-border {
68
+ from {
69
+ width: 0;
70
+ }
71
+ to {
72
+ width: 100%;
73
+ }
74
+ }
75
+
76
+ /* ==========================================
77
+ Main Navbar Container
78
+ ========================================== */
79
+ .pn-navbar {
80
+ height: 100px;
81
+ width: 100%;
82
+ max-width: 1440px;
83
+ position: relative;
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ z-index: 4;
88
+ box-sizing: border-box;
89
+ }
90
+
91
+ .pn-navbar *,
92
+ .pn-navbar *::before,
93
+ .pn-navbar *::after {
94
+ box-sizing: border-box;
95
+ }
96
+
97
+ .pn-navbar__bottom-line {
98
+ height: 1px;
99
+ width: 100%;
100
+ background: linear-gradient(
101
+ 90deg,
102
+ hsla(0, 0%, 100%, 0.02) 0 15%,
103
+ hsla(0, 0%, 100%, 0.5) 45% 55%,
104
+ hsla(0, 0%, 100%, 0.02) 85% 100%
105
+ );
106
+ opacity: 0.5;
107
+ position: absolute;
108
+ bottom: 0;
109
+ }
110
+
111
+ .pn-navbar__content {
112
+ height: 70%;
113
+ width: 90%;
114
+ display: flex;
115
+ align-items: center;
116
+ justify-content: space-between;
117
+ }
118
+
119
+ /* ==========================================
120
+ Logo
121
+ ========================================== */
122
+ .pn-navbar__logo {
123
+ width: fit-content;
124
+ height: 55px;
125
+ user-select: none;
126
+ -webkit-user-drag: none;
127
+ cursor: pointer;
128
+ }
129
+
130
+ .pn-navbar__logo:hover .pn-navbar__logo-circle {
131
+ animation: pn-rotate 2s forwards;
132
+ transform-origin: 50% 50%;
133
+ transform-box: fill-box;
134
+ }
135
+
136
+ /* ==========================================
137
+ Items Container
138
+ ========================================== */
139
+ .pn-navbar__items {
140
+ height: 100%;
141
+ width: 70%;
142
+ display: flex;
143
+ align-items: center;
144
+ justify-content: flex-end;
145
+ }
146
+
147
+ .pn-navbar__slots {
148
+ display: flex;
149
+ align-items: center;
150
+ gap: 16px;
151
+ }
152
+
153
+ /* ==========================================
154
+ Links
155
+ ========================================== */
156
+ .pn-navbar__links {
157
+ height: 100%;
158
+ width: 65%;
159
+ display: flex;
160
+ align-items: center;
161
+ justify-content: flex-end;
162
+ gap: 20px;
163
+ list-style: none;
164
+ margin: 0;
165
+ padding: 0;
166
+ }
167
+
168
+ .pn-navbar__link-item {
169
+ position: relative;
170
+ list-style: none;
171
+ padding: 2px;
172
+ border-radius: 5px;
173
+ }
174
+
175
+ .pn-navbar__link-item--has-dropdown {
176
+ position: relative;
177
+ }
178
+
179
+ .pn-navbar__link-effect {
180
+ position: absolute;
181
+ transition: filter 0.5s ease-in;
182
+ height: 100%;
183
+ width: 100%;
184
+ top: 0;
185
+ left: 0;
186
+ z-index: -1;
187
+ border-radius: 5px;
188
+ }
189
+
190
+ .pn-navbar__link-item:hover .pn-navbar__link-effect {
191
+ background: var(--pn-gradient-border);
192
+ opacity: 0.3;
193
+ background-size: 600% 600%;
194
+ animation: pn-animate-border 1.5s ease infinite;
195
+ filter: blur(5px);
196
+ transition: filter 0.5s ease-in;
197
+ }
198
+
199
+ .pn-navbar__link-button {
200
+ white-space: nowrap;
201
+ height: fit-content;
202
+ width: fit-content;
203
+ display: flex;
204
+ justify-content: center;
205
+ align-items: center;
206
+ font-family: var(--pn-font-primary);
207
+ font-size: 14px;
208
+ font-weight: 600;
209
+ color: var(--pn-text-primary);
210
+ padding: 8px;
211
+ border-radius: 5px;
212
+ letter-spacing: 0.5px;
213
+ cursor: pointer;
214
+ position: relative;
215
+ user-select: none;
216
+ -webkit-user-select: none;
217
+ -moz-user-select: none;
218
+ -ms-user-select: none;
219
+ }
220
+
221
+ .pn-navbar__link-button--coming-soon {
222
+ cursor: not-allowed;
223
+ }
224
+
225
+ .pn-navbar__link-button--coming-soon::after {
226
+ content: attr(data-tooltip);
227
+ position: absolute;
228
+ bottom: -30px;
229
+ left: 50%;
230
+ transform: translateX(-50%);
231
+ background: var(--pn-bg-primary);
232
+ color: var(--pn-text-primary);
233
+ padding: 5px 10px;
234
+ border-radius: 4px;
235
+ font-size: 12px;
236
+ white-space: nowrap;
237
+ opacity: 0;
238
+ visibility: hidden;
239
+ transition: opacity 0.2s, visibility 0.2s;
240
+ z-index: 10;
241
+ border: 1px solid rgba(255, 255, 255, 0.1);
242
+ }
243
+
244
+ .pn-navbar__link-button--coming-soon:hover::after {
245
+ opacity: 1;
246
+ visibility: visible;
247
+ }
248
+
249
+ .pn-navbar__link-item:hover .pn-navbar__link-button {
250
+ background-color: var(--pn-bg-secondary);
251
+ }
252
+
253
+ .pn-navbar__soon-label {
254
+ position: absolute;
255
+ top: -6px;
256
+ right: -8px;
257
+ background: var(--pn-gradient-primary);
258
+ padding: 1px 4px;
259
+ border-radius: 3px;
260
+ font-size: 8px;
261
+ font-weight: 400;
262
+ color: var(--pn-text-primary);
263
+ letter-spacing: 0.3px;
264
+ text-transform: uppercase;
265
+ font-family: var(--pn-font-secondary);
266
+ text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.25);
267
+ opacity: 1;
268
+ }
269
+
270
+ /* ==========================================
271
+ Dropdown
272
+ ========================================== */
273
+ .pn-navbar__dropdown {
274
+ position: absolute;
275
+ top: 30px;
276
+ left: 50%;
277
+ transform: translateX(-50%);
278
+ z-index: 5;
279
+ }
280
+
281
+ .pn-navbar__dropdown-wrapper {
282
+ position: relative;
283
+ cursor: default;
284
+ display: none;
285
+ margin-top: 15px;
286
+ background: var(--pn-gradient-primary);
287
+ padding: 1px;
288
+ height: fit-content;
289
+ width: 100%;
290
+ border-radius: 5px;
291
+ animation: pn-fadein-fast 0.15s ease-out;
292
+ }
293
+
294
+ .pn-navbar__link-item--has-dropdown:hover .pn-navbar__dropdown-wrapper {
295
+ display: block;
296
+ }
297
+
298
+ .pn-navbar__dropdown-content {
299
+ width: 100%;
300
+ background-color: #000;
301
+ border-radius: 5px;
302
+ z-index: 5;
303
+ padding: 10px 15px 5px 15px;
304
+ }
305
+
306
+ /* ==========================================
307
+ Expanding Text
308
+ ========================================== */
309
+ .pn-navbar__expanding-text-wrapper {
310
+ width: 100%;
311
+ cursor: pointer;
312
+ }
313
+
314
+ .pn-navbar__expanding-text {
315
+ color: var(--pn-text-primary);
316
+ font-family: var(--pn-font-display);
317
+ font-weight: 400;
318
+ margin-bottom: 10px;
319
+ white-space: nowrap;
320
+ position: relative;
321
+ display: inline-block;
322
+ }
323
+
324
+ .pn-navbar__expanding-text::after {
325
+ content: "";
326
+ position: absolute;
327
+ bottom: -2px;
328
+ left: 0;
329
+ height: 1px;
330
+ background: var(--pn-gradient-primary);
331
+ transition: width 0.3s ease;
332
+ }
333
+
334
+ .pn-navbar__expanding-text--idle::after {
335
+ width: 0;
336
+ }
337
+
338
+ .pn-navbar__expanding-text--active::after {
339
+ width: 100%;
340
+ }
341
+
342
+ /* ==========================================
343
+ Action Button
344
+ ========================================== */
345
+ .pn-navbar__action-btn {
346
+ width: 158px;
347
+ height: 40px;
348
+ background-size: 300% 100%;
349
+ margin-left: 60px;
350
+ border-radius: 5px;
351
+ cursor: pointer;
352
+ font-family: var(--pn-font-secondary);
353
+ font-style: normal;
354
+ font-weight: 400;
355
+ font-size: 14px;
356
+ color: var(--pn-text-primary);
357
+ text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.25);
358
+ border: none;
359
+ outline: none;
360
+ transition: all 0.4s ease-in-out;
361
+ position: relative;
362
+ display: flex;
363
+ justify-content: center;
364
+ align-items: center;
365
+ }
366
+
367
+ .pn-navbar__action-btn--primary {
368
+ background-image: var(--pn-gradient-button);
369
+ }
370
+
371
+ .pn-navbar__action-btn--connected {
372
+ background: transparent;
373
+ border: 2px solid var(--pn-text-primary);
374
+ }
375
+
376
+ .pn-navbar__action-btn:hover {
377
+ background-position: 100% 0;
378
+ transition: all 0.4s ease-in-out;
379
+ }
380
+
381
+ /* ==========================================
382
+ Mobile Toggle
383
+ ========================================== */
384
+ .pn-navbar__mobile-toggle {
385
+ display: none;
386
+ background: transparent;
387
+ border: none;
388
+ cursor: pointer;
389
+ padding: 0;
390
+ user-select: none;
391
+ -webkit-user-drag: none;
392
+ }
393
+
394
+ .pn-navbar__mobile-toggle svg {
395
+ height: 30px;
396
+ width: 30px;
397
+ }
398
+
399
+ /* ==========================================
400
+ Drawer (Mobile Menu)
401
+ ========================================== */
402
+ .pn-navbar__drawer {
403
+ height: 100vh;
404
+ width: 234px;
405
+ background: var(--pn-bg-primary);
406
+ box-shadow: -10px 4px 24px rgba(255, 255, 255, 0.09);
407
+ position: fixed;
408
+ right: 0;
409
+ top: 0;
410
+ z-index: 80;
411
+ animation: pn-drawer-slide-in 0.5s forwards;
412
+ display: flex;
413
+ flex-direction: column;
414
+ border-left: 1px solid rgba(255, 255, 255, 0.05);
415
+ }
416
+
417
+ .pn-navbar__drawer-header {
418
+ height: 74px;
419
+ width: 100%;
420
+ position: relative;
421
+ display: flex;
422
+ align-items: center;
423
+ border-bottom: 1px solid rgba(255, 255, 255, 0.05);
424
+ }
425
+
426
+ .pn-navbar__drawer-logo {
427
+ width: 100px;
428
+ height: fit-content;
429
+ -webkit-user-drag: none;
430
+ user-select: none;
431
+ position: relative;
432
+ left: 15%;
433
+ cursor: pointer;
434
+ }
435
+
436
+ .pn-navbar__drawer-close {
437
+ cursor: pointer;
438
+ width: 17px;
439
+ height: 17px;
440
+ position: absolute;
441
+ top: 28px;
442
+ right: 20px;
443
+ -webkit-user-drag: none;
444
+ user-select: none;
445
+ background: transparent;
446
+ border: none;
447
+ padding: 0;
448
+ }
449
+
450
+ .pn-navbar__drawer-links {
451
+ flex: 1;
452
+ width: 100%;
453
+ display: flex;
454
+ flex-direction: column;
455
+ gap: 16px;
456
+ border-bottom: 1px solid rgba(255, 255, 255, 0.05);
457
+ padding: 18px 24px;
458
+ }
459
+
460
+ .pn-navbar__drawer-links .pn-navbar__expanding-text {
461
+ font-family: var(--pn-font-body);
462
+ font-style: normal;
463
+ font-weight: 600;
464
+ font-size: 16px;
465
+ color: var(--pn-text-primary);
466
+ margin-bottom: 0;
467
+ }
468
+
469
+ .pn-navbar__drawer-actions {
470
+ padding: 18px 24px;
471
+ width: 100%;
472
+ display: flex;
473
+ flex-direction: column;
474
+ gap: 8px;
475
+ }
476
+
477
+ .pn-navbar__drawer-btn {
478
+ height: 35px;
479
+ width: 170px;
480
+ border: none;
481
+ outline: none;
482
+ border-radius: 5px;
483
+ font-family: var(--pn-font-body);
484
+ font-size: 15px;
485
+ color: var(--pn-text-primary);
486
+ font-weight: 600;
487
+ text-align: center;
488
+ cursor: pointer;
489
+ }
490
+
491
+ .pn-navbar__drawer-btn--primary {
492
+ background: #758bf0;
493
+ }
494
+
495
+ .pn-navbar__drawer-btn--connected {
496
+ background: transparent;
497
+ border: 2px solid var(--pn-text-primary);
498
+ }
499
+
500
+ /* ==========================================
501
+ Responsive Styles
502
+ ========================================== */
503
+ @media screen and (max-width: 1440px) {
504
+ .pn-navbar {
505
+ width: 100vw;
506
+ position: relative;
507
+ }
508
+ }
509
+
510
+ @media screen and (max-width: 1200px) {
511
+ .pn-navbar__items {
512
+ height: 100%;
513
+ width: 80%;
514
+ display: flex;
515
+ align-items: center;
516
+ justify-content: flex-end;
517
+ }
518
+ }
519
+
520
+ @media screen and (max-width: 1020px) {
521
+ .pn-navbar {
522
+ height: 90px;
523
+ width: 100%;
524
+ z-index: 5;
525
+ }
526
+
527
+ .pn-navbar__bottom-line {
528
+ height: 1px;
529
+ width: 100%;
530
+ opacity: 0.3;
531
+ }
532
+
533
+ .pn-navbar__content {
534
+ height: 50%;
535
+ width: 90%;
536
+ justify-content: space-between;
537
+ z-index: 3;
538
+ }
539
+
540
+ .pn-navbar__logo {
541
+ width: fit-content;
542
+ height: 100%;
543
+ left: 0;
544
+ position: relative;
545
+ }
546
+
547
+ .pn-navbar__links {
548
+ display: none;
549
+ }
550
+
551
+ .pn-navbar__action-btn {
552
+ display: none;
553
+ }
554
+
555
+ .pn-navbar__slots {
556
+ display: none;
557
+ }
558
+
559
+ .pn-navbar__mobile-toggle {
560
+ display: block;
561
+ }
562
+ }
563
+
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@ali-hajeh/purple-navbar",
3
+ "version": "1.0.0",
4
+ "description": "Purple Navbar - A self-contained, composable navigation component",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/index.d.mts",
12
+ "default": "./dist/index.mjs"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
18
+ },
19
+ "./styles.css": "./dist/styles/navbar.css"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsup",
26
+ "dev": "tsup --watch",
27
+ "clean": "rm -rf dist",
28
+ "prepublishOnly": "npm run build",
29
+ "typecheck": "tsc --noEmit"
30
+ },
31
+ "peerDependencies": {
32
+ "react": "^18.0.0",
33
+ "react-dom": "^18.0.0"
34
+ },
35
+ "devDependencies": {
36
+ "@types/react": "^18.2.0",
37
+ "@types/react-dom": "^18.2.0",
38
+ "react": "^18.2.0",
39
+ "react-dom": "^18.2.0",
40
+ "tsup": "^8.0.0",
41
+ "typescript": "^5.3.0"
42
+ },
43
+ "keywords": [
44
+ "navbar",
45
+ "navigation",
46
+ "react",
47
+ "component",
48
+ "ui"
49
+ ],
50
+ "author": "Ali Hajeh",
51
+ "license": "MIT",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": ""
55
+ },
56
+ "publishConfig": {
57
+ "access": "public"
58
+ }
59
+ }
60
+