@alphacifer/slidev-addon-theme 0.0.8 → 0.0.10
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 +80 -0
- package/components/defense-in-depth/arc-did/ArcDiD.vue +732 -0
- package/components/defense-in-depth/arc-did/ArcDiDLayer.vue +321 -0
- package/components/defense-in-depth/arc-did/ArcDiDLayerPart.vue +449 -0
- package/components/defense-in-depth/arc-did/ArcDiDLayerParts.vue +11 -0
- package/components/defense-in-depth/arc-did/ArcDiDLayerSector.vue +148 -0
- package/components/defense-in-depth/arc-did/ArcDiDLayerTitle.vue +98 -0
- package/components/pyramid/circular-pyramid/CircularPyramid.vue +858 -0
- package/components/pyramid/circular-pyramid/CircularPyramidStack.vue +342 -0
- package/components/pyramid/circular-pyramid/CircularPyramidStackContent.vue +305 -0
- package/components/pyramid/circular-pyramid/CircularPyramidStackTitle.vue +208 -0
- package/components/pyramid/square-pyramid/SquarePyramid.vue +863 -0
- package/components/pyramid/square-pyramid/SquarePyramidStack.vue +333 -0
- package/components/pyramid/square-pyramid/SquarePyramidStackContent.vue +301 -0
- package/components/pyramid/square-pyramid/SquarePyramidStackTitle.vue +204 -0
- package/package.json +2 -1
- package/utils/defenseInDepth/arcDid/context.ts +110 -0
- package/utils/defenseInDepth/arcDid/createArcDiDGeometry.ts +570 -0
- package/utils/defenseInDepth/arcDid/index.ts +3 -0
- package/utils/defenseInDepth/arcDid/types.ts +140 -0
- package/utils/defenseInDepth/index.ts +2 -0
- package/utils/defenseInDepth/shared/colors.ts +121 -0
- package/utils/defenseInDepth/shared/constants.ts +14 -0
- package/utils/defenseInDepth/shared/index.ts +3 -0
- package/utils/defenseInDepth/shared/types.ts +12 -0
- package/utils/pyramid/circular-pyramid/context.ts +46 -0
- package/utils/pyramid/circular-pyramid/createCircularPyramidGeometry.ts +143 -0
- package/utils/pyramid/circular-pyramid/index.ts +3 -0
- package/utils/pyramid/circular-pyramid/types.ts +34 -0
- package/utils/pyramid/index.ts +3 -0
- package/utils/pyramid/shared/colors.ts +92 -0
- package/utils/pyramid/shared/connector.ts +111 -0
- package/utils/pyramid/shared/constants.ts +9 -0
- package/utils/pyramid/shared/index.ts +5 -0
- package/utils/pyramid/shared/stacking.ts +76 -0
- package/utils/pyramid/shared/types.ts +36 -0
- package/utils/pyramid/square-pyramid/context.ts +46 -0
- package/utils/pyramid/square-pyramid/createSquarePyramidGeometry.ts +265 -0
- package/utils/pyramid/square-pyramid/index.ts +3 -0
- package/utils/pyramid/square-pyramid/types.ts +39 -0
- package/utils/useDiagramAutoScale.ts +64 -20
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, inject } from 'vue';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
CIRCULAR_PYRAMID_ROOT_KEY,
|
|
6
|
+
CIRCULAR_PYRAMID_STACK_KEY,
|
|
7
|
+
} from '../../../utils/pyramid/circular-pyramid';
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: 'CircularPyramidStackTitle',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export interface ICircularPyramidStackTitleProps {
|
|
14
|
+
readonly step?: string | number;
|
|
15
|
+
readonly title?: string;
|
|
16
|
+
readonly color?: string;
|
|
17
|
+
readonly minWidth?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(defineProps<ICircularPyramidStackTitleProps>(), {
|
|
21
|
+
step: undefined,
|
|
22
|
+
title: undefined,
|
|
23
|
+
color: undefined,
|
|
24
|
+
minWidth: 150,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const rootContext = inject(CIRCULAR_PYRAMID_ROOT_KEY, undefined);
|
|
28
|
+
const stackContext = inject(CIRCULAR_PYRAMID_STACK_KEY, undefined);
|
|
29
|
+
|
|
30
|
+
const isActive = computed(() => {
|
|
31
|
+
return stackContext?.isActive.value ?? false;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const isAnimated = computed(() => {
|
|
35
|
+
return rootContext?.animation.value ?? false;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const stepIndex = computed(() => {
|
|
39
|
+
return stackContext?.index.value ?? 0;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const resolvedStep = computed(() => {
|
|
43
|
+
if (props.step !== undefined) {
|
|
44
|
+
return props.step;
|
|
45
|
+
}
|
|
46
|
+
if (stackContext?.step.value !== undefined) {
|
|
47
|
+
return stackContext.step.value;
|
|
48
|
+
}
|
|
49
|
+
return '01';
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const palette = computed(() => {
|
|
53
|
+
return rootContext?.palette.value;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const minPillWidth = computed(() => props.minWidth ?? 150);
|
|
57
|
+
|
|
58
|
+
const stackColor = computed(() => {
|
|
59
|
+
return (
|
|
60
|
+
props.color ??
|
|
61
|
+
stackContext?.color?.value ??
|
|
62
|
+
rootContext?.color.value ??
|
|
63
|
+
'#3b82f6'
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<div
|
|
70
|
+
class="alpha-circular-pyramid-stack-title relative w-full flex items-center select-none"
|
|
71
|
+
:class="[
|
|
72
|
+
isActive
|
|
73
|
+
? 'alpha-circular-pyramid-stack-title--active'
|
|
74
|
+
: 'alpha-circular-pyramid-stack-title--default',
|
|
75
|
+
]"
|
|
76
|
+
:style="{
|
|
77
|
+
'--title-delay': `calc(var(--circular-pyramid-start-delay, 0ms) + ${460 + stepIndex * 320}ms)`,
|
|
78
|
+
}"
|
|
79
|
+
>
|
|
80
|
+
<!-- Pill Badge Container (min-width: 150px, max-width: whole spacing left leaving at least 30px before dot) -->
|
|
81
|
+
<div
|
|
82
|
+
class="alpha-circular-pyramid-stack-title__pill flex items-center gap-2 px-2.5 py-1 rounded-full transition-all duration-300 border flex-shrink-0"
|
|
83
|
+
:class="{
|
|
84
|
+
'alpha-circular-pyramid-stack-title__pill--animated': isAnimated,
|
|
85
|
+
}"
|
|
86
|
+
:style="{
|
|
87
|
+
minWidth: `${minPillWidth}px`,
|
|
88
|
+
maxWidth: 'calc(100% - 30px)',
|
|
89
|
+
width: 'fit-content',
|
|
90
|
+
boxSizing: 'border-box',
|
|
91
|
+
borderColor: stackColor,
|
|
92
|
+
backgroundColor: isActive
|
|
93
|
+
? 'rgba(255, 255, 255, 0.95)'
|
|
94
|
+
: 'rgba(255, 255, 255, 0.85)',
|
|
95
|
+
boxShadow: isActive
|
|
96
|
+
? `0 4px 14px ${stackColor}26`
|
|
97
|
+
: 'none',
|
|
98
|
+
}"
|
|
99
|
+
>
|
|
100
|
+
<!-- Circular Step Indicator (Badge using stack color) -->
|
|
101
|
+
<div
|
|
102
|
+
class="w-5.5 h-5.5 rounded-full flex items-center justify-center text-[10px] font-bold tracking-tight transition-all duration-300 flex-shrink-0"
|
|
103
|
+
:style="{
|
|
104
|
+
backgroundColor: stackColor,
|
|
105
|
+
color: '#ffffff',
|
|
106
|
+
}"
|
|
107
|
+
>
|
|
108
|
+
<slot name="step">{{ resolvedStep }}</slot>
|
|
109
|
+
</div>
|
|
110
|
+
<!-- Title Text -->
|
|
111
|
+
<span
|
|
112
|
+
class="text-xs font-semibold tracking-tight transition-colors duration-300 pr-1 truncate flex-1 leading-tight"
|
|
113
|
+
:style="{
|
|
114
|
+
color: isActive ? '#0f172a' : '#334155',
|
|
115
|
+
}"
|
|
116
|
+
>
|
|
117
|
+
<slot>{{ props.title }}</slot>
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
<!-- Scalable Line between Title and Dot (always at least 30px) -->
|
|
121
|
+
<div
|
|
122
|
+
class="alpha-circular-pyramid-stack-title__connector flex-1 flex items-center min-w-[30px] pointer-events-none"
|
|
123
|
+
>
|
|
124
|
+
<div
|
|
125
|
+
class="alpha-circular-pyramid-stack-title__line flex-1 h-[1px] transition-colors duration-300"
|
|
126
|
+
:class="{
|
|
127
|
+
'alpha-circular-pyramid-stack-title__line--animated': isAnimated,
|
|
128
|
+
}"
|
|
129
|
+
:style="{
|
|
130
|
+
backgroundColor: stackColor,
|
|
131
|
+
opacity: isActive ? 1 : 0.65,
|
|
132
|
+
}"
|
|
133
|
+
/>
|
|
134
|
+
<div
|
|
135
|
+
class="alpha-circular-pyramid-stack-title__dot w-1.5 h-1.5 rounded-full flex-shrink-0 -ml-1 transition-all duration-300"
|
|
136
|
+
:class="{
|
|
137
|
+
'alpha-circular-pyramid-stack-title__dot--animated': isAnimated,
|
|
138
|
+
}"
|
|
139
|
+
:style="{
|
|
140
|
+
backgroundColor: stackColor,
|
|
141
|
+
boxShadow: isActive
|
|
142
|
+
? `0 0 6px ${stackColor}`
|
|
143
|
+
: `0 0 2px ${stackColor}80`,
|
|
144
|
+
}"
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</template>
|
|
149
|
+
|
|
150
|
+
<style scoped>
|
|
151
|
+
.alpha-circular-pyramid-stack-title {
|
|
152
|
+
box-sizing: border-box;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.alpha-circular-pyramid-stack-title--active .alpha-circular-pyramid-stack-title__pill {
|
|
156
|
+
backdrop-filter: blur(8px);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.alpha-circular-pyramid-stack-title__dot--animated {
|
|
160
|
+
animation: alpha-pyramid-title-dot-pop 120ms cubic-bezier(0.16, 1, 0.3, 1) var(--title-delay) both;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@keyframes alpha-pyramid-title-dot-pop {
|
|
164
|
+
0% {
|
|
165
|
+
opacity: 0;
|
|
166
|
+
transform: scale(0);
|
|
167
|
+
}
|
|
168
|
+
100% {
|
|
169
|
+
opacity: 1;
|
|
170
|
+
transform: scale(1);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.alpha-circular-pyramid-stack-title__line--animated {
|
|
175
|
+
transform-origin: right center;
|
|
176
|
+
animation: alpha-pyramid-title-line-draw 500ms cubic-bezier(0.4, 0, 0.2, 1) calc(var(--title-delay) + 120ms) both;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@keyframes alpha-pyramid-title-line-draw {
|
|
180
|
+
0% {
|
|
181
|
+
opacity: 0;
|
|
182
|
+
transform: scaleX(0);
|
|
183
|
+
}
|
|
184
|
+
2% {
|
|
185
|
+
opacity: 1;
|
|
186
|
+
transform: scaleX(0);
|
|
187
|
+
}
|
|
188
|
+
100% {
|
|
189
|
+
opacity: 1;
|
|
190
|
+
transform: scaleX(1);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.alpha-circular-pyramid-stack-title__pill--animated {
|
|
195
|
+
animation: alpha-pyramid-title-pill-in 240ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--title-delay) + 380ms) both;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@keyframes alpha-pyramid-title-pill-in {
|
|
199
|
+
0% {
|
|
200
|
+
opacity: 0;
|
|
201
|
+
transform: translateX(-10px);
|
|
202
|
+
}
|
|
203
|
+
100% {
|
|
204
|
+
opacity: 1;
|
|
205
|
+
transform: translateX(0);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
</style>
|