@alphacifer/slidev-addon-theme 0.0.5 → 0.0.6
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 +127 -2
- package/components/arc-arrow-process/ArcArrowProcess.vue +361 -0
- package/components/arc-arrow-process/ArcArrowProcessArrow.vue +143 -0
- package/components/arc-arrow-process/ArcArrowProcessCallout.vue +361 -0
- package/components/arc-arrow-process/ArcArrowProcessContent.vue +38 -0
- package/components/arc-arrow-process/ArcArrowProcessHeading.vue +43 -0
- package/components/arc-arrow-process/ArcArrowProcessIcon.vue +154 -0
- package/components/arc-compare/ArcCompare.vue +443 -0
- package/components/arc-compare/ArcCompareBadge.vue +63 -0
- package/components/arc-compare/ArcCompareCallout.vue +386 -0
- package/components/arc-compare/ArcCompareContent.vue +52 -0
- package/components/arc-compare/ArcCompareContents.vue +18 -0
- package/components/arc-compare/ArcCompareHeading.vue +52 -0
- package/components/arc-compare/ArcCompareLeft.vue +183 -0
- package/components/arc-compare/ArcCompareRight.vue +183 -0
- package/components/arc-compare/ArcCompareTitle.vue +47 -0
- package/components/arrow-triad/ArrowTriad.vue +368 -0
- package/components/arrow-triad/ArrowTriadCallout.vue +300 -0
- package/components/arrow-triad/ArrowTriadContent.vue +38 -0
- package/components/arrow-triad/ArrowTriadHeading.vue +38 -0
- package/components/arrow-triad/ArrowTriadIcon.vue +96 -0
- package/components/chevron-card/ChevronCard.vue +237 -0
- package/components/chevron-card/ChevronCardBadge.vue +74 -0
- package/components/chevron-card/ChevronCardContent.vue +39 -0
- package/components/chevron-card/ChevronCardHeading.vue +39 -0
- package/components/hex-triad/HexTriad.vue +438 -0
- package/components/hex-triad/HexTriadBadge.vue +110 -0
- package/components/hex-triad/HexTriadCallout.vue +200 -0
- package/components/hex-triad/HexTriadCenterBadge.vue +51 -0
- package/components/hex-triad/HexTriadContent.vue +20 -0
- package/components/hex-triad/HexTriadHeading.vue +28 -0
- package/components/hex-triad/HexTriadLayer.vue +28 -0
- package/components/horiz-card/HorizCard.vue +318 -0
- package/components/horiz-card/HorizCardBadge.vue +75 -0
- package/components/horiz-card/HorizCardContent.vue +46 -0
- package/components/horiz-card/HorizCardHeading.vue +47 -0
- package/components/horiz-card/HorizCardIcon.vue +118 -0
- package/components/quad-hub/QuadHub.vue +642 -0
- package/components/quad-hub/QuadHubCallout.vue +267 -0
- package/components/quad-hub/QuadHubCenter.vue +53 -0
- package/components/quad-hub/QuadHubContent.vue +39 -0
- package/components/quad-hub/QuadHubHeading.vue +44 -0
- package/components/quad-hub/QuadHubIcon.vue +112 -0
- package/components/shifting-heading/TransitionHeading.vue +2 -2
- package/components/vert-card/VertCard.vue +389 -0
- package/components/vert-card/VertCardBadge.vue +72 -0
- package/components/vert-card/VertCardContent.vue +45 -0
- package/components/vert-card/VertCardHeading.vue +68 -0
- package/components/vert-card/VertCardIcon.vue +126 -0
- package/components/vert-card/VertCardTitle.vue +76 -0
- package/layouts/core/arc-toc.vue +76 -113
- package/layouts/core/bg-center.vue +32 -4
- package/layouts/shifting-heading/shifting-intro.vue +35 -7
- package/package.json +3 -2
- package/utils/arcArrowProcess/context.ts +28 -0
- package/utils/arcArrowProcess/createArcArrowProcessGeometry.ts +137 -0
- package/utils/arcArrowProcess/index.ts +3 -0
- package/utils/arcArrowProcess/resolveArcArrowProcessItems.ts +189 -0
- package/utils/arcCompare/context.ts +36 -0
- package/utils/arcCompare/createArcCompareGeometry.ts +254 -0
- package/utils/arcCompare/index.ts +3 -0
- package/utils/arcCompare/resolveArcCompareItems.ts +123 -0
- package/utils/arrowTriad/context.ts +38 -0
- package/utils/arrowTriad/createArrowTriadGeometry.ts +63 -0
- package/utils/arrowTriad/index.ts +3 -0
- package/utils/arrowTriad/resolveArrowTriadItems.ts +121 -0
- package/utils/chevronCard/context.ts +12 -0
- package/utils/chevronCard/createChevronCardGeometry.ts +48 -0
- package/utils/chevronCard/index.ts +2 -0
- package/utils/hexTriad/context.ts +25 -0
- package/utils/hexTriad/createHexTriadGeometry.ts +182 -0
- package/utils/hexTriad/index.ts +3 -0
- package/utils/hexTriad/resolveHexTriadItems.ts +63 -0
- package/utils/horizCard/context.ts +13 -0
- package/utils/horizCard/createHorizCardGeometry.ts +243 -0
- package/utils/horizCard/index.ts +2 -0
- package/utils/quadHub/context.ts +26 -0
- package/utils/quadHub/createQuadHubGeometry.ts +331 -0
- package/utils/quadHub/index.ts +3 -0
- package/utils/quadHub/resolveQuadHubItems.ts +214 -0
- package/utils/useDiagramAutoScale.ts +300 -0
- package/utils/vertCard/context.ts +18 -0
- package/utils/vertCard/createVertCardGeometry.ts +242 -0
- package/utils/vertCard/index.ts +2 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, inject } from 'vue';
|
|
3
|
+
|
|
4
|
+
import { useMergedUnoAttrs } from '../../utils/useMergedUnoAttrs';
|
|
5
|
+
import { VERT_CARD_KEY } from '../../utils/vertCard';
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
name: 'VertCardTitle',
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export interface IVertCardTitleProps {
|
|
13
|
+
/**
|
|
14
|
+
* Title text color. Overrides context titleColor.
|
|
15
|
+
*/
|
|
16
|
+
readonly color?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to render the decorative horizontal line with center dot below the title.
|
|
19
|
+
* Defaults to context hasDivider, or true.
|
|
20
|
+
*/
|
|
21
|
+
readonly hasDivider?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(defineProps<IVertCardTitleProps>(), {
|
|
25
|
+
color: undefined,
|
|
26
|
+
hasDivider: undefined,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const context = inject(VERT_CARD_KEY, undefined);
|
|
30
|
+
|
|
31
|
+
const headingColor = computed(() => {
|
|
32
|
+
return (
|
|
33
|
+
props.color ??
|
|
34
|
+
context?.titleColor.value ??
|
|
35
|
+
context?.color.value ??
|
|
36
|
+
'#ea583a'
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const isDividerVisible = computed(() => {
|
|
41
|
+
if (props.hasDivider !== undefined) {
|
|
42
|
+
return props.hasDivider;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return context?.hasDivider?.value ?? true;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
49
|
+
'alpha-vert-card-title font-sans font-bold text-xl tracking-tight leading-tight text-center',
|
|
50
|
+
);
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div class="flex flex-col items-center w-full">
|
|
55
|
+
<h3
|
|
56
|
+
v-bind="forwardedAttrs()"
|
|
57
|
+
:class="className()"
|
|
58
|
+
:style="{ color: headingColor }"
|
|
59
|
+
>
|
|
60
|
+
<slot>Lorem Ipsum</slot>
|
|
61
|
+
</h3>
|
|
62
|
+
<div
|
|
63
|
+
v-if="isDividerVisible"
|
|
64
|
+
class="mt-2.5 flex items-center justify-center w-32 relative"
|
|
65
|
+
>
|
|
66
|
+
<div
|
|
67
|
+
class="w-full h-[1.5px]"
|
|
68
|
+
:style="{ backgroundColor: headingColor }"
|
|
69
|
+
/>
|
|
70
|
+
<span
|
|
71
|
+
class="absolute w-2 h-2 rounded-full"
|
|
72
|
+
:style="{ backgroundColor: headingColor }"
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</template>
|
package/layouts/core/arc-toc.vue
CHANGED
|
@@ -38,10 +38,14 @@ const props = defineProps({
|
|
|
38
38
|
type: [Number, String],
|
|
39
39
|
default: 1,
|
|
40
40
|
},
|
|
41
|
+
indexed: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
41
45
|
});
|
|
42
46
|
|
|
43
47
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
44
|
-
'alpha-arc-toc slidev-layout default arc-toc-layout',
|
|
48
|
+
'alpha-arc-toc slidev-layout default arc-toc-layout h-full',
|
|
45
49
|
);
|
|
46
50
|
|
|
47
51
|
const markerColors = [
|
|
@@ -59,7 +63,16 @@ interface ITocConnector {
|
|
|
59
63
|
readonly path: string;
|
|
60
64
|
}
|
|
61
65
|
|
|
62
|
-
const { $slidev } = useSlideContext();
|
|
66
|
+
const { $slidev, $renderContext } = useSlideContext();
|
|
67
|
+
|
|
68
|
+
const isPresenter = computed(() => {
|
|
69
|
+
return $renderContext.value === 'presenter';
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const visibleTocItems = computed(() => {
|
|
73
|
+
return $slidev.nav.tocTree.slice(0, tocItemCount.value);
|
|
74
|
+
});
|
|
75
|
+
|
|
63
76
|
const rootElement = ref<HTMLElement>();
|
|
64
77
|
const arcPath = ref('');
|
|
65
78
|
const connectors = ref<readonly ITocConnector[]>([]);
|
|
@@ -108,12 +121,14 @@ function updateConnectors(): void {
|
|
|
108
121
|
return;
|
|
109
122
|
}
|
|
110
123
|
|
|
111
|
-
const markers = Array.from(
|
|
124
|
+
const markers = Array.from(
|
|
125
|
+
root.querySelectorAll<HTMLElement>('.alpha-arc-toc__marker'),
|
|
126
|
+
);
|
|
112
127
|
const articles = Array.from(
|
|
113
128
|
root.querySelectorAll<HTMLElement>(
|
|
114
|
-
'.
|
|
129
|
+
'.alpha-arc-toc__content .alpha-arc-toc__item > a',
|
|
115
130
|
),
|
|
116
|
-
)
|
|
131
|
+
);
|
|
117
132
|
const count = Math.min(markers.length, articles.length);
|
|
118
133
|
|
|
119
134
|
articles.forEach((article) => {
|
|
@@ -130,7 +145,7 @@ function updateConnectors(): void {
|
|
|
130
145
|
|
|
131
146
|
articles.forEach((article, index) => {
|
|
132
147
|
const position = markerPositions.value[index];
|
|
133
|
-
const item = article.closest<HTMLElement>('.
|
|
148
|
+
const item = article.closest<HTMLElement>('.alpha-arc-toc__item');
|
|
134
149
|
|
|
135
150
|
if (item && position) {
|
|
136
151
|
item.style.transform = `translateX(${calculateTocArticleOffsetPx(position)}px)`;
|
|
@@ -140,7 +155,7 @@ function updateConnectors(): void {
|
|
|
140
155
|
const rootRect = root.getBoundingClientRect();
|
|
141
156
|
const scaleX = rootRect.width / root.clientWidth;
|
|
142
157
|
const scaleY = rootRect.height / root.clientHeight;
|
|
143
|
-
const tocContent = root.querySelector<HTMLElement>('.
|
|
158
|
+
const tocContent = root.querySelector<HTMLElement>('.alpha-arc-toc__content');
|
|
144
159
|
|
|
145
160
|
arcPath.value = createTocArcPath(
|
|
146
161
|
calculateFullTocArcPoints({
|
|
@@ -226,7 +241,7 @@ onMounted(async () => {
|
|
|
226
241
|
|
|
227
242
|
connectorResizeObserver = new ResizeObserver(scheduleConnectorUpdate);
|
|
228
243
|
connectorResizeObserver.observe(root);
|
|
229
|
-
const tocContent = root.querySelector('.
|
|
244
|
+
const tocContent = root.querySelector('.alpha-arc-toc__content');
|
|
230
245
|
if (tocContent) {
|
|
231
246
|
connectorMutationObserver = new MutationObserver(scheduleConnectorUpdate);
|
|
232
247
|
connectorMutationObserver.observe(tocContent, {
|
|
@@ -259,29 +274,29 @@ onBeforeUnmount(() => {
|
|
|
259
274
|
v-bind="forwardedAttrs()"
|
|
260
275
|
:class="className()"
|
|
261
276
|
>
|
|
262
|
-
<header class="
|
|
277
|
+
<header class="alpha-arc-toc__heading">
|
|
263
278
|
<slot>
|
|
264
279
|
<h1>Table of Contents</h1>
|
|
265
280
|
</slot>
|
|
266
281
|
</header>
|
|
267
282
|
<svg
|
|
268
|
-
class="
|
|
283
|
+
class="alpha-arc-toc__curve"
|
|
269
284
|
:viewBox="`0 0 ${rootElement?.clientWidth ?? 0} ${rootElement?.clientHeight ?? 0}`"
|
|
270
285
|
preserveAspectRatio="none"
|
|
271
286
|
aria-hidden="true"
|
|
272
287
|
>
|
|
273
288
|
<path :d="arcPath" />
|
|
274
289
|
</svg>
|
|
275
|
-
<div class="
|
|
290
|
+
<div class="alpha-arc-toc__markers" aria-hidden="true">
|
|
276
291
|
<span
|
|
277
292
|
v-for="(markerStyle, index) in markerStyles"
|
|
278
293
|
:key="index"
|
|
279
|
-
class="
|
|
294
|
+
class="alpha-arc-toc__marker"
|
|
280
295
|
:style="markerStyle"
|
|
281
296
|
></span>
|
|
282
297
|
</div>
|
|
283
298
|
<svg
|
|
284
|
-
class="
|
|
299
|
+
class="alpha-arc-toc__connectors"
|
|
285
300
|
:viewBox="`0 0 ${rootElement?.clientWidth ?? 0} ${rootElement?.clientHeight ?? 0}`"
|
|
286
301
|
preserveAspectRatio="none"
|
|
287
302
|
aria-hidden="true"
|
|
@@ -293,12 +308,31 @@ onBeforeUnmount(() => {
|
|
|
293
308
|
:stroke="connector.color"
|
|
294
309
|
/>
|
|
295
310
|
</svg>
|
|
296
|
-
<
|
|
297
|
-
class="
|
|
298
|
-
:data-item-count="tocItemCount"
|
|
299
|
-
:max-depth="props.maxDepth"
|
|
311
|
+
<nav
|
|
312
|
+
class="alpha-arc-toc__content"
|
|
300
313
|
:style="tocContentStyle"
|
|
301
|
-
|
|
314
|
+
>
|
|
315
|
+
<ol class="alpha-arc-toc__list">
|
|
316
|
+
<li
|
|
317
|
+
v-for="(item, index) in visibleTocItems"
|
|
318
|
+
:key="item.path"
|
|
319
|
+
class="alpha-arc-toc__item"
|
|
320
|
+
:class="{ 'alpha-arc-toc__item--active': item.active }"
|
|
321
|
+
:style="{ '--toc-color': markerColors[index % markerColors.length] }"
|
|
322
|
+
>
|
|
323
|
+
<RouterLink
|
|
324
|
+
:to="isPresenter ? `/presenter${item.path}` : item.path"
|
|
325
|
+
@click="($event.target as HTMLElement)?.blur()"
|
|
326
|
+
>
|
|
327
|
+
<span
|
|
328
|
+
v-if="props.indexed"
|
|
329
|
+
class="alpha-arc-toc__item-index"
|
|
330
|
+
>{{ index + 1 }}. </span>
|
|
331
|
+
<span class="alpha-arc-toc__item-text">{{ item.title }}</span>
|
|
332
|
+
</RouterLink>
|
|
333
|
+
</li>
|
|
334
|
+
</ol>
|
|
335
|
+
</nav>
|
|
302
336
|
</div>
|
|
303
337
|
</template>
|
|
304
338
|
|
|
@@ -311,14 +345,17 @@ onBeforeUnmount(() => {
|
|
|
311
345
|
--toc-pink: #f53270;
|
|
312
346
|
--toc-purple: #8b5cf6;
|
|
313
347
|
--toc-red: #ef4444;
|
|
348
|
+
}
|
|
314
349
|
|
|
350
|
+
.alpha-arc-toc.slidev-layout {
|
|
315
351
|
position: relative;
|
|
316
352
|
overflow: hidden;
|
|
353
|
+
height: 100%;
|
|
317
354
|
padding: 0;
|
|
318
355
|
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
319
356
|
}
|
|
320
357
|
|
|
321
|
-
.
|
|
358
|
+
.alpha-arc-toc__heading {
|
|
322
359
|
position: absolute;
|
|
323
360
|
top: 50%;
|
|
324
361
|
left: 10%;
|
|
@@ -327,7 +364,7 @@ onBeforeUnmount(() => {
|
|
|
327
364
|
transform: translateY(-50%);
|
|
328
365
|
}
|
|
329
366
|
|
|
330
|
-
.
|
|
367
|
+
.alpha-arc-toc__heading :deep(h1) {
|
|
331
368
|
max-width: 8ch;
|
|
332
369
|
margin: 0;
|
|
333
370
|
font-family: inherit;
|
|
@@ -340,11 +377,11 @@ onBeforeUnmount(() => {
|
|
|
340
377
|
|
|
341
378
|
/* Slide markdown often contains explanatory copy after its heading. This
|
|
342
379
|
layout intentionally presents only the heading and the TOC labels. */
|
|
343
|
-
.
|
|
380
|
+
.alpha-arc-toc__heading :deep(:not(h1)) {
|
|
344
381
|
display: none;
|
|
345
382
|
}
|
|
346
383
|
|
|
347
|
-
.
|
|
384
|
+
.alpha-arc-toc__curve {
|
|
348
385
|
position: absolute;
|
|
349
386
|
inset: 0;
|
|
350
387
|
width: 100%;
|
|
@@ -353,14 +390,14 @@ onBeforeUnmount(() => {
|
|
|
353
390
|
pointer-events: none;
|
|
354
391
|
}
|
|
355
392
|
|
|
356
|
-
.
|
|
393
|
+
.alpha-arc-toc__curve path {
|
|
357
394
|
fill: none;
|
|
358
395
|
stroke: #d7d7d5;
|
|
359
396
|
stroke-width: 2;
|
|
360
397
|
vector-effect: non-scaling-stroke;
|
|
361
398
|
}
|
|
362
399
|
|
|
363
|
-
.
|
|
400
|
+
.alpha-arc-toc__marker {
|
|
364
401
|
position: absolute;
|
|
365
402
|
z-index: 2;
|
|
366
403
|
width: 1rem;
|
|
@@ -372,7 +409,7 @@ onBeforeUnmount(() => {
|
|
|
372
409
|
transform: translate(-50%, -50%);
|
|
373
410
|
}
|
|
374
411
|
|
|
375
|
-
.
|
|
412
|
+
.alpha-arc-toc__connectors {
|
|
376
413
|
position: absolute;
|
|
377
414
|
inset: 0;
|
|
378
415
|
z-index: 1;
|
|
@@ -382,7 +419,7 @@ onBeforeUnmount(() => {
|
|
|
382
419
|
pointer-events: none;
|
|
383
420
|
}
|
|
384
421
|
|
|
385
|
-
.
|
|
422
|
+
.alpha-arc-toc__connectors path {
|
|
386
423
|
fill: none;
|
|
387
424
|
stroke-linecap: round;
|
|
388
425
|
stroke-linejoin: round;
|
|
@@ -390,15 +427,15 @@ onBeforeUnmount(() => {
|
|
|
390
427
|
vector-effect: non-scaling-stroke;
|
|
391
428
|
}
|
|
392
429
|
|
|
393
|
-
.
|
|
430
|
+
.alpha-arc-toc__content {
|
|
394
431
|
position: absolute;
|
|
395
432
|
top: 9%;
|
|
433
|
+
right: 3%;
|
|
396
434
|
left: 41.2%;
|
|
397
435
|
z-index: 2;
|
|
398
|
-
width: 55%;
|
|
399
436
|
}
|
|
400
437
|
|
|
401
|
-
.
|
|
438
|
+
.alpha-arc-toc__list {
|
|
402
439
|
display: flex;
|
|
403
440
|
flex-direction: column;
|
|
404
441
|
gap: var(--toc-list-gap);
|
|
@@ -407,67 +444,22 @@ onBeforeUnmount(() => {
|
|
|
407
444
|
list-style: none;
|
|
408
445
|
}
|
|
409
446
|
|
|
410
|
-
.
|
|
411
|
-
display: none;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
.toc-content[data-item-count='1']
|
|
415
|
-
:deep(.slidev-toc-list-level-1 > .slidev-toc-item:nth-child(n + 2)),
|
|
416
|
-
.toc-content[data-item-count='2']
|
|
417
|
-
:deep(.slidev-toc-list-level-1 > .slidev-toc-item:nth-child(n + 3)),
|
|
418
|
-
.toc-content[data-item-count='3']
|
|
419
|
-
:deep(.slidev-toc-list-level-1 > .slidev-toc-item:nth-child(n + 4)),
|
|
420
|
-
.toc-content[data-item-count='4']
|
|
421
|
-
:deep(.slidev-toc-list-level-1 > .slidev-toc-item:nth-child(n + 5)),
|
|
422
|
-
.toc-content[data-item-count='5']
|
|
423
|
-
:deep(.slidev-toc-list-level-1 > .slidev-toc-item:nth-child(n + 6)),
|
|
424
|
-
.toc-content[data-item-count='6']
|
|
425
|
-
:deep(.slidev-toc-list-level-1 > .slidev-toc-item:nth-child(n + 7)) {
|
|
426
|
-
display: none;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
.toc-content :deep(.slidev-toc-item) {
|
|
430
|
-
--toc-color: var(--toc-orange);
|
|
431
|
-
|
|
447
|
+
.alpha-arc-toc__item {
|
|
432
448
|
position: relative;
|
|
433
449
|
margin: 0;
|
|
434
450
|
padding: 0;
|
|
435
451
|
}
|
|
436
452
|
|
|
437
|
-
.
|
|
438
|
-
--toc-color: var(--toc-teal);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.toc-content :deep(.slidev-toc-item:nth-child(7n + 3)) {
|
|
442
|
-
--toc-color: var(--toc-blue);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
.toc-content :deep(.slidev-toc-item:nth-child(7n + 4)) {
|
|
446
|
-
--toc-color: var(--toc-green);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
.toc-content :deep(.slidev-toc-item:nth-child(7n + 5)) {
|
|
450
|
-
--toc-color: var(--toc-pink);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
.toc-content :deep(.slidev-toc-item:nth-child(7n + 6)) {
|
|
454
|
-
--toc-color: var(--toc-purple);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
.toc-content :deep(.slidev-toc-item:nth-child(7n + 7)) {
|
|
458
|
-
--toc-color: var(--toc-red);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
.toc-content :deep(.slidev-toc-item > a) {
|
|
453
|
+
.alpha-arc-toc__item > a {
|
|
462
454
|
position: relative;
|
|
463
455
|
display: flex;
|
|
464
456
|
min-width: 260px;
|
|
465
457
|
min-height: 2.3rem;
|
|
466
458
|
align-items: center;
|
|
467
|
-
justify-content:
|
|
459
|
+
justify-content: flex-start;
|
|
468
460
|
width: 260px;
|
|
469
461
|
padding: 0.5rem 1.25rem;
|
|
470
|
-
border: 0
|
|
462
|
+
border: 0;
|
|
471
463
|
border-radius: 999px;
|
|
472
464
|
background: var(--toc-color);
|
|
473
465
|
box-shadow: 0.45rem 0.65rem 0.85rem rgb(15 23 42 / 18%);
|
|
@@ -476,47 +468,18 @@ onBeforeUnmount(() => {
|
|
|
476
468
|
font-size: 0.9rem;
|
|
477
469
|
font-weight: 700;
|
|
478
470
|
line-height: 1.15;
|
|
479
|
-
text-align:
|
|
480
|
-
text-decoration: none
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
.toc-content :deep(.slidev-toc-list-level-1 > .slidev-toc-item > a) {
|
|
471
|
+
text-align: left;
|
|
472
|
+
text-decoration: none;
|
|
484
473
|
white-space: nowrap;
|
|
485
474
|
}
|
|
486
475
|
|
|
487
|
-
.
|
|
488
|
-
|
|
476
|
+
.alpha-arc-toc__item-index {
|
|
477
|
+
margin-right: 0.35rem;
|
|
489
478
|
}
|
|
490
479
|
|
|
491
|
-
.
|
|
492
|
-
.
|
|
480
|
+
.alpha-arc-toc__item--active > a,
|
|
481
|
+
.alpha-arc-toc__item > a:hover {
|
|
493
482
|
filter: brightness(1.06);
|
|
494
483
|
transform: translateX(0.35rem);
|
|
495
484
|
}
|
|
496
|
-
|
|
497
|
-
.toc-content :deep(.slidev-toc-list-level-2) {
|
|
498
|
-
gap: 0.35rem;
|
|
499
|
-
padding: 0.55rem 0 0 2rem;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
.toc-content :deep(.slidev-toc-list-level-2 .slidev-toc-item::before) {
|
|
503
|
-
display: none;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
.toc-content :deep(.slidev-toc-list-level-2 .slidev-toc-item > a) {
|
|
507
|
-
min-height: auto;
|
|
508
|
-
justify-content: flex-start;
|
|
509
|
-
padding: 0.15rem 0;
|
|
510
|
-
background: transparent;
|
|
511
|
-
box-shadow: none;
|
|
512
|
-
color: #525252;
|
|
513
|
-
font-size: 0.85rem;
|
|
514
|
-
font-weight: 500;
|
|
515
|
-
text-align: left;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
.toc-content :deep(.slidev-toc-list-level-2 .slidev-toc-item > a::before) {
|
|
519
|
-
display: none;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
485
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { handleBackground } from '@slidev/client';
|
|
2
|
+
import { handleBackground, useSlideContext } from '@slidev/client';
|
|
3
3
|
import { computed } from 'vue';
|
|
4
4
|
|
|
5
5
|
import { useMergedUnoAttrs } from '../../utils/useMergedUnoAttrs';
|
|
@@ -8,19 +8,40 @@ defineOptions({
|
|
|
8
8
|
inheritAttrs: false,
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
const { background } = defineProps({
|
|
11
|
+
const { background, indexed, dim } = defineProps({
|
|
12
12
|
background: {
|
|
13
13
|
default: '',
|
|
14
14
|
},
|
|
15
|
+
indexed: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false,
|
|
18
|
+
},
|
|
19
|
+
dim: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true,
|
|
22
|
+
},
|
|
15
23
|
});
|
|
16
24
|
|
|
17
25
|
const style = computed(() => {
|
|
18
|
-
return handleBackground(background,
|
|
26
|
+
return handleBackground(background, dim);
|
|
19
27
|
});
|
|
20
28
|
|
|
21
29
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
22
30
|
'alpha-bg-center slidev-layout bg-center h-full grid place-content-center',
|
|
23
31
|
);
|
|
32
|
+
|
|
33
|
+
const { $slidev, $page } = useSlideContext();
|
|
34
|
+
|
|
35
|
+
const tocIndex = computed(() => {
|
|
36
|
+
const tree = $slidev.nav.tocTree;
|
|
37
|
+
const pos = tree.findIndex((item) => item.no === $page.value);
|
|
38
|
+
|
|
39
|
+
if (pos === -1) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return String(pos + 1).padStart(2, '0');
|
|
44
|
+
});
|
|
24
45
|
</script>
|
|
25
46
|
|
|
26
47
|
<template>
|
|
@@ -29,6 +50,13 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
29
50
|
:class="className()"
|
|
30
51
|
:style="style"
|
|
31
52
|
>
|
|
32
|
-
<
|
|
53
|
+
<div
|
|
54
|
+
v-if="indexed && tocIndex !== null"
|
|
55
|
+
class="alpha-bg-center__indexed-content flex flex-col items-center gap-2"
|
|
56
|
+
>
|
|
57
|
+
<span class="alpha-bg-center__index text-5xl font-extrabold leading-none text-white opacity-50 tracking-tighter">{{ tocIndex }}</span>
|
|
58
|
+
<slot />
|
|
59
|
+
</div>
|
|
60
|
+
<slot v-else />
|
|
33
61
|
</div>
|
|
34
62
|
</template>
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useSlideContext } from '@slidev/client';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
computed,
|
|
5
|
+
onMounted,
|
|
6
|
+
provide,
|
|
7
|
+
ref,
|
|
8
|
+
shallowRef,
|
|
9
|
+
useSlots,
|
|
10
|
+
watch,
|
|
11
|
+
watchEffect,
|
|
12
|
+
} from 'vue';
|
|
4
13
|
|
|
5
14
|
import { collectShiftingIntroNodes } from '../../utils/shiftingHeading/collectShiftingIntroNodes';
|
|
6
15
|
import { useMergedUnoAttrs } from '../../utils/useMergedUnoAttrs';
|
|
@@ -13,13 +22,33 @@ const context = useSlideContext();
|
|
|
13
22
|
const slots = useSlots();
|
|
14
23
|
const { $clicks } = context;
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
let isInitialLoad = true;
|
|
26
|
+
const isShifting = ref(false);
|
|
27
|
+
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
// Allow Slidev router to sync URL clicks on page reload before treating changes as user navigation
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
isInitialLoad = false;
|
|
32
|
+
}, 100);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
provide('SLIDEV_LAYOUT_SHIFTING_INTRO', {
|
|
36
|
+
clicks: $clicks,
|
|
37
|
+
active: computed(() => $clicks.value > 0),
|
|
38
|
+
isShifting: computed(() => isShifting.value),
|
|
39
|
+
});
|
|
17
40
|
|
|
18
41
|
watch($clicks, (newVal, oldVal) => {
|
|
19
|
-
if (
|
|
20
|
-
|
|
42
|
+
if (isInitialLoad) {
|
|
43
|
+
isShifting.value = false;
|
|
44
|
+
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (oldVal === 0 && newVal > 0) {
|
|
49
|
+
isShifting.value = true;
|
|
21
50
|
} else {
|
|
22
|
-
|
|
51
|
+
isShifting.value = false;
|
|
23
52
|
}
|
|
24
53
|
});
|
|
25
54
|
|
|
@@ -58,10 +87,9 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
58
87
|
class="hidden"
|
|
59
88
|
/>
|
|
60
89
|
<div
|
|
61
|
-
class="transition-all duration-1000"
|
|
62
90
|
:class="[
|
|
63
91
|
$clicks > 0 ? 'opacity-100' : 'opacity-0',
|
|
64
|
-
|
|
92
|
+
isShifting ? 'transition-all duration-1000 delay-600' : 'transition-none delay-0',
|
|
65
93
|
]"
|
|
66
94
|
>
|
|
67
95
|
<template v-for="(content) in nodes.contents" :key="content.key">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alphacifer/slidev-addon-theme",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "All Slidev addons for Alpha presentations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
23
|
"url": "git+https://github.com/zgid123/alpha-dx.git",
|
|
24
|
-
"directory": "packages/slidev
|
|
24
|
+
"directory": "packages/slidev/addon-theme"
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"peerDependencies": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"dev": "slidev slides.md --open",
|
|
43
|
+
"dev:academic": "slidev academic-slides.md --open",
|
|
43
44
|
"preview:build": "slidev build slides.md"
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
import type { IResolvedArcArrowProcessItem } from './resolveArcArrowProcessItems';
|
|
4
|
+
|
|
5
|
+
export interface IArcArrowProcessRegistration {
|
|
6
|
+
readonly index: number;
|
|
7
|
+
readonly item: ComputedRef<IResolvedArcArrowProcessItem>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IArcArrowProcessRootContext {
|
|
11
|
+
readonly items: ComputedRef<readonly IResolvedArcArrowProcessItem[]>;
|
|
12
|
+
readonly count: ComputedRef<number>;
|
|
13
|
+
readonly animation: ComputedRef<boolean>;
|
|
14
|
+
readonly registerCallout: () => IArcArrowProcessRegistration;
|
|
15
|
+
readonly setCalloutColor?: (index: number, color: string | undefined) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IArcArrowProcessCalloutContext {
|
|
19
|
+
readonly item: ComputedRef<IResolvedArcArrowProcessItem>;
|
|
20
|
+
readonly index: number;
|
|
21
|
+
readonly count: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const ARC_ARROW_PROCESS_ROOT_KEY: InjectionKey<IArcArrowProcessRootContext> =
|
|
25
|
+
Symbol('ARC_ARROW_PROCESS_ROOT_KEY');
|
|
26
|
+
|
|
27
|
+
export const ARC_ARROW_PROCESS_CALLOUT_KEY: InjectionKey<IArcArrowProcessCalloutContext> =
|
|
28
|
+
Symbol('ARC_ARROW_PROCESS_CALLOUT_KEY');
|