portosaurus 3.0.2 → 4.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.
- package/README.md +26 -126
- package/bin/portosaurus.mjs +8 -0
- package/package.json +6 -3
- package/src/assets/img/icon.png +0 -0
- package/src/assets/img/{icon.svg → svg/icon.svg} +35 -37
- package/src/assets/img/svg/project-blank.svg +140 -0
- package/src/assets/sample-resume.pdf +0 -0
- package/src/cli/build.mjs +2 -5
- package/src/cli/dev.mjs +27 -5
- package/src/cli/init.mjs +6 -12
- package/src/cli/schema.mjs +211 -0
- package/src/core/buildDocuConfig.mjs +305 -188
- package/src/core/constants.mjs +7 -1
- package/src/template/config.yml +150 -0
- package/src/template/notes/welcome.mdx +6 -0
- package/src/template/package.json +3 -3
- package/src/theme/MDXComponents.js +0 -1
- package/src/theme/components/AboutSection/index.js +32 -17
- package/src/theme/components/AboutSection/styles.module.css +151 -344
- package/src/theme/components/ContactSection/index.js +23 -14
- package/src/theme/components/ContactSection/styles.module.css +19 -8
- package/src/theme/components/ExperienceSection/index.js +12 -5
- package/src/theme/components/HeroSection/index.js +4 -3
- package/src/theme/components/HeroSection/styles.module.css +17 -16
- package/src/theme/components/NavArrow/index.js +114 -0
- package/src/theme/components/NavArrow/styles.module.css +107 -0
- package/src/theme/components/NoteIndex/index.js +66 -95
- package/src/theme/components/NoteIndex/styles.module.css +85 -89
- package/src/theme/components/Preview/components/FeedbackStates.js +3 -1
- package/src/theme/components/Preview/components/PreviewContent.js +91 -0
- package/src/theme/components/Preview/components/PreviewHeader.js +41 -33
- package/src/theme/components/Preview/components/Triggers/Pv.js +129 -72
- package/src/theme/components/Preview/components/ViewerWindow.js +198 -234
- package/src/theme/components/Preview/hooks/useAdaptiveSizing.js +115 -0
- package/src/theme/components/Preview/hooks/useDeepLinkHash.js +18 -23
- package/src/theme/components/Preview/hooks/useDockLayout.js +48 -8
- package/src/theme/components/Preview/hooks/useTouchZoom.js +118 -0
- package/src/theme/components/Preview/renderers/CodeRenderer.js +64 -25
- package/src/theme/components/Preview/state/index.js +70 -17
- package/src/theme/components/Preview/styles.module.css +181 -45
- package/src/theme/components/Preview/utils/index.js +11 -10
- package/src/theme/components/ProjectsSection/index.js +138 -148
- package/src/theme/components/ProjectsSection/styles.module.css +178 -112
- package/src/theme/components/SocialLinks/index.js +9 -7
- package/src/theme/components/Tooltip/index.js +31 -20
- package/src/theme/components/Tooltip/styles.module.css +101 -38
- package/src/theme/config/iconMappings.js +2 -0
- package/src/theme/css/custom.css +72 -0
- package/src/theme/hooks/useScrollReveal.js +30 -0
- package/src/theme/pages/index.js +7 -27
- package/src/theme/pages/notes.js +2 -2
- package/src/theme/pages/tasks.js +12 -11
- package/src/utils/cliUtils.mjs +23 -51
- package/src/utils/configUtils.mjs +95 -84
- package/src/utils/systemUtils.mjs +171 -0
- package/src/template/config.js +0 -68
- package/src/theme/components/ScrollToTop/index.js +0 -95
- package/src/theme/components/ScrollToTop/styles.module.css +0 -97
- package/src/theme/config/metaTags.js +0 -21
- /package/src/template/{.nojekyll → static/.nojekyll} +0 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
@keyframes slideUp {
|
|
12
12
|
from {
|
|
13
13
|
opacity: 0;
|
|
14
|
-
transform: translateY(
|
|
14
|
+
transform: translateY(30px);
|
|
15
15
|
}
|
|
16
16
|
to {
|
|
17
17
|
opacity: 1;
|
|
@@ -24,19 +24,31 @@
|
|
|
24
24
|
min-height: calc(100vh - 60px);
|
|
25
25
|
margin-bottom: 0;
|
|
26
26
|
width: 100%;
|
|
27
|
-
padding:
|
|
28
|
-
|
|
27
|
+
padding: 3rem 0 7rem;
|
|
28
|
+
position: relative;
|
|
29
|
+
overflow: visible !important;
|
|
30
|
+
z-index: 100;
|
|
31
|
+
background-color: var(--ifm-background-color) !important;
|
|
32
|
+
box-shadow: none !important;
|
|
33
|
+
border: none !important;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
.projectsContainer {
|
|
32
37
|
max-width: 1200px;
|
|
33
38
|
margin: 0 auto;
|
|
34
39
|
padding: 0 1.5rem 2rem;
|
|
40
|
+
overflow: visible !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.projectsCarousel {
|
|
44
|
+
width: 100%;
|
|
45
|
+
margin: 0;
|
|
46
|
+
padding: 0;
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
.projectsHeader {
|
|
38
50
|
text-align: center;
|
|
39
|
-
margin-bottom:
|
|
51
|
+
margin-bottom: 3.5rem;
|
|
40
52
|
}
|
|
41
53
|
|
|
42
54
|
.projectsTitle {
|
|
@@ -44,43 +56,117 @@
|
|
|
44
56
|
font-weight: 600;
|
|
45
57
|
color: var(--ifm-color-primary);
|
|
46
58
|
margin-bottom: 0.6rem;
|
|
47
|
-
|
|
59
|
+
opacity: 0;
|
|
48
60
|
position: relative;
|
|
49
61
|
display: inline-block;
|
|
50
62
|
}
|
|
51
63
|
|
|
64
|
+
:global(.is-visible) .projectsTitle::after {
|
|
65
|
+
width: 60px;
|
|
66
|
+
transition: width 0.4s ease-out 0.2s;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:global(.is-visible) .projectsTitle {
|
|
70
|
+
animation: slideUp 0.4s ease-out forwards;
|
|
71
|
+
}
|
|
72
|
+
|
|
52
73
|
.projectsSubtitle {
|
|
53
74
|
font-size: 0.95rem;
|
|
54
75
|
color: var(--ifm-font-color-tertiary);
|
|
55
76
|
max-width: 600px;
|
|
56
77
|
margin: 0.4rem auto 0;
|
|
57
|
-
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:global(.is-visible) .projectsSubtitle {
|
|
82
|
+
animation: slideUp 0.4s ease-out 0.1s forwards;
|
|
58
83
|
}
|
|
59
84
|
|
|
60
85
|
/* Carousel Styles */
|
|
61
86
|
.carouselContainer {
|
|
62
87
|
position: relative;
|
|
63
|
-
width: 100%;
|
|
64
|
-
margin: 0 auto;
|
|
65
|
-
padding: 0.75rem 2rem 0;
|
|
66
88
|
display: flex;
|
|
67
89
|
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
gap: 2rem;
|
|
92
|
+
width: 100%;
|
|
68
93
|
}
|
|
69
94
|
|
|
70
95
|
.carouselWrapper {
|
|
71
|
-
|
|
96
|
+
flex: 1;
|
|
97
|
+
min-width: 0;
|
|
72
98
|
overflow: hidden;
|
|
73
|
-
|
|
99
|
+
position: relative;
|
|
100
|
+
padding: 1rem 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.carouselControl {
|
|
104
|
+
background: var(--ifm-color-primary);
|
|
105
|
+
border: none;
|
|
106
|
+
border-radius: 50%;
|
|
107
|
+
width: 44px;
|
|
108
|
+
height: 44px;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
114
|
+
color: var(--ifm-color-emphasis-900);
|
|
115
|
+
box-shadow: var(--ifm-global-shadow-md);
|
|
116
|
+
z-index: 10;
|
|
117
|
+
flex-shrink: 0;
|
|
118
|
+
position: relative;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.carouselControl:hover:not(:disabled) {
|
|
122
|
+
background: var(--ifm-color-primary-darker);
|
|
123
|
+
color: var(--ifm-color-emphasis-900);
|
|
124
|
+
transform: scale(1.1);
|
|
125
|
+
box-shadow: var(--ifm-global-shadow-lw);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.carouselControl:disabled {
|
|
129
|
+
opacity: 0.3;
|
|
130
|
+
cursor: not-allowed;
|
|
74
131
|
}
|
|
75
132
|
|
|
76
133
|
.projectsCarousel {
|
|
77
134
|
width: 100%;
|
|
78
|
-
margin: 0
|
|
135
|
+
margin: 0;
|
|
136
|
+
padding: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.projectsCarousel :global(.slick-list) {
|
|
140
|
+
margin: 0 !important;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.carouselArrow {
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: 50%;
|
|
146
|
+
transform: translateY(-50%);
|
|
147
|
+
z-index: 1000;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
border: none;
|
|
150
|
+
background: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.prevArrow {
|
|
154
|
+
left: -40px !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.nextArrow {
|
|
158
|
+
right: -40px !important;
|
|
79
159
|
}
|
|
80
160
|
|
|
81
161
|
.carouselSlide {
|
|
82
|
-
padding:
|
|
162
|
+
padding: 10px 12px;
|
|
83
163
|
height: 100%;
|
|
164
|
+
position: relative;
|
|
165
|
+
z-index: 1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.carouselSlide:hover {
|
|
169
|
+
z-index: 999;
|
|
84
170
|
}
|
|
85
171
|
|
|
86
172
|
.carouselCard {
|
|
@@ -92,7 +178,6 @@
|
|
|
92
178
|
overflow: hidden;
|
|
93
179
|
box-shadow: var(--ifm-global-shadow-md);
|
|
94
180
|
opacity: 0;
|
|
95
|
-
animation: fadeIn 0.5s ease-out forwards;
|
|
96
181
|
height: 100%;
|
|
97
182
|
transition:
|
|
98
183
|
transform 0.3s ease,
|
|
@@ -100,10 +185,20 @@
|
|
|
100
185
|
border-color 0.3s ease;
|
|
101
186
|
border: 1px solid var(--ifm-shadow-color);
|
|
102
187
|
width: 100%;
|
|
188
|
+
transform: translate3d(0, 0, 0);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:global(.is-visible) .carouselCard {
|
|
192
|
+
animation: slideUp 0.8s ease-out forwards;
|
|
193
|
+
animation-delay: calc(0.3s + (var(--card-index) * 0.1s));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.carouselSlide:hover .carouselCard {
|
|
197
|
+
transform: scale(1.02) translate3d(0, 0, 0);
|
|
103
198
|
}
|
|
104
199
|
|
|
105
200
|
.featuredCard {
|
|
106
|
-
|
|
201
|
+
/* Just the star is enough now */
|
|
107
202
|
box-shadow: var(--ifm-global-shadow-md);
|
|
108
203
|
}
|
|
109
204
|
|
|
@@ -112,17 +207,16 @@
|
|
|
112
207
|
bottom: 10px;
|
|
113
208
|
right: 10px;
|
|
114
209
|
background-color: var(--ifm-color-primary);
|
|
115
|
-
color: var(--ifm-color-
|
|
116
|
-
width:
|
|
117
|
-
height:
|
|
210
|
+
color: var(--ifm-color-emphasis-900);
|
|
211
|
+
width: 24px;
|
|
212
|
+
height: 24px;
|
|
118
213
|
border-radius: 50%;
|
|
119
214
|
display: flex;
|
|
120
215
|
align-items: center;
|
|
121
216
|
justify-content: center;
|
|
122
|
-
font-size: 0.
|
|
217
|
+
font-size: 0.75rem;
|
|
123
218
|
z-index: 5;
|
|
124
219
|
box-shadow: var(--ifm-global-shadow-lw);
|
|
125
|
-
top: auto;
|
|
126
220
|
}
|
|
127
221
|
|
|
128
222
|
.featuredBadge svg {
|
|
@@ -130,12 +224,9 @@
|
|
|
130
224
|
}
|
|
131
225
|
|
|
132
226
|
.carouselCard:hover {
|
|
133
|
-
transform: scale(1.02);
|
|
134
|
-
border
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
.featuredCard:hover {
|
|
138
|
-
border-width: 1.5px;
|
|
227
|
+
transform: scale(1.02) translate3d(0, 0, 0);
|
|
228
|
+
border: 2px solid var(--ifm-color-primary);
|
|
229
|
+
z-index: 999;
|
|
139
230
|
}
|
|
140
231
|
|
|
141
232
|
.projectImageContainer {
|
|
@@ -143,29 +234,40 @@
|
|
|
143
234
|
width: 100%;
|
|
144
235
|
padding-top: 62%;
|
|
145
236
|
overflow: hidden;
|
|
146
|
-
background-color: var(--ifm-
|
|
147
|
-
border-
|
|
148
|
-
border-
|
|
237
|
+
background-color: rgba(var(--ifm-color-primary-rgb), 0.05);
|
|
238
|
+
border-top-left-radius: var(--ifm-card-border-radius);
|
|
239
|
+
border-top-right-radius: var(--ifm-card-border-radius);
|
|
240
|
+
clip-path: inset(
|
|
241
|
+
0 round var(--ifm-card-border-radius) var(--ifm-card-border-radius) 0 0
|
|
242
|
+
);
|
|
243
|
+
border-bottom: 1px solid var(--ifm-hr-border-color);
|
|
149
244
|
}
|
|
150
245
|
|
|
151
246
|
.projectImage {
|
|
152
247
|
position: absolute;
|
|
153
|
-
top:
|
|
154
|
-
left:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
248
|
+
top: 1rem;
|
|
249
|
+
left: 1rem;
|
|
250
|
+
right: 1rem;
|
|
251
|
+
bottom: 1rem;
|
|
252
|
+
width: calc(100% - 2rem);
|
|
253
|
+
height: calc(100% - 2rem);
|
|
254
|
+
object-fit: contain;
|
|
255
|
+
object-position: center;
|
|
256
|
+
transform: scale(1.05) translate3d(0, 0, 0);
|
|
159
257
|
transition: transform 0.5s ease;
|
|
258
|
+
color: transparent;
|
|
259
|
+
font-size: 0;
|
|
260
|
+
text-indent: -9999px;
|
|
261
|
+
backface-visibility: hidden;
|
|
160
262
|
}
|
|
161
263
|
|
|
162
|
-
.
|
|
163
|
-
transform: scale(1.12);
|
|
264
|
+
.carouselSlide:hover .projectImage {
|
|
265
|
+
transform: scale(1.12) translate3d(0, 0, 0);
|
|
164
266
|
}
|
|
165
267
|
|
|
166
268
|
/* Card content styling */
|
|
167
269
|
.projectContent {
|
|
168
|
-
padding:
|
|
270
|
+
padding: 1.2rem 1.5rem 0.5rem;
|
|
169
271
|
flex: 1;
|
|
170
272
|
display: flex;
|
|
171
273
|
flex-direction: column;
|
|
@@ -200,6 +302,7 @@
|
|
|
200
302
|
|
|
201
303
|
.stateCompleted {
|
|
202
304
|
background-color: var(--ifm-color-blue);
|
|
305
|
+
color: var(--ifm-color-black);
|
|
203
306
|
}
|
|
204
307
|
|
|
205
308
|
.stateMaintenance {
|
|
@@ -241,35 +344,46 @@
|
|
|
241
344
|
line-height: 1.4;
|
|
242
345
|
}
|
|
243
346
|
|
|
244
|
-
/* Tags styling */
|
|
245
347
|
.projectTags {
|
|
348
|
+
position: absolute;
|
|
349
|
+
bottom: 10px;
|
|
350
|
+
left: 10px;
|
|
351
|
+
z-index: 5;
|
|
246
352
|
display: flex;
|
|
353
|
+
flex-direction: row;
|
|
247
354
|
flex-wrap: wrap;
|
|
248
|
-
gap:
|
|
249
|
-
|
|
250
|
-
opacity: 0.85;
|
|
251
|
-
justify-content: center;
|
|
355
|
+
gap: 4px;
|
|
356
|
+
align-items: center;
|
|
252
357
|
}
|
|
253
358
|
|
|
254
359
|
.projectTag {
|
|
255
|
-
background-color: var(--ifm-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
padding
|
|
259
|
-
border-radius:
|
|
260
|
-
font-size: 0.
|
|
261
|
-
font-weight:
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
360
|
+
background-color: var(--ifm-background-surface-color);
|
|
361
|
+
backdrop-filter: blur(12px);
|
|
362
|
+
color: var(--ifm-font-color-tertiary);
|
|
363
|
+
padding: 0px 1px 1px 2px;
|
|
364
|
+
border-radius: 3px;
|
|
365
|
+
font-size: 0.5rem;
|
|
366
|
+
font-weight: 700;
|
|
367
|
+
text-transform: capitalize;
|
|
368
|
+
letter-spacing: 0.8px;
|
|
369
|
+
border: 1px solid var(--ifm-card-background-color);
|
|
370
|
+
box-shadow: var(--ifm-global-shadow-lw);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.extraTagBtn {
|
|
374
|
+
background-color: var(--ifm-color-primary) !important;
|
|
375
|
+
color: var(--ifm-color-emphasis-900) !important;
|
|
376
|
+
border: 0.1px solid var(--ifm-color-primary) !important;
|
|
377
|
+
cursor: help;
|
|
378
|
+
opacity: 0.7;
|
|
265
379
|
}
|
|
266
380
|
|
|
267
381
|
/* Links styling */
|
|
268
382
|
.projectLinks {
|
|
269
383
|
display: flex;
|
|
270
384
|
justify-content: center;
|
|
271
|
-
padding: 1.
|
|
272
|
-
gap:
|
|
385
|
+
padding: 1.2rem 1.5rem 1.8rem;
|
|
386
|
+
gap: 1rem;
|
|
273
387
|
margin-top: auto;
|
|
274
388
|
}
|
|
275
389
|
|
|
@@ -315,58 +429,6 @@
|
|
|
315
429
|
color: var(--ifm-color-primary);
|
|
316
430
|
}
|
|
317
431
|
|
|
318
|
-
/* Carousel control buttons */
|
|
319
|
-
.carouselControl {
|
|
320
|
-
position: absolute;
|
|
321
|
-
top: 50%;
|
|
322
|
-
transform: translateY(-50%);
|
|
323
|
-
width: 44px;
|
|
324
|
-
height: 44px;
|
|
325
|
-
border-radius: 50%;
|
|
326
|
-
background-color: var(--ifm-color-primary);
|
|
327
|
-
color: var(--ifm-color-white);
|
|
328
|
-
border: none;
|
|
329
|
-
display: flex;
|
|
330
|
-
align-items: center;
|
|
331
|
-
justify-content: center;
|
|
332
|
-
cursor: pointer;
|
|
333
|
-
z-index: 5;
|
|
334
|
-
transition:
|
|
335
|
-
opacity 0.2s ease,
|
|
336
|
-
background-color 0.2s ease;
|
|
337
|
-
padding: 0;
|
|
338
|
-
box-shadow: var(--ifm-global-shadow-md);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
.carouselControl svg {
|
|
342
|
-
width: 20px;
|
|
343
|
-
height: 20px;
|
|
344
|
-
fill: var(--ifm-color-white);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.carouselControl:hover {
|
|
348
|
-
transform: translateY(-50%) scale(1.1);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/* Disabled button style */
|
|
352
|
-
.disabledButton {
|
|
353
|
-
opacity: 0.5;
|
|
354
|
-
cursor: not-allowed;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.disabledButton:hover {
|
|
358
|
-
transform: translateY(-50%);
|
|
359
|
-
opacity: 0.5;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.prevButton {
|
|
363
|
-
left: -25px;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.nextButton {
|
|
367
|
-
right: -25px;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
432
|
.noProjects {
|
|
371
433
|
text-align: center;
|
|
372
434
|
padding: 2rem;
|
|
@@ -378,8 +440,8 @@
|
|
|
378
440
|
|
|
379
441
|
:global(.slick-track) {
|
|
380
442
|
display: flex !important;
|
|
381
|
-
|
|
382
|
-
margin
|
|
443
|
+
justify-content: center !important;
|
|
444
|
+
margin: 0 auto !important;
|
|
383
445
|
}
|
|
384
446
|
|
|
385
447
|
:global(.slick-slide) {
|
|
@@ -549,11 +611,15 @@
|
|
|
549
611
|
.projectLinks {
|
|
550
612
|
padding: 0.8rem 1.1rem 1.3rem;
|
|
551
613
|
gap: 0.7rem;
|
|
614
|
+
flex-wrap: wrap;
|
|
615
|
+
justify-content: center;
|
|
552
616
|
}
|
|
553
617
|
|
|
554
|
-
.
|
|
555
|
-
padding: 0.
|
|
556
|
-
|
|
618
|
+
.projectLink {
|
|
619
|
+
padding: 0.35rem 0.6rem;
|
|
620
|
+
font-size: 0.75rem;
|
|
621
|
+
min-width: 80px;
|
|
622
|
+
justify-content: center;
|
|
557
623
|
}
|
|
558
624
|
|
|
559
625
|
.prevButton {
|
|
@@ -12,7 +12,7 @@ import { iconMap } from "../../config/iconMappings";
|
|
|
12
12
|
const DEFAULT_ICON = FaQuestionCircle;
|
|
13
13
|
const DEFAULT_COLOR = "var(--ifm-color-primary)";
|
|
14
14
|
|
|
15
|
-
export default function SocialIcons({ showAll = false }) {
|
|
15
|
+
export default function SocialIcons({ showAll = false, links = null }) {
|
|
16
16
|
const { siteConfig } = useDocusaurusContext();
|
|
17
17
|
const { customFields } = siteConfig;
|
|
18
18
|
const isBrowser = useIsBrowser();
|
|
@@ -21,10 +21,11 @@ export default function SocialIcons({ showAll = false }) {
|
|
|
21
21
|
|
|
22
22
|
const allSocialLinks = customFields.socialLinks.links || [];
|
|
23
23
|
|
|
24
|
-
//
|
|
24
|
+
// If specific links are provided, use them. Otherwise, fallback to global logic.
|
|
25
25
|
const socialLinks = useMemo(() => {
|
|
26
|
+
if (links) return links;
|
|
26
27
|
return showAll ? allSocialLinks : allSocialLinks.filter((link) => link.pin);
|
|
27
|
-
}, [allSocialLinks, showAll]);
|
|
28
|
+
}, [allSocialLinks, showAll, links]);
|
|
28
29
|
|
|
29
30
|
// Calculate delays based on screen size
|
|
30
31
|
const calculateDelays = useCallback(() => {
|
|
@@ -91,7 +92,7 @@ export default function SocialIcons({ showAll = false }) {
|
|
|
91
92
|
<div className={styles.socialIcons}>
|
|
92
93
|
{socialLinks.map((social, index) => {
|
|
93
94
|
const { icon: IconComponent, color: iconColor } = getIconDetails(
|
|
94
|
-
social.icon,
|
|
95
|
+
social.icon || social.name,
|
|
95
96
|
);
|
|
96
97
|
const href = social.url || "#";
|
|
97
98
|
const displayColor = social.color || iconColor;
|
|
@@ -99,10 +100,11 @@ export default function SocialIcons({ showAll = false }) {
|
|
|
99
100
|
return (
|
|
100
101
|
<Tooltip
|
|
101
102
|
key={index}
|
|
102
|
-
msg={social.desc || social.icon || "Link"}
|
|
103
|
+
msg={social.desc || social.name || social.icon || "Link"}
|
|
103
104
|
position="top"
|
|
104
|
-
|
|
105
|
+
bg={displayColor}
|
|
105
106
|
underline={false}
|
|
107
|
+
gap={17}
|
|
106
108
|
>
|
|
107
109
|
<a
|
|
108
110
|
href={href}
|
|
@@ -113,7 +115,7 @@ export default function SocialIcons({ showAll = false }) {
|
|
|
113
115
|
"--hover-color": displayColor,
|
|
114
116
|
animationDelay: animationDelays[index] || "0s",
|
|
115
117
|
}}
|
|
116
|
-
aria-label={social.icon || "social link"}
|
|
118
|
+
aria-label={social.name || social.icon || "social link"}
|
|
117
119
|
>
|
|
118
120
|
<IconComponent size={24} />
|
|
119
121
|
</a>
|
|
@@ -7,48 +7,60 @@ export default function Tooltip({
|
|
|
7
7
|
msg,
|
|
8
8
|
position = "top",
|
|
9
9
|
color,
|
|
10
|
+
bg,
|
|
10
11
|
underline = true,
|
|
12
|
+
gap = 5,
|
|
13
|
+
shadow,
|
|
14
|
+
className = "",
|
|
11
15
|
}) {
|
|
16
|
+
if (!msg) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
"Tooltip: 'msg' prop is required to display tooltip content.",
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
12
22
|
const [isVisible, setIsVisible] = useState(false);
|
|
13
23
|
const [coords, setCoords] = useState({ top: 0, left: 0 });
|
|
14
24
|
const containerRef = useRef(null);
|
|
15
25
|
|
|
16
|
-
const tooltipStyle =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
const tooltipStyle = {
|
|
27
|
+
...(bg && { "--tooltip-color": bg }),
|
|
28
|
+
...(color && { "--tooltip-text-color": color }),
|
|
29
|
+
// Auto-contrast: if bg is set but color is not, use inverse text
|
|
30
|
+
...(!color &&
|
|
31
|
+
bg && { "--tooltip-text-color": "var(--ifm-font-color-base-inverse)" }),
|
|
32
|
+
...(shadow && { "--tooltip-shadow": shadow }),
|
|
33
|
+
};
|
|
22
34
|
|
|
23
35
|
const show = useCallback(() => {
|
|
24
|
-
if (!containerRef.current) return;
|
|
25
|
-
const rect = containerRef.current.getBoundingClientRect();
|
|
26
|
-
const
|
|
36
|
+
if (!containerRef.current || !containerRef.current.children[0]) return;
|
|
37
|
+
const rect = containerRef.current.children[0].getBoundingClientRect();
|
|
38
|
+
const tooltipGap = gap;
|
|
27
39
|
|
|
28
40
|
let top, left;
|
|
29
41
|
switch (position) {
|
|
30
42
|
case "bottom":
|
|
31
|
-
top = rect.bottom +
|
|
43
|
+
top = rect.bottom + tooltipGap;
|
|
32
44
|
left = rect.left + rect.width / 2;
|
|
33
45
|
break;
|
|
34
46
|
case "left":
|
|
35
47
|
top = rect.top + rect.height / 2;
|
|
36
|
-
left = rect.left -
|
|
48
|
+
left = rect.left - tooltipGap;
|
|
37
49
|
break;
|
|
38
50
|
case "right":
|
|
39
51
|
top = rect.top + rect.height / 2;
|
|
40
|
-
left = rect.right +
|
|
52
|
+
left = rect.right + tooltipGap;
|
|
41
53
|
break;
|
|
42
54
|
case "top":
|
|
43
55
|
default:
|
|
44
|
-
top = rect.top -
|
|
56
|
+
top = rect.top - tooltipGap;
|
|
45
57
|
left = rect.left + rect.width / 2;
|
|
46
58
|
break;
|
|
47
59
|
}
|
|
48
60
|
|
|
49
61
|
setCoords({ top, left });
|
|
50
62
|
setIsVisible(true);
|
|
51
|
-
}, [position]);
|
|
63
|
+
}, [position, gap]);
|
|
52
64
|
|
|
53
65
|
const hide = useCallback(() => setIsVisible(false), []);
|
|
54
66
|
|
|
@@ -68,18 +80,17 @@ export default function Tooltip({
|
|
|
68
80
|
: null;
|
|
69
81
|
|
|
70
82
|
return (
|
|
71
|
-
<
|
|
83
|
+
<div
|
|
72
84
|
ref={containerRef}
|
|
73
|
-
className={`${styles.tooltipContainer} ${underline ? styles.hasUnderline : ""}`}
|
|
85
|
+
className={`${styles.tooltipContainer} ${underline ? styles.hasUnderline : ""} ${className}`}
|
|
74
86
|
onMouseEnter={show}
|
|
75
87
|
onMouseLeave={hide}
|
|
76
88
|
onFocus={show}
|
|
77
89
|
onBlur={hide}
|
|
90
|
+
style={{ display: "contents" }}
|
|
78
91
|
>
|
|
79
|
-
{
|
|
80
|
-
typeof child === "string" ? child.trim() : child,
|
|
81
|
-
)}
|
|
92
|
+
{children}
|
|
82
93
|
{tooltip}
|
|
83
|
-
</
|
|
94
|
+
</div>
|
|
84
95
|
);
|
|
85
96
|
}
|