@alphacifer/slidev-addon-theme 0.0.10 → 0.0.11
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 +133 -75
- package/components/card/chevron-card/ChevronCard.vue +44 -32
- package/components/card/chevron-card/ChevronCardBadge.vue +14 -8
- package/components/card/chevron-card/ChevronCardContent.vue +15 -13
- package/components/card/chevron-card/style.css +12 -0
- package/components/card/{horiz-card/HorizCard.vue → horizontal-card/HorizontalCard.vue} +78 -85
- package/components/card/{horiz-card/HorizCardBadge.vue → horizontal-card/HorizontalCardBadge.vue} +15 -10
- package/components/card/{horiz-card/HorizCardContent.vue → horizontal-card/HorizontalCardContent.vue} +11 -11
- package/components/card/{horiz-card/HorizCardIcon.vue → horizontal-card/HorizontalCardIcon.vue} +24 -38
- package/components/card/horizontal-card/style.css +17 -0
- package/components/card/{vert-card/VertCard.vue → vertical-card/VerticalCard.vue} +80 -103
- package/components/card/{vert-card/VertCardBadge.vue → vertical-card/VerticalCardBadge.vue} +15 -10
- package/components/card/{vert-card/VertCardContent.vue → vertical-card/VerticalCardContent.vue} +13 -12
- package/components/card/{vert-card/VertCardIcon.vue → vertical-card/VerticalCardIcon.vue} +15 -33
- package/components/card/vertical-card/style.css +19 -0
- package/components/comparisons/arc-comparison/ArcComparison.vue +376 -80
- package/components/comparisons/arc-comparison/ArcComparisonBadge.vue +9 -4
- package/components/comparisons/arc-comparison/ArcComparisonContent.vue +9 -4
- package/components/comparisons/arc-comparison/ArcComparisonHeading.vue +9 -4
- package/components/comparisons/arc-comparison/ArcComparisonLeft.vue +39 -63
- package/components/comparisons/arc-comparison/ArcComparisonOrbit.vue +9 -8
- package/components/comparisons/arc-comparison/ArcComparisonRight.vue +39 -63
- package/components/comparisons/arc-comparison/style.css +27 -0
- package/components/comparisons/table-comparison/TableComparison.vue +17 -97
- package/components/comparisons/table-comparison/TableComparisonCell.vue +22 -20
- package/components/comparisons/table-comparison/{TableComparisonCol.vue → TableComparisonColumn.vue} +16 -14
- package/components/comparisons/table-comparison/{TableComparisonCols.vue → TableComparisonColumns.vue} +5 -8
- package/components/comparisons/table-comparison/TableComparisonRow.vue +10 -14
- package/components/comparisons/table-comparison/TableComparisonRows.vue +1 -4
- package/components/comparisons/table-comparison/style.css +15 -0
- package/components/core/Date.vue +2 -5
- package/components/core/QnA.vue +1 -1
- package/components/core/Quote.vue +3 -6
- package/components/core/ReflectedTitle.vue +2 -6
- package/components/core/Speaker.vue +5 -10
- package/components/core/TransitionHeading.vue +2 -5
- package/components/core/arc-orbit/ArcOrbit.vue +65 -84
- package/components/core/arc-orbit/ArcOrbitBadge.vue +9 -11
- package/components/core/arc-orbit/ArcOrbitCallout.vue +30 -32
- package/components/core/arc-orbit/ArcOrbitContent.vue +6 -12
- package/components/core/arc-orbit/ArcOrbitHeading.vue +13 -11
- package/components/core/arc-orbit/style.css +20 -0
- package/components/core/style.css +9 -0
- package/components/core/thanks/{ThanksContent.vue → SquareThanks.vue} +36 -31
- package/components/core/thanks/SquareThanksContent.vue +89 -0
- package/components/core/thanks/ThanksOutlineSquare.vue +2 -5
- package/components/core/thanks/ThanksSquare.vue +2 -5
- package/components/core/thanks/style.css +30 -0
- package/components/defense-in-depth/{arc-did/ArcDiD.vue → arc-defense-in-depth/ArcDefenseInDepth.vue} +167 -97
- package/components/defense-in-depth/arc-defense-in-depth/ArcDefenseInDepthLayer.vue +240 -0
- package/components/defense-in-depth/{arc-did/ArcDiDLayerTitle.vue → arc-defense-in-depth/ArcDefenseInDepthLayerHeading.vue} +27 -29
- package/components/defense-in-depth/{arc-did/ArcDiDLayerPart.vue → arc-defense-in-depth/ArcDefenseInDepthLayerPart.vue} +91 -39
- package/components/defense-in-depth/{arc-did/ArcDiDLayerSector.vue → arc-defense-in-depth/ArcDefenseInDepthLayerSector.vue} +37 -23
- package/components/defense-in-depth/arc-defense-in-depth/style.css +38 -0
- package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetrad.vue → rectangle-orbit-tetrad/RectangleOrbitTetrad.vue} +66 -63
- package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetradCallout.vue → rectangle-orbit-tetrad/RectangleOrbitTetradCallout.vue} +62 -48
- package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradCenter.vue +54 -0
- package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradContent.vue +44 -0
- package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradHeading.vue +27 -0
- package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetradIcon.vue → rectangle-orbit-tetrad/RectangleOrbitTetradIcon.vue} +23 -13
- package/components/facets/tetrad/rectangle-orbit-tetrad/style.css +22 -0
- package/components/facets/triad/arrow-triad/ArrowTriad.vue +99 -109
- package/components/facets/triad/arrow-triad/ArrowTriadCallout.vue +31 -59
- package/components/facets/triad/arrow-triad/ArrowTriadContent.vue +18 -13
- package/components/facets/triad/arrow-triad/ArrowTriadHeading.vue +20 -13
- package/components/facets/triad/arrow-triad/ArrowTriadIcon.vue +14 -9
- package/components/facets/triad/arrow-triad/style.css +15 -0
- package/components/facets/triad/gear-triad/GearTriad.vue +73 -64
- package/components/facets/triad/gear-triad/GearTriadCallout.vue +58 -53
- package/components/facets/triad/gear-triad/GearTriadCenter.vue +9 -4
- package/components/facets/triad/gear-triad/GearTriadContent.vue +21 -36
- package/components/facets/triad/gear-triad/GearTriadDetail.vue +92 -0
- package/components/facets/triad/gear-triad/GearTriadDetails.vue +169 -0
- package/components/facets/triad/gear-triad/GearTriadDetailsContent.vue +18 -0
- package/components/facets/triad/gear-triad/GearTriadDetailsHeading.vue +60 -0
- package/components/facets/triad/gear-triad/GearTriadHeading.vue +19 -13
- package/components/facets/triad/gear-triad/GearTriadIcon.vue +22 -9
- package/components/facets/triad/gear-triad/style.css +26 -0
- package/components/facets/triad/{hex-triad/HexTriad.vue → hexagon-triad/HexagonTriad.vue} +81 -63
- package/components/facets/triad/{hex-triad/HexTriadBadge.vue → hexagon-triad/HexagonTriadBadge.vue} +38 -12
- package/components/facets/triad/{hex-triad/HexTriadCallout.vue → hexagon-triad/HexagonTriadCallout.vue} +35 -31
- package/components/facets/triad/hexagon-triad/HexagonTriadCenterBadge.vue +74 -0
- package/components/facets/triad/hexagon-triad/HexagonTriadContent.vue +34 -0
- package/components/facets/triad/hexagon-triad/HexagonTriadHeading.vue +44 -0
- package/components/facets/triad/{hex-triad/HexTriadLayer.vue → hexagon-triad/HexagonTriadLayer.vue} +12 -4
- package/components/facets/triad/hexagon-triad/style.css +22 -0
- package/components/process/arc-arrow-process/ArcArrowProcess.vue +13 -35
- package/components/process/arc-arrow-process/ArcArrowProcessArrow.vue +20 -21
- package/components/process/arc-arrow-process/ArcArrowProcessCallout.vue +30 -71
- package/components/process/arc-arrow-process/ArcArrowProcessContent.vue +18 -13
- package/components/process/arc-arrow-process/ArcArrowProcessHeading.vue +18 -18
- package/components/process/arc-arrow-process/ArcArrowProcessIcon.vue +23 -11
- package/components/process/arc-arrow-process/style.css +20 -0
- package/components/pyramid/circular-pyramid/CircularPyramid.vue +269 -170
- package/components/pyramid/circular-pyramid/CircularPyramidStack.vue +70 -52
- package/components/pyramid/circular-pyramid/CircularPyramidStackContent.vue +47 -37
- package/components/pyramid/circular-pyramid/{CircularPyramidStackTitle.vue → CircularPyramidStackHeading.vue} +49 -45
- package/components/pyramid/circular-pyramid/style.css +26 -0
- package/components/pyramid/square-pyramid/SquarePyramid.vue +191 -62
- package/components/pyramid/square-pyramid/SquarePyramidStack.vue +74 -49
- package/components/pyramid/square-pyramid/SquarePyramidStackContent.vue +47 -33
- package/components/pyramid/square-pyramid/{SquarePyramidStackTitle.vue → SquarePyramidStackHeading.vue} +49 -41
- package/components/pyramid/square-pyramid/style.css +48 -0
- package/components/style.css +35 -0
- package/layouts/core/arc-toc.vue +40 -45
- package/layouts/core/bg-center.vue +7 -6
- package/layouts/core/style.css +17 -0
- package/layouts/shifting-heading/shifting-intro.vue +4 -13
- package/layouts/thanks/thanks.vue +5 -5
- package/package.json +8 -6
- package/style.css +17 -0
- package/uno.config.ts +1 -0
- package/utils/activateOnKeyboard.ts +14 -0
- package/utils/{chevronCard → card/chevron-card}/context.ts +1 -1
- package/utils/card/chevron-card/index.ts +1 -0
- package/utils/card/horizontal-card/context.ts +12 -0
- package/utils/{horizCard/createHorizCardGeometry.ts → card/horizontal-card/createHorizontalCardGeometry.ts} +10 -45
- package/utils/card/horizontal-card/index.ts +2 -0
- package/utils/card/vertical-card/context.ts +19 -0
- package/utils/{vertCard/createVertCardGeometry.ts → card/vertical-card/createVerticalCardGeometry.ts} +9 -130
- package/utils/card/vertical-card/index.ts +2 -0
- package/utils/colors.ts +93 -0
- package/utils/{arcComparison → comparisons/arc-comparison}/context.ts +0 -11
- package/utils/{arcComparison → comparisons/arc-comparison}/createArcComparisonGeometry.ts +1 -1
- package/utils/comparisons/arc-comparison/resolveArcComparisonItems.ts +33 -0
- package/utils/comparisons/table-comparison/constants.ts +47 -0
- package/utils/{tableComparison → comparisons/table-comparison}/context.ts +2 -2
- package/utils/{arcOrbit → core/arc-orbit}/resolveArcOrbitItems.ts +11 -15
- package/utils/{defenseInDepth/arcDid → defense-in-depth/arc-defense-in-depth}/context.ts +34 -31
- package/utils/{defenseInDepth/arcDid/createArcDiDGeometry.ts → defense-in-depth/arc-defense-in-depth/createArcDefenseInDepthGeometry.ts} +69 -39
- package/utils/{defenseInDepth/arcDid → defense-in-depth/arc-defense-in-depth}/types.ts +39 -35
- package/utils/defense-in-depth/shared/colors.ts +51 -0
- package/utils/defense-in-depth/shared/constants.ts +22 -0
- package/utils/{defenseInDepth → defense-in-depth}/shared/types.ts +0 -5
- package/utils/facets/tetrad/rectangle-orbit-tetrad/context.ts +31 -0
- package/utils/{rectOrbitTetrad/createRectOrbitTetradGeometry.ts → facets/tetrad/rectangle-orbit-tetrad/createRectangleOrbitTetradGeometry.ts} +5 -104
- package/utils/facets/tetrad/rectangle-orbit-tetrad/index.ts +3 -0
- package/utils/{rectOrbitTetrad/resolveRectOrbitTetradItems.ts → facets/tetrad/rectangle-orbit-tetrad/resolveRectangleOrbitTetradItems.ts} +41 -49
- package/utils/{arrowTriad → facets/triad/arrow-triad}/resolveArrowTriadItems.ts +27 -28
- package/utils/{gearTriad → facets/triad/gear-triad}/context.ts +5 -5
- package/utils/{gearTriad → facets/triad/gear-triad}/createGearTriadGeometry.ts +2 -0
- package/utils/{gearTriad → facets/triad/gear-triad}/resolveGearTriadItems.ts +23 -24
- package/utils/facets/triad/hexagon-triad/context.ts +25 -0
- package/utils/{hexTriad/createHexTriadGeometry.ts → facets/triad/hexagon-triad/createHexagonTriadGeometry.ts} +11 -27
- package/utils/facets/triad/hexagon-triad/index.ts +3 -0
- package/utils/facets/triad/hexagon-triad/resolveHexagonTriadItems.ts +60 -0
- package/utils/{shiftingHeading → layouts/shifting-heading}/collectShiftingIntroNodes.ts +1 -0
- package/utils/layouts/table-of-contents/calculateTocCenterAlignmentOffset.ts +17 -0
- package/utils/{tableOfContents → layouts/table-of-contents}/calculateTocMarkerPositions.ts +0 -12
- package/utils/{tableOfContents → layouts/table-of-contents}/createTocConnectorPath.ts +11 -5
- package/utils/{mergeUno → merge-uno}/classifyVisual.ts +1 -1
- package/utils/{mergeUno → merge-uno}/collectClassNames.ts +9 -3
- package/utils/process/arc-arrow-process/resolveArcArrowProcessItems.ts +180 -0
- package/utils/pyramid/circular-pyramid/context.ts +1 -4
- package/utils/pyramid/circular-pyramid/createCircularPyramidGeometry.ts +6 -10
- package/utils/pyramid/shared/colors.ts +33 -83
- package/utils/pyramid/shared/constants.ts +2 -2
- package/utils/pyramid/shared/types.ts +0 -5
- package/utils/pyramid/square-pyramid/context.ts +1 -4
- package/utils/pyramid/square-pyramid/createSquarePyramidGeometry.ts +6 -10
- package/utils/useDiagramAutoScale.ts +8 -6
- package/utils/useMergedUnoAttrs.ts +9 -5
- package/components/card/chevron-card/ChevronCardHeading.vue +0 -39
- package/components/card/horiz-card/HorizCardHeading.vue +0 -47
- package/components/card/vert-card/VertCardHeading.vue +0 -68
- package/components/card/vert-card/VertCardTitle.vue +0 -76
- package/components/comparisons/arc-comparison/ArcComparisonContents.vue +0 -17
- package/components/comparisons/arc-comparison/ArcComparisonTitle.vue +0 -29
- package/components/core/arc-orbit/ArcOrbitContents.vue +0 -18
- package/components/core/arc-orbit/ArcOrbitTitle.vue +0 -50
- package/components/defense-in-depth/arc-did/ArcDiDLayer.vue +0 -321
- package/components/defense-in-depth/arc-did/ArcDiDLayerParts.vue +0 -11
- package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradCenter.vue +0 -53
- package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradContent.vue +0 -39
- package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradHeading.vue +0 -44
- package/components/facets/triad/gear-triad/GearTriadContents.vue +0 -111
- package/components/facets/triad/gear-triad/GearTriadDescription.vue +0 -38
- package/components/facets/triad/hex-triad/HexTriadCenterBadge.vue +0 -51
- package/components/facets/triad/hex-triad/HexTriadContent.vue +0 -20
- package/components/facets/triad/hex-triad/HexTriadHeading.vue +0 -28
- package/layouts/core/table-of-contents.vue +0 -30
- package/utils/arcArrowProcess/resolveArcArrowProcessItems.ts +0 -189
- package/utils/arcComparison/resolveArcComparisonItems.ts +0 -102
- package/utils/chevronCard/createChevronCardGeometry.ts +0 -48
- package/utils/chevronCard/index.ts +0 -2
- package/utils/defenseInDepth/arcDid/index.ts +0 -3
- package/utils/defenseInDepth/index.ts +0 -2
- package/utils/defenseInDepth/shared/colors.ts +0 -121
- package/utils/defenseInDepth/shared/constants.ts +0 -14
- package/utils/defenseInDepth/shared/index.ts +0 -3
- package/utils/hexTriad/context.ts +0 -25
- package/utils/hexTriad/index.ts +0 -3
- package/utils/hexTriad/resolveHexTriadItems.ts +0 -63
- package/utils/horizCard/context.ts +0 -13
- package/utils/horizCard/index.ts +0 -2
- package/utils/pyramid/index.ts +0 -3
- package/utils/rectOrbitTetrad/context.ts +0 -31
- package/utils/rectOrbitTetrad/index.ts +0 -3
- package/utils/tableComparison/constants.ts +0 -72
- package/utils/tableOfContents/calculateTocCenterAlignmentOffset.ts +0 -11
- package/utils/vertCard/context.ts +0 -18
- package/utils/vertCard/index.ts +0 -2
- package/utils/{arcComparison → comparisons/arc-comparison}/index.ts +0 -0
- package/utils/{tableComparison → comparisons/table-comparison}/index.ts +0 -0
- package/utils/{arcOrbit → core/arc-orbit}/context.ts +0 -0
- package/utils/{arcOrbit → core/arc-orbit}/createArcOrbitGeometry.ts +0 -0
- package/utils/{arcOrbit → core/arc-orbit}/index.ts +0 -0
- package/utils/{arrowTriad → facets/triad/arrow-triad}/context.ts +0 -0
- package/utils/{arrowTriad → facets/triad/arrow-triad}/createArrowTriadGeometry.ts +0 -0
- package/utils/{arrowTriad → facets/triad/arrow-triad}/index.ts +0 -0
- package/utils/{gearTriad → facets/triad/gear-triad}/index.ts +0 -0
- package/utils/{tableOfContents → layouts/table-of-contents}/calculateUniformTocArticleWidth.ts +0 -0
- package/utils/{tableOfContents → layouts/table-of-contents}/createTocArcPath.ts +0 -0
- package/utils/{tableOfContents → layouts/table-of-contents}/index.ts +0 -0
- package/utils/{mergeUno → merge-uno}/classifyLayout.ts +0 -0
- package/utils/{mergeUno → merge-uno}/classifySimple.ts +0 -0
- package/utils/{mergeUno → merge-uno}/classifyTypography.ts +0 -0
- package/utils/{mergeUno → merge-uno}/classifyUtility.ts +0 -0
- package/utils/{mergeUno → merge-uno}/index.ts +0 -0
- package/utils/{mergeUno → merge-uno}/mergeClassValues.ts +0 -0
- package/utils/{mergeUno → merge-uno}/splitVariantScope.ts +1 -1
- package/utils/{mergeUno → merge-uno}/types.ts +0 -0
- package/utils/{arcArrowProcess → process/arc-arrow-process}/context.ts +1 -1
- /package/utils/{arcArrowProcess → process/arc-arrow-process}/createArcArrowProcessGeometry.ts +0 -0
- /package/utils/{arcArrowProcess → process/arc-arrow-process}/index.ts +0 -0
|
@@ -1,37 +1,20 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface IHexagonTriadPoint {
|
|
2
2
|
readonly x: number;
|
|
3
3
|
readonly y: number;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface IHexagonTriadCoordinates {
|
|
7
7
|
readonly centerX: number;
|
|
8
8
|
readonly centerY: number;
|
|
9
9
|
readonly hexRadius: number;
|
|
10
10
|
readonly triadRadius: number;
|
|
11
11
|
readonly badgeRadius: number;
|
|
12
|
-
readonly hex1:
|
|
13
|
-
readonly hex2:
|
|
14
|
-
readonly hex3:
|
|
15
|
-
readonly badge1:
|
|
16
|
-
readonly badge2:
|
|
17
|
-
readonly badge3:
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Creates pointy-topped hexagon SVG points with sharp vertices
|
|
22
|
-
*/
|
|
23
|
-
export function createHexagonPoints(cx: number, cy: number, r: number): string {
|
|
24
|
-
const angles = [-90, -30, 30, 90, 150, 210];
|
|
25
|
-
|
|
26
|
-
return angles
|
|
27
|
-
.map((deg) => {
|
|
28
|
-
const rad = (deg * Math.PI) / 180;
|
|
29
|
-
const x = (cx + r * Math.cos(rad)).toFixed(1);
|
|
30
|
-
const y = (cy + r * Math.sin(rad)).toFixed(1);
|
|
31
|
-
|
|
32
|
-
return `${x},${y}`;
|
|
33
|
-
})
|
|
34
|
-
.join(' ');
|
|
12
|
+
readonly hex1: IHexagonTriadPoint;
|
|
13
|
+
readonly hex2: IHexagonTriadPoint;
|
|
14
|
+
readonly hex3: IHexagonTriadPoint;
|
|
15
|
+
readonly badge1: IHexagonTriadPoint;
|
|
16
|
+
readonly badge2: IHexagonTriadPoint;
|
|
17
|
+
readonly badge3: IHexagonTriadPoint;
|
|
35
18
|
}
|
|
36
19
|
|
|
37
20
|
/**
|
|
@@ -46,6 +29,7 @@ export function createRoundedHexagonPath(
|
|
|
46
29
|
const angles = [-90, -30, 30, 90, 150, 210];
|
|
47
30
|
const vertices = angles.map((deg) => {
|
|
48
31
|
const rad = (deg * Math.PI) / 180;
|
|
32
|
+
|
|
49
33
|
return {
|
|
50
34
|
x: cx + r * Math.cos(rad),
|
|
51
35
|
y: cy + r * Math.sin(rad),
|
|
@@ -108,14 +92,14 @@ export function createRoundedHexagonPath(
|
|
|
108
92
|
return commands.join(' ');
|
|
109
93
|
}
|
|
110
94
|
|
|
111
|
-
export function
|
|
95
|
+
export function calculateHexagonTriadCoordinates(
|
|
112
96
|
centerX = 270,
|
|
113
97
|
centerY = 224,
|
|
114
98
|
triadRadius = 66,
|
|
115
99
|
hexRadius = 114,
|
|
116
100
|
badgeRadius = 28,
|
|
117
101
|
horizontalSpread = 28,
|
|
118
|
-
):
|
|
102
|
+
): IHexagonTriadCoordinates {
|
|
119
103
|
const angleRad30 = (30 * Math.PI) / 180;
|
|
120
104
|
|
|
121
105
|
const hex2X = Number(
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface IHexagonTriadItem {
|
|
2
|
+
readonly id?: string | number;
|
|
3
|
+
readonly title: string;
|
|
4
|
+
readonly description?: string;
|
|
5
|
+
readonly color?: string;
|
|
6
|
+
readonly depthColor?: string;
|
|
7
|
+
readonly lightColor?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const DEFAULT_HEX_TRIAD_ITEMS: readonly [
|
|
11
|
+
IHexagonTriadItem,
|
|
12
|
+
IHexagonTriadItem,
|
|
13
|
+
IHexagonTriadItem,
|
|
14
|
+
] = [
|
|
15
|
+
{
|
|
16
|
+
id: '01',
|
|
17
|
+
title: '',
|
|
18
|
+
description: '',
|
|
19
|
+
color: 'var(--alpha-hexagon-triad-item-1-color)',
|
|
20
|
+
depthColor: 'var(--alpha-hexagon-triad-item-1-depth)',
|
|
21
|
+
lightColor: 'var(--alpha-hexagon-triad-item-1-light)',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: '02',
|
|
25
|
+
title: '',
|
|
26
|
+
description: '',
|
|
27
|
+
color: 'var(--alpha-hexagon-triad-item-2-color)',
|
|
28
|
+
depthColor: 'var(--alpha-hexagon-triad-item-2-depth)',
|
|
29
|
+
lightColor: 'var(--alpha-hexagon-triad-item-2-light)',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: '03',
|
|
33
|
+
title: '',
|
|
34
|
+
description: '',
|
|
35
|
+
color: 'var(--alpha-hexagon-triad-item-3-color)',
|
|
36
|
+
depthColor: 'var(--alpha-hexagon-triad-item-3-depth)',
|
|
37
|
+
lightColor: 'var(--alpha-hexagon-triad-item-3-light)',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
export function resolveHexagonTriadItems(
|
|
42
|
+
userItems?: readonly IHexagonTriadItem[],
|
|
43
|
+
): readonly [IHexagonTriadItem, IHexagonTriadItem, IHexagonTriadItem] {
|
|
44
|
+
const items = userItems ?? [];
|
|
45
|
+
|
|
46
|
+
return [
|
|
47
|
+
{
|
|
48
|
+
...DEFAULT_HEX_TRIAD_ITEMS[0],
|
|
49
|
+
...(items[0] ?? {}),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
...DEFAULT_HEX_TRIAD_ITEMS[1],
|
|
53
|
+
...(items[1] ?? {}),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
...DEFAULT_HEX_TRIAD_ITEMS[2],
|
|
57
|
+
...(items[2] ?? {}),
|
|
58
|
+
},
|
|
59
|
+
] as const;
|
|
60
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ICalculateTocCenterAlignmentOffsetPxParams {
|
|
2
|
+
readonly markerCenterY: number;
|
|
3
|
+
readonly articleCenterY: number;
|
|
4
|
+
readonly scaleY: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function calculateTocCenterAlignmentOffsetPx({
|
|
8
|
+
markerCenterY,
|
|
9
|
+
articleCenterY,
|
|
10
|
+
scaleY,
|
|
11
|
+
}: ICalculateTocCenterAlignmentOffsetPxParams): number {
|
|
12
|
+
if (scaleY <= 0) {
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return (markerCenterY - articleCenterY) / scaleY;
|
|
17
|
+
}
|
|
@@ -64,18 +64,6 @@ export function calculateTocItemCount({
|
|
|
64
64
|
return Math.min(normalizedAvailableCount, normalizedMaximumCount);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
export function calculateTocMarkerCenterPercent(count: number): number {
|
|
68
|
-
const positions = calculateTocMarkerPositions(count);
|
|
69
|
-
const firstPosition = positions[0];
|
|
70
|
-
const lastPosition = positions.at(-1);
|
|
71
|
-
|
|
72
|
-
if (!firstPosition || !lastPosition) {
|
|
73
|
-
return 50;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return (firstPosition.topPercent + lastPosition.topPercent) / 2;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
67
|
export function calculateTocMiddleMarkerOffsetPx(count: number): number {
|
|
80
68
|
const positions = calculateTocMarkerPositions(count);
|
|
81
69
|
const middlePosition = positions[Math.floor((positions.length - 1) / 2)];
|
|
@@ -20,11 +20,17 @@ export function calculateTocConnectorEndX({
|
|
|
20
20
|
return articleLeftX + CONNECTOR_ARTICLE_OVERLAP_PX;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
end: ITocConnectorPoint
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
export interface ICreateTocConnectorPathParams {
|
|
24
|
+
readonly isMiddle: boolean;
|
|
25
|
+
readonly end: ITocConnectorPoint;
|
|
26
|
+
readonly start: ITocConnectorPoint;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function createTocConnectorPath({
|
|
30
|
+
end,
|
|
31
|
+
start,
|
|
32
|
+
isMiddle,
|
|
33
|
+
}: ICreateTocConnectorPathParams): string {
|
|
28
34
|
const startX = formatCoordinate(start.x);
|
|
29
35
|
const startY = formatCoordinate(start.y);
|
|
30
36
|
const endX = formatCoordinate(end.x);
|
|
@@ -97,7 +97,7 @@ function classifyBackground(utility: string): string[] {
|
|
|
97
97
|
return ['background-position'];
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
if (/^bg-(?:gradient|image|url)-/.test(utility)) {
|
|
100
|
+
if (/^bg-(?:gradient|linear|image|url)-/.test(utility)) {
|
|
101
101
|
return ['background-image'];
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -17,12 +17,14 @@ function splitClassNames(value: string): string[] {
|
|
|
17
17
|
if (escaped) {
|
|
18
18
|
current += character;
|
|
19
19
|
escaped = false;
|
|
20
|
+
|
|
20
21
|
continue;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
if (character === '\\') {
|
|
24
25
|
current += character;
|
|
25
26
|
escaped = true;
|
|
27
|
+
|
|
26
28
|
continue;
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -39,6 +41,7 @@ function splitClassNames(value: string): string[] {
|
|
|
39
41
|
if (character === '"' || character === "'") {
|
|
40
42
|
current += character;
|
|
41
43
|
quote = character;
|
|
44
|
+
|
|
42
45
|
continue;
|
|
43
46
|
}
|
|
44
47
|
|
|
@@ -99,9 +102,10 @@ function expandVariantGroup(token: string): string[] {
|
|
|
99
102
|
) {
|
|
100
103
|
const prefix = token.slice(0, index + 1);
|
|
101
104
|
const contents = token.slice(index + 2, -1);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
|
|
106
|
+
return splitClassNames(contents).flatMap((child) => {
|
|
107
|
+
return expandVariantGroup(`${prefix}${child}`);
|
|
108
|
+
});
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
|
|
@@ -117,6 +121,7 @@ function collectClassName(value: TUnoClassValue, result: string[]): void {
|
|
|
117
121
|
for (const token of splitClassNames(String(value))) {
|
|
118
122
|
result.push(...expandVariantGroup(token));
|
|
119
123
|
}
|
|
124
|
+
|
|
120
125
|
return;
|
|
121
126
|
}
|
|
122
127
|
|
|
@@ -124,6 +129,7 @@ function collectClassName(value: TUnoClassValue, result: string[]): void {
|
|
|
124
129
|
for (const item of value) {
|
|
125
130
|
collectClassName(item, result);
|
|
126
131
|
}
|
|
132
|
+
|
|
127
133
|
return;
|
|
128
134
|
}
|
|
129
135
|
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export interface IArcArrowProcessItem {
|
|
2
|
+
readonly id?: string | number;
|
|
3
|
+
readonly color?: string;
|
|
4
|
+
readonly gradientEnd?: string;
|
|
5
|
+
readonly title?: string;
|
|
6
|
+
readonly description?: string;
|
|
7
|
+
readonly icon?: string | object | false;
|
|
8
|
+
readonly titleColor?: string;
|
|
9
|
+
readonly textColor?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IResolvedArcArrowProcessItem {
|
|
13
|
+
readonly id: string | number;
|
|
14
|
+
readonly color: string;
|
|
15
|
+
readonly gradientEnd: string;
|
|
16
|
+
readonly title: string;
|
|
17
|
+
readonly description: string;
|
|
18
|
+
readonly icon?: string | object | false;
|
|
19
|
+
readonly titleColor: string;
|
|
20
|
+
readonly textColor: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const DEFAULT_ARC_ARROW_PROCESS_ITEMS_4: readonly [
|
|
24
|
+
IResolvedArcArrowProcessItem,
|
|
25
|
+
IResolvedArcArrowProcessItem,
|
|
26
|
+
IResolvedArcArrowProcessItem,
|
|
27
|
+
IResolvedArcArrowProcessItem,
|
|
28
|
+
] = [
|
|
29
|
+
{
|
|
30
|
+
id: '01',
|
|
31
|
+
color: 'var(--alpha-arc-arrow-process-item-1-color)',
|
|
32
|
+
gradientEnd: 'var(--alpha-arc-arrow-process-item-1-gradient-end)',
|
|
33
|
+
title: '',
|
|
34
|
+
description: '',
|
|
35
|
+
titleColor: 'var(--alpha-arc-arrow-process-heading)',
|
|
36
|
+
textColor: 'var(--alpha-arc-arrow-process-content)',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: '02',
|
|
40
|
+
color: 'var(--alpha-arc-arrow-process-item-2-color)',
|
|
41
|
+
gradientEnd: 'var(--alpha-arc-arrow-process-item-2-gradient-end)',
|
|
42
|
+
title: '',
|
|
43
|
+
description: '',
|
|
44
|
+
titleColor: 'var(--alpha-arc-arrow-process-heading)',
|
|
45
|
+
textColor: 'var(--alpha-arc-arrow-process-content)',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: '03',
|
|
49
|
+
color: 'var(--alpha-arc-arrow-process-item-3-color)',
|
|
50
|
+
gradientEnd: 'var(--alpha-arc-arrow-process-item-3-gradient-end)',
|
|
51
|
+
title: '',
|
|
52
|
+
description: '',
|
|
53
|
+
titleColor: 'var(--alpha-arc-arrow-process-heading)',
|
|
54
|
+
textColor: 'var(--alpha-arc-arrow-process-content)',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: '04',
|
|
58
|
+
color: 'var(--alpha-arc-arrow-process-item-4-color)',
|
|
59
|
+
gradientEnd: 'var(--alpha-arc-arrow-process-item-4-gradient-end)',
|
|
60
|
+
title: '',
|
|
61
|
+
description: '',
|
|
62
|
+
titleColor: 'var(--alpha-arc-arrow-process-heading)',
|
|
63
|
+
textColor: 'var(--alpha-arc-arrow-process-content)',
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
const DEFAULT_ARC_ARROW_PROCESS_ITEMS_3: readonly [
|
|
68
|
+
IResolvedArcArrowProcessItem,
|
|
69
|
+
IResolvedArcArrowProcessItem,
|
|
70
|
+
IResolvedArcArrowProcessItem,
|
|
71
|
+
] = [
|
|
72
|
+
{
|
|
73
|
+
id: '01',
|
|
74
|
+
color: 'var(--alpha-arc-arrow-process-item-1-color)',
|
|
75
|
+
gradientEnd: 'var(--alpha-arc-arrow-process-item-1-gradient-end)',
|
|
76
|
+
title: '',
|
|
77
|
+
description: '',
|
|
78
|
+
titleColor: 'var(--alpha-arc-arrow-process-heading)',
|
|
79
|
+
textColor: 'var(--alpha-arc-arrow-process-content)',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: '02',
|
|
83
|
+
color: 'var(--alpha-arc-arrow-process-item-2-color)',
|
|
84
|
+
gradientEnd: 'var(--alpha-arc-arrow-process-item-2-gradient-end)',
|
|
85
|
+
title: '',
|
|
86
|
+
description: '',
|
|
87
|
+
titleColor: 'var(--alpha-arc-arrow-process-heading)',
|
|
88
|
+
textColor: 'var(--alpha-arc-arrow-process-content)',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: '03',
|
|
92
|
+
color: 'var(--alpha-arc-arrow-process-item-4-color)',
|
|
93
|
+
gradientEnd: 'var(--alpha-arc-arrow-process-item-4-gradient-end)',
|
|
94
|
+
title: '',
|
|
95
|
+
description: '',
|
|
96
|
+
titleColor: 'var(--alpha-arc-arrow-process-heading)',
|
|
97
|
+
textColor: 'var(--alpha-arc-arrow-process-content)',
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
const DEFAULT_ARC_ARROW_PROCESS_ITEMS_2: readonly [
|
|
102
|
+
IResolvedArcArrowProcessItem,
|
|
103
|
+
IResolvedArcArrowProcessItem,
|
|
104
|
+
] = [
|
|
105
|
+
{
|
|
106
|
+
id: '01',
|
|
107
|
+
color: 'var(--alpha-arc-arrow-process-item-2-color)',
|
|
108
|
+
gradientEnd: 'var(--alpha-arc-arrow-process-item-2-gradient-end)',
|
|
109
|
+
title: '',
|
|
110
|
+
description: '',
|
|
111
|
+
titleColor: 'var(--alpha-arc-arrow-process-heading)',
|
|
112
|
+
textColor: 'var(--alpha-arc-arrow-process-content)',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: '02',
|
|
116
|
+
color: 'var(--alpha-arc-arrow-process-item-3-color)',
|
|
117
|
+
gradientEnd: 'var(--alpha-arc-arrow-process-item-3-gradient-end)',
|
|
118
|
+
title: '',
|
|
119
|
+
description: '',
|
|
120
|
+
titleColor: 'var(--alpha-arc-arrow-process-heading)',
|
|
121
|
+
textColor: 'var(--alpha-arc-arrow-process-content)',
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
export function getDefaultArcArrowProcessItem(
|
|
126
|
+
index: number,
|
|
127
|
+
count: number = 4,
|
|
128
|
+
): IResolvedArcArrowProcessItem {
|
|
129
|
+
const list =
|
|
130
|
+
count === 2
|
|
131
|
+
? DEFAULT_ARC_ARROW_PROCESS_ITEMS_2
|
|
132
|
+
: count === 3
|
|
133
|
+
? DEFAULT_ARC_ARROW_PROCESS_ITEMS_3
|
|
134
|
+
: DEFAULT_ARC_ARROW_PROCESS_ITEMS_4;
|
|
135
|
+
const safe = Math.abs(index) % list.length;
|
|
136
|
+
const item = list[safe];
|
|
137
|
+
|
|
138
|
+
if (item) {
|
|
139
|
+
return item;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return DEFAULT_ARC_ARROW_PROCESS_ITEMS_4[0];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function resolveSingleArcArrowProcessItem(
|
|
146
|
+
item: IArcArrowProcessItem | undefined,
|
|
147
|
+
fallbackIndex = 0,
|
|
148
|
+
count: number = 4,
|
|
149
|
+
): IResolvedArcArrowProcessItem {
|
|
150
|
+
const fallback = getDefaultArcArrowProcessItem(fallbackIndex, count);
|
|
151
|
+
|
|
152
|
+
if (!item) {
|
|
153
|
+
return fallback;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
id: item.id ?? fallback.id,
|
|
158
|
+
color: item.color ?? fallback.color,
|
|
159
|
+
gradientEnd: item.gradientEnd ?? fallback.gradientEnd,
|
|
160
|
+
title: item.title ?? fallback.title,
|
|
161
|
+
description: item.description ?? fallback.description,
|
|
162
|
+
icon: item.icon !== undefined ? item.icon : fallback.icon,
|
|
163
|
+
titleColor: item.titleColor ?? fallback.titleColor,
|
|
164
|
+
textColor: item.textColor ?? fallback.textColor,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function resolveArcArrowProcessItems(
|
|
169
|
+
items: readonly IArcArrowProcessItem[] | undefined,
|
|
170
|
+
count: number = 4,
|
|
171
|
+
): readonly IResolvedArcArrowProcessItem[] {
|
|
172
|
+
const targetCount = count >= 2 ? count : 4;
|
|
173
|
+
const result: IResolvedArcArrowProcessItem[] = [];
|
|
174
|
+
|
|
175
|
+
for (let i = 0; i < targetCount; i++) {
|
|
176
|
+
result.push(resolveSingleArcArrowProcessItem(items?.[i], i, targetCount));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { ComputedRef, InjectionKey, Ref } from 'vue';
|
|
2
2
|
|
|
3
|
-
import type { IPyramidPalette
|
|
3
|
+
import type { IPyramidPalette } from '../shared';
|
|
4
4
|
import type { ICircularLayerGeometry, ICircularPyramidGeometry } from './types';
|
|
5
5
|
|
|
6
|
-
export interface ICircularPyramidRegistration extends IPyramidRegistration {}
|
|
7
|
-
|
|
8
6
|
export interface ICircularPyramidRootContext {
|
|
9
7
|
readonly count: ComputedRef<number>;
|
|
10
8
|
readonly activeIndex: Ref<number> | ComputedRef<number>;
|
|
@@ -15,7 +13,6 @@ export interface ICircularPyramidRootContext {
|
|
|
15
13
|
readonly interactive: ComputedRef<boolean>;
|
|
16
14
|
readonly titleWidthPx: ComputedRef<number>;
|
|
17
15
|
readonly contentWidthPx: ComputedRef<number>;
|
|
18
|
-
readonly contentRightOffsetPx: ComputedRef<number>;
|
|
19
16
|
readonly registerStack: (
|
|
20
17
|
id?: symbol,
|
|
21
18
|
color?: ComputedRef<string | undefined>,
|
|
@@ -2,8 +2,6 @@ import {
|
|
|
2
2
|
clampPyramidCount,
|
|
3
3
|
computePyramidStacking,
|
|
4
4
|
DEFAULT_PYRAMID_COLOR,
|
|
5
|
-
darkenColor,
|
|
6
|
-
lightenColor,
|
|
7
5
|
MAX_PYRAMID_COUNT,
|
|
8
6
|
MIN_PYRAMID_COUNT,
|
|
9
7
|
resolvePyramidPalette,
|
|
@@ -17,19 +15,17 @@ import type {
|
|
|
17
15
|
|
|
18
16
|
export const DEFAULT_CIRCULAR_PYRAMID_COLOR = DEFAULT_PYRAMID_COLOR;
|
|
19
17
|
export const DEFAULT_CIRCULAR_PYRAMID_STACK_COLORS: readonly string[] = [
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
18
|
+
'var(--alpha-circular-pyramid-stack-1-color)',
|
|
19
|
+
'var(--alpha-circular-pyramid-stack-2-color)',
|
|
20
|
+
'var(--alpha-circular-pyramid-stack-3-color)',
|
|
21
|
+
'var(--alpha-circular-pyramid-stack-4-color)',
|
|
22
|
+
'var(--alpha-circular-pyramid-stack-5-color)',
|
|
23
|
+
'var(--alpha-circular-pyramid-stack-6-color)',
|
|
26
24
|
] as const;
|
|
27
25
|
|
|
28
26
|
export const MIN_CIRCULAR_COUNT = MIN_PYRAMID_COUNT;
|
|
29
27
|
export const MAX_CIRCULAR_COUNT = MAX_PYRAMID_COUNT;
|
|
30
28
|
|
|
31
|
-
export { darkenColor, lightenColor };
|
|
32
|
-
|
|
33
29
|
export function clampCircularCount(count?: number): number {
|
|
34
30
|
return clampPyramidCount(count);
|
|
35
31
|
}
|
|
@@ -1,92 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export function lightenColor({
|
|
5
|
-
hex,
|
|
6
|
-
ratio = 0.5,
|
|
7
|
-
}: IColorModifierParams): string {
|
|
8
|
-
const raw = hex.trim().replace(/^#/, '');
|
|
9
|
-
const sanitized =
|
|
10
|
-
raw.length === 3
|
|
11
|
-
? raw
|
|
12
|
-
.split('')
|
|
13
|
-
.map((char) => char + char)
|
|
14
|
-
.join('')
|
|
15
|
-
: raw;
|
|
16
|
-
|
|
17
|
-
if (sanitized.length !== 6) {
|
|
18
|
-
return hex;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const r = Number.parseInt(sanitized.slice(0, 2), 16);
|
|
22
|
-
const g = Number.parseInt(sanitized.slice(2, 4), 16);
|
|
23
|
-
const b = Number.parseInt(sanitized.slice(4, 6), 16);
|
|
24
|
-
|
|
25
|
-
if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
|
|
26
|
-
return hex;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const clamp = (val: number): number =>
|
|
30
|
-
Math.min(255, Math.max(0, Math.round(val)));
|
|
31
|
-
const lr = clamp(r + (255 - r) * ratio);
|
|
32
|
-
const lg = clamp(g + (255 - g) * ratio);
|
|
33
|
-
const lb = clamp(b + (255 - b) * ratio);
|
|
34
|
-
|
|
35
|
-
const toHex = (n: number): string => n.toString(16).padStart(2, '0');
|
|
36
|
-
|
|
37
|
-
return `#${toHex(lr)}${toHex(lg)}${toHex(lb)}`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function darkenColor({
|
|
41
|
-
hex,
|
|
42
|
-
ratio = 0.5,
|
|
43
|
-
}: IColorModifierParams): string {
|
|
44
|
-
const raw = hex.trim().replace(/^#/, '');
|
|
45
|
-
const sanitized =
|
|
46
|
-
raw.length === 3
|
|
47
|
-
? raw
|
|
48
|
-
.split('')
|
|
49
|
-
.map((char) => char + char)
|
|
50
|
-
.join('')
|
|
51
|
-
: raw;
|
|
52
|
-
|
|
53
|
-
if (sanitized.length !== 6) {
|
|
54
|
-
return hex;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const r = Number.parseInt(sanitized.slice(0, 2), 16);
|
|
58
|
-
const g = Number.parseInt(sanitized.slice(2, 4), 16);
|
|
59
|
-
const b = Number.parseInt(sanitized.slice(4, 6), 16);
|
|
60
|
-
|
|
61
|
-
if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
|
|
62
|
-
return hex;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const clamp = (val: number): number =>
|
|
66
|
-
Math.min(255, Math.max(0, Math.round(val)));
|
|
67
|
-
const dr = clamp(r * (1 - ratio));
|
|
68
|
-
const dg = clamp(g * (1 - ratio));
|
|
69
|
-
const db = clamp(b * (1 - ratio));
|
|
70
|
-
|
|
71
|
-
const toHex = (n: number): string => n.toString(16).padStart(2, '0');
|
|
72
|
-
|
|
73
|
-
return `#${toHex(dr)}${toHex(dg)}${toHex(db)}`;
|
|
74
|
-
}
|
|
1
|
+
import { darkenColor, lightenColor } from '../../colors';
|
|
2
|
+
import { DEFAULT_PYRAMID_COLOR, DEFAULT_PYRAMID_HIGHLIGHT } from './constants';
|
|
3
|
+
import type { IPyramidPalette } from './types';
|
|
75
4
|
|
|
76
5
|
export function resolvePyramidPalette(
|
|
77
6
|
baseColor: string = DEFAULT_PYRAMID_COLOR,
|
|
78
7
|
): IPyramidPalette {
|
|
79
8
|
return {
|
|
80
|
-
activeTopStart: lightenColor({
|
|
9
|
+
activeTopStart: lightenColor({
|
|
10
|
+
hex: baseColor,
|
|
11
|
+
ratio: 0.82,
|
|
12
|
+
}),
|
|
81
13
|
activeTopEnd: baseColor,
|
|
82
|
-
activeSideStart: darkenColor({
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
14
|
+
activeSideStart: darkenColor({
|
|
15
|
+
hex: baseColor,
|
|
16
|
+
ratio: 0.28,
|
|
17
|
+
}),
|
|
18
|
+
activeSideEnd: lightenColor({
|
|
19
|
+
hex: baseColor,
|
|
20
|
+
ratio: 0.35,
|
|
21
|
+
}),
|
|
22
|
+
activeStroke: lightenColor({
|
|
23
|
+
hex: baseColor,
|
|
24
|
+
ratio: 0.7,
|
|
25
|
+
}),
|
|
26
|
+
defaultTopStart: DEFAULT_PYRAMID_HIGHLIGHT,
|
|
27
|
+
defaultTopEnd: lightenColor({
|
|
28
|
+
hex: baseColor,
|
|
29
|
+
ratio: 0.88,
|
|
30
|
+
}),
|
|
31
|
+
defaultSideStart: lightenColor({
|
|
32
|
+
hex: baseColor,
|
|
33
|
+
ratio: 0.72,
|
|
34
|
+
}),
|
|
35
|
+
defaultSideEnd: lightenColor({
|
|
36
|
+
hex: baseColor,
|
|
37
|
+
ratio: 0.88,
|
|
38
|
+
}),
|
|
39
|
+
defaultStroke: DEFAULT_PYRAMID_HIGHLIGHT,
|
|
90
40
|
glow: baseColor,
|
|
91
41
|
};
|
|
92
42
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const DEFAULT_PYRAMID_COLOR = '
|
|
1
|
+
export const DEFAULT_PYRAMID_COLOR = 'var(--alpha-pyramid-accent)';
|
|
2
|
+
export const DEFAULT_PYRAMID_HIGHLIGHT = 'var(--alpha-pyramid-highlight)';
|
|
2
3
|
export const MIN_PYRAMID_COUNT = 1;
|
|
3
4
|
export const MAX_PYRAMID_COUNT = 6;
|
|
4
5
|
|
|
5
6
|
export const PYRAMID_TITLE_WIDTH_PX = 150;
|
|
6
7
|
export const PYRAMID_CONTENT_WIDTH_PX = 240;
|
|
7
|
-
export const PYRAMID_CONTENT_RIGHT_OFFSET_PX = 0;
|
|
8
8
|
export const PYRAMID_DOT_POSITION_X = 210;
|
|
9
9
|
export const PYRAMID_DOT_GAP_PX = 10;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { ComputedRef, InjectionKey, Ref } from 'vue';
|
|
2
2
|
|
|
3
|
-
import type { IPyramidPalette
|
|
3
|
+
import type { IPyramidPalette } from '../shared';
|
|
4
4
|
import type { ISquareLayerGeometry, ISquarePyramidGeometry } from './types';
|
|
5
5
|
|
|
6
|
-
export interface ISquarePyramidRegistration extends IPyramidRegistration {}
|
|
7
|
-
|
|
8
6
|
export interface ISquarePyramidRootContext {
|
|
9
7
|
readonly count: ComputedRef<number>;
|
|
10
8
|
readonly activeIndex: Ref<number> | ComputedRef<number>;
|
|
@@ -15,7 +13,6 @@ export interface ISquarePyramidRootContext {
|
|
|
15
13
|
readonly interactive: ComputedRef<boolean>;
|
|
16
14
|
readonly titleWidthPx: ComputedRef<number>;
|
|
17
15
|
readonly contentWidthPx: ComputedRef<number>;
|
|
18
|
-
readonly contentRightOffsetPx: ComputedRef<number>;
|
|
19
16
|
readonly registerStack: (
|
|
20
17
|
id?: symbol,
|
|
21
18
|
color?: ComputedRef<string | undefined>,
|