@troshab/slidev-theme-troshab 0.1.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.
Files changed (168) hide show
  1. package/CLAUDE.md +537 -0
  2. package/LICENSE +134 -0
  3. package/README.md +168 -0
  4. package/SKILL.md +414 -0
  5. package/components/AnimatedCounter.vue +35 -0
  6. package/components/Background.vue +204 -0
  7. package/components/Callout.vue +135 -0
  8. package/components/Card.vue +75 -0
  9. package/components/CardGrid.vue +67 -0
  10. package/components/CaseStudy.vue +66 -0
  11. package/components/CodeDiff.vue +229 -0
  12. package/components/CodeHighlight.vue +337 -0
  13. package/components/ColorSwatch.vue +114 -0
  14. package/components/Confetti.vue +292 -0
  15. package/components/Conversation.vue +405 -0
  16. package/components/Countdown.vue +476 -0
  17. package/components/Definition.vue +59 -0
  18. package/components/DeviceMockup.vue +392 -0
  19. package/components/Funnel.vue +87 -0
  20. package/components/Icon.vue +73 -0
  21. package/components/Iframe.vue +38 -0
  22. package/components/Image.vue +69 -0
  23. package/components/ImageCompare.vue +436 -0
  24. package/components/MatrixGrid.vue +85 -0
  25. package/components/MermaidChart.vue +299 -0
  26. package/components/Metric.vue +161 -0
  27. package/components/PersonCard.vue +165 -0
  28. package/components/PricingTable.vue +144 -0
  29. package/components/Progress.vue +100 -0
  30. package/components/Pyramid.vue +81 -0
  31. package/components/QRCode.vue +137 -0
  32. package/components/QuoteBlock.vue +101 -0
  33. package/components/SpeechBubble.vue +169 -0
  34. package/components/Stepper.vue +542 -0
  35. package/components/StyledList.vue +156 -0
  36. package/components/StyledText.vue +275 -0
  37. package/components/SwotGrid.vue +99 -0
  38. package/components/Tags.vue +20 -0
  39. package/components/Testimonial.vue +243 -0
  40. package/components/Typewriter.vue +181 -0
  41. package/components_base/AnimatedCounter.vue +208 -0
  42. package/components_base/CodeHighlight.vue +364 -0
  43. package/composables/useColors.ts +101 -0
  44. package/composables/useShiki.ts +81 -0
  45. package/example_content.md +371 -0
  46. package/example_dark.md +10 -0
  47. package/example_slides/001-cover.md +15 -0
  48. package/example_slides/002-agenda.md +25 -0
  49. package/example_slides/003-section-layouts.md +14 -0
  50. package/example_slides/004-fullscreen-centered.md +7 -0
  51. package/example_slides/005-fullscreen-align-bottom.md +14 -0
  52. package/example_slides/006-fullscreen-no-padding.md +14 -0
  53. package/example_slides/007-fullscreen-bg-image-dark.md +13 -0
  54. package/example_slides/008-fullscreen-bg-image-light.md +13 -0
  55. package/example_slides/009-fullscreen-bg-gradient.md +15 -0
  56. package/example_slides/010-fullscreen-bg-color.md +13 -0
  57. package/example_slides/011-split-basic.md +17 -0
  58. package/example_slides/012-split-image-text.md +18 -0
  59. package/example_slides/013-split-contrast.md +22 -0
  60. package/example_slides/014-columns-basic.md +13 -0
  61. package/example_slides/015-columns-two.md +26 -0
  62. package/example_slides/016-columns-ratios.md +22 -0
  63. package/example_slides/017-columns-three.md +31 -0
  64. package/example_slides/018-columns-four.md +22 -0
  65. package/example_slides/019-columns-alignment.md +23 -0
  66. package/example_slides/020-columns-styled.md +21 -0
  67. package/example_slides/021-footnote-prop.md +16 -0
  68. package/example_slides/022-iframe-fullscreen.md +8 -0
  69. package/example_slides/023-iframe-split.md +18 -0
  70. package/example_slides/024-section-components.md +14 -0
  71. package/example_slides/025-styled-text.md +9 -0
  72. package/example_slides/026-styled-text.md +15 -0
  73. package/example_slides/027-text-formatting.md +28 -0
  74. package/example_slides/028-text-spoiler.md +15 -0
  75. package/example_slides/029-icon-component.md +47 -0
  76. package/example_slides/030-metric-component.md +29 -0
  77. package/example_slides/031-person-card.md +33 -0
  78. package/example_slides/032-styled-list.md +50 -0
  79. package/example_slides/033-color-swatch.md +35 -0
  80. package/example_slides/034-code-highlight.md +9 -0
  81. package/example_slides/035-iframe-component.md +9 -0
  82. package/example_slides/036-callout.md +15 -0
  83. package/example_slides/037-card-grid.md +27 -0
  84. package/example_slides/038-stepper-variants.md +18 -0
  85. package/example_slides/039-stepper-clicks.md +49 -0
  86. package/example_slides/040-stepper-interactive.md +28 -0
  87. package/example_slides/041-tags-progress.md +21 -0
  88. package/example_slides/042-speech-bubble.md +30 -0
  89. package/example_slides/043-conversation.md +13 -0
  90. package/example_slides/044-device-iphone.md +26 -0
  91. package/example_slides/045-device-browser.md +7 -0
  92. package/example_slides/046-qrcode.md +26 -0
  93. package/example_slides/047-countdown.md +14 -0
  94. package/example_slides/048-typewriter.md +8 -0
  95. package/example_slides/049-confetti.md +16 -0
  96. package/example_slides/050-image-compare.md +13 -0
  97. package/example_slides/051-code-diff.md +24 -0
  98. package/example_slides/052-quote-block.md +8 -0
  99. package/example_slides/053-testimonial.md +26 -0
  100. package/example_slides/054-testimonial-featured.md +16 -0
  101. package/example_slides/055-funnel.md +12 -0
  102. package/example_slides/056-pyramid.md +13 -0
  103. package/example_slides/057-pricing-table.md +9 -0
  104. package/example_slides/058-swot-grid.md +12 -0
  105. package/example_slides/059-matrix-grid.md +12 -0
  106. package/example_slides/060-case-study.md +11 -0
  107. package/example_slides/061-definition.md +15 -0
  108. package/example_slides/062-mermaid-intro.md +34 -0
  109. package/example_slides/063-mermaid-flowchart.md +19 -0
  110. package/example_slides/064-mermaid-sequence.md +17 -0
  111. package/example_slides/065-mermaid-xy-chart.md +16 -0
  112. package/example_slides/066-mermaid-pie.md +17 -0
  113. package/example_slides/067-mermaid-class.md +19 -0
  114. package/example_slides/068-mermaid-state.md +19 -0
  115. package/example_slides/069-mermaid-er.md +22 -0
  116. package/example_slides/070-mermaid-gantt.md +24 -0
  117. package/example_slides/071-mermaid-timeline.md +17 -0
  118. package/example_slides/072-mermaid-mindmap.md +21 -0
  119. package/example_slides/073-mermaid-gitgraph.md +20 -0
  120. package/example_slides/074-mermaid-split.md +30 -0
  121. package/example_slides/075-mermaid-columns.md +32 -0
  122. package/example_slides/076-section-addons.md +14 -0
  123. package/example_slides/077-asciinema.md +27 -0
  124. package/example_slides/078-fancyarrow.md +31 -0
  125. package/example_slides/079-fancyarrow-demo.md +23 -0
  126. package/example_slides/080-section-theme.md +14 -0
  127. package/example_slides/081-color-architecture.md +22 -0
  128. package/example_slides/082-semantic-text-colors.md +25 -0
  129. package/example_slides/083-typography.md +16 -0
  130. package/example_slides/084-typography-rationale.md +22 -0
  131. package/example_slides/085-icons.md +24 -0
  132. package/example_slides/086-tables.md +14 -0
  133. package/example_slides/087-code-blocks.md +18 -0
  134. package/example_slides/088-motion-modes.md +35 -0
  135. package/example_slides/089-slide-transitions.md +31 -0
  136. package/example_slides/090-v-click-reveals.md +40 -0
  137. package/example_slides/091-accessibility.md +27 -0
  138. package/example_slides/092-safe-zone.md +17 -0
  139. package/example_slides/093-questions.md +8 -0
  140. package/example_white.md +10 -0
  141. package/fonts/IBMPlexMono-Medium.woff2 +1449 -0
  142. package/fonts/IBMPlexMono-Regular.woff2 +1449 -0
  143. package/fonts/IBMPlexSans-Bold.woff2 +1449 -0
  144. package/fonts/IBMPlexSans-Medium.woff2 +1449 -0
  145. package/fonts/IBMPlexSans-Regular.woff2 +1449 -0
  146. package/fonts/IBMPlexSans-SemiBold.woff2 +1449 -0
  147. package/fonts/LICENSE.txt +93 -0
  148. package/layouts/slide.vue +251 -0
  149. package/package.json +62 -0
  150. package/public/avatars/alice.png +0 -0
  151. package/public/avatars/bob.png +0 -0
  152. package/public/avatars/carol.png +0 -0
  153. package/scripts/chart-audit.mjs +216 -0
  154. package/scripts/contrast-audit.mjs +299 -0
  155. package/scripts/generate-palette.mjs +395 -0
  156. package/scripts/integrity-audit.mjs +357 -0
  157. package/scripts/shared/css-utils.mjs +216 -0
  158. package/scripts/shiki-audit.mjs +300 -0
  159. package/scripts/typography-audit.mjs +300 -0
  160. package/setup/main.ts +107 -0
  161. package/setup/mermaid.ts +237 -0
  162. package/setup/shiki.ts +40 -0
  163. package/snippets/demo.ts +26 -0
  164. package/styles/base.css +1053 -0
  165. package/styles/colors.css +422 -0
  166. package/styles/index.css +12 -0
  167. package/styles/motion.css +486 -0
  168. package/uno.config.ts +67 -0
package/README.md ADDED
@@ -0,0 +1,168 @@
1
+ # slidev-theme-troshab
2
+
3
+ [![npm version](https://img.shields.io/npm/v/%40troshab%2Fslidev-theme-troshab)](https://www.npmjs.com/package/@troshab/slidev-theme-troshab)
4
+ [![license](https://img.shields.io/badge/license-PolyForm%20Noncommercial-orange)](LICENSE)
5
+ [![slidev](https://img.shields.io/badge/slidev-%3E%3D0.50-blue)](https://sli.dev)
6
+
7
+ A minimal, universal [Slidev](https://sli.dev) theme built around one flexible layout and a library of 36 ready-to-use components. Supports both light (Alucard) and dark (Dracula) color schemes.
8
+
9
+ ## Install
10
+
11
+ ```md
12
+ ---
13
+ theme: troshab
14
+ ---
15
+ ```
16
+
17
+ ## What makes it different
18
+
19
+ **Single universal layout** - `layout: slide` with three modes covers every slide type. No need to memorize a dozen layout names.
20
+
21
+ **Component library** - 10 primitives and 26 widgets drop into any slide as Vue components. Everything from KPI metrics and pricing tables to iMessage-style conversations and device mockups.
22
+
23
+ **Design system** - 3-layer Dracula/Alucard palette (11 color families × 11 shades), IBM Plex Sans/Mono typography, and a motion system based on IBM Carbon. All tokens are CSS variables - components never hardcode colors.
24
+
25
+ **v-click auto-registration** - interactive components (AnimatedCounter, Countdown, ImageCompare, Stepper, Conversation, StyledText spoilers) register their own click slots. No `clicks:` frontmatter, no `<v-click>` wrappers needed.
26
+
27
+ **Accessibility** - WCAG AA contrast (target AAA), BDA dyslexia-friendly spacing (word-spacing 0.08em, letter-spacing 0.02em), keyboard focus styles, 5% safe-zone padding.
28
+
29
+ **5 built-in audits** - contrast, Shiki tokens, chart palette, typography, integrity. All must exit 0 before release.
30
+
31
+ ---
32
+
33
+ ## Layout
34
+
35
+ All slides use `layout: slide` with `mode: fullscreen | split | columns` (default: `columns`).
36
+
37
+ ```md
38
+ ---
39
+ layout: slide
40
+ mode: fullscreen
41
+ ---
42
+
43
+ ::bg::
44
+ <Background :gradient="'section'" />
45
+
46
+ ::default::
47
+ # Section Title
48
+ ```
49
+
50
+ ```md
51
+ ---
52
+ layout: slide
53
+ mode: split
54
+ split: [5, 7]
55
+ ---
56
+
57
+ ::left-bg::
58
+ <Background src="/photo.jpg" />
59
+
60
+ ::right::
61
+ # Content here
62
+ ```
63
+
64
+ ```md
65
+ ---
66
+ layout: slide
67
+ cols: 2
68
+ ---
69
+
70
+ # Title
71
+
72
+ ::col1::
73
+ Left content
74
+
75
+ ::col2::
76
+ Right content
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Components
82
+
83
+ ### Primitives
84
+
85
+ | Component | Description |
86
+ |-----------|-------------|
87
+ | `Background` | Bg-slot wrapper: color, gradient, image, overlay |
88
+ | `StyledText` | Universal text: heading/block/inline, color, spoiler v-click |
89
+ | `Image` | Content image with caption, border, sizing |
90
+ | `Icon` | Phosphor icon with size and color |
91
+ | `Metric` | KPI display with count-up animation |
92
+ | `PersonCard` | Speaker/member card with avatar |
93
+ | `Iframe` | External content embed |
94
+ | `ColorSwatch` | Theme color display with resolved value |
95
+ | `StyledList` | Themed list markers: check / arrow / star / number |
96
+ | `CodeHighlight` | Syntax-highlighted code block (Shiki) |
97
+
98
+ ### Widgets
99
+
100
+ | Component | Description |
101
+ |-----------|-------------|
102
+ | `Stepper` | Steps / timeline / progress with dots, numbers, or arrows |
103
+ | `Callout` | Admonition: info, tip, warning, danger, note |
104
+ | `Card` / `CardGrid` | Feature cards in responsive grid |
105
+ | `QRCode` | Theme-aware SVG QR code |
106
+ | `Tags` | Tag pills |
107
+ | `Progress` | Presentation progress bar |
108
+ | `SpeechBubble` | Speech and thought bubbles |
109
+ | `Conversation` | iMessage-style chat with v-click reveal |
110
+ | `DeviceMockup` | Device frames: iPhone, MacBook, browser, tablet |
111
+ | `Countdown` | Animated timer with v-click trigger |
112
+ | `AnimatedCounter` | Count-up number animation |
113
+ | `Typewriter` | Text typing animation |
114
+ | `Confetti` | Celebration particles (bg slot) |
115
+ | `ImageCompare` | Before/after image slider with v-click |
116
+ | `CodeDiff` | Code comparison: split or unified view |
117
+ | `Testimonial` | Customer quote card with rating |
118
+ | `QuoteBlock` | Large centered quote with decorative mark |
119
+ | `Funnel` | Conversion funnel |
120
+ | `Pyramid` | Hierarchical levels |
121
+ | `PricingTable` | Pricing tier cards |
122
+ | `MatrixGrid` | 2×2 quadrant grid |
123
+ | `SwotGrid` | SWOT analysis (named MatrixGrid wrapper) |
124
+ | `CaseStudy` | Multi-section case study card |
125
+ | `Definition` | Term definition card |
126
+ | `MermaidChart` | Mermaid diagram wrapper with auto-theming |
127
+
128
+ ---
129
+
130
+ ## Addons
131
+
132
+ - **Asciinema** - terminal recordings: `<Asciinema src="/casts/demo.cast" autoplay />`
133
+ - **FancyArrow** - hand-drawn arrows: `<FancyArrow x1="100" y1="100" x2="300" y2="200" />`
134
+ - **PreloadImages** - automatic image preloading (configurable look-ahead)
135
+
136
+ ---
137
+
138
+ ## Development
139
+
140
+ ```bash
141
+ npm run dev # both themes in parallel (dark :30303, light :31313)
142
+ npm run dev:dark # dark only
143
+ npm run dev:light # light only
144
+ ```
145
+
146
+ ### Audits
147
+
148
+ ```bash
149
+ npm run audit:all # run all 5 audits
150
+ npm run audit:contrast # WCAG contrast ratios
151
+ npm run audit:shiki # Shiki token contrast + hue distinguishability
152
+ npm run audit:charts # chart palette grayscale spread
153
+ npm run audit:typography
154
+ npm run audit:integrity
155
+ ```
156
+
157
+ ### Visual export
158
+
159
+ ```bash
160
+ npx slidev export example_white.md --format png --output ./slides-export/white
161
+ npx slidev export example_dark.md --format png --output ./slides-export/black
162
+ ```
163
+
164
+ ---
165
+
166
+ ## License
167
+
168
+ [PolyForm Noncommercial 1.0.0](LICENSE) - free for non-commercial use.
package/SKILL.md ADDED
@@ -0,0 +1,414 @@
1
+ ---
2
+ name: slidev-troshab-design
3
+ description: "Intelligent slide design advisor for slidev-theme-troshab. Classifies content and selects optimal layouts, components, and visual elements. Prevents text-heavy slides by recommending Metric, Stepper, MermaidChart, split layouts, and other visual components. Triggers on: create slides, design slide, improve slide, make presentation, slide layout."
4
+ arg_description: "Slide content or topic to design (optional)"
5
+ ---
6
+
7
+ # Step 1: Analyze Input
8
+
9
+ For full component API (props, slots, examples), see `@components/{Name}.md` files. For layout props, see `@layouts/slide.md`.
10
+
11
+ Determine the task type from user input:
12
+
13
+ - **New slides** (user provides content, topic, or data to turn into slides) — go to Step 2.
14
+ - **Improve existing slides** (user provides existing slide markdown or asks to review) — Read the existing slides, go to Step 6 to scan for anti-patterns, then go to Step 2.
15
+ - **No content provided** — AskUserQuestion: "What content or topic should the slides cover?" Options: "Paste text/data", "Describe the topic", "Share existing slides to improve". Then go to Step 2.
16
+
17
+ # Step 2: Classify Content
18
+
19
+ For each slide's content, classify into one of 5 types. When content matches multiple types, pick the type with the most matching detection keywords.
20
+
21
+ ## 2a. Type 1: Quantitative
22
+
23
+ **Detection:** numbers, percentages, KPIs, stats, metrics, "grew by", "increased to", currency values, comparisons with numbers.
24
+
25
+ **Layout:** `columns` with `cols: 2-4` for multiple metrics. `fullscreen` for a single hero number.
26
+
27
+ **Components:**
28
+ - Single KPI: `<Metric :value="10000" label="Users" color="info" animated separator="," gradient />` in fullscreen
29
+ - Multiple KPIs: 2-4 `<Metric>` in columns layout (one per column)
30
+ - Trends over time: `<MermaidChart type="xychart">` (max 8 x-axis labels, no `title` directive)
31
+ - Proportions: `<MermaidChart type="pie">` (max 5 segments)
32
+ - Funnel data: `<Funnel :stages="[{label, value}]" />`
33
+ - Progress toward goal: `<Progress :value="75" showPercentage />`
34
+
35
+ ## 2b. Type 2: Process / Structure
36
+
37
+ **Detection:** steps, flow, sequence, "first...then...finally", hierarchy, layers, timeline, milestones, workflow, pipeline.
38
+
39
+ **Layout:** `columns` for horizontal flows. `columns` with vertical Stepper for timelines. `split` for process + explanation.
40
+
41
+ **Components:**
42
+ - Sequential steps (3-8): `<Stepper :items="[...]" variant="numbers" mode="clicks" />` (reveals one by one)
43
+ - Timeline/milestones: `<Stepper :items="[{label, date, description}]" variant="dots" direction="vertical" />`
44
+ - Complex flow with branches: `<MermaidChart type="flowchart" direction="LR">` (max 8 nodes, 2-8 char labels)
45
+ - API/interaction flow: `<MermaidChart type="sequence">` (max 4 participants, max 8 messages)
46
+ - Hierarchy/layers: `<Pyramid :levels="[{label, description}]" />`
47
+
48
+ ## 2c. Type 3: Comparative
49
+
50
+ **Detection:** before/after, pros/cons, options, alternatives, vs, differences, old/new, tradeoffs, pricing tiers.
51
+
52
+ **Layout:** `split` for two-sided comparisons. `columns` with `cols: 2` for side-by-side. `columns` for grids.
53
+
54
+ **Components:**
55
+ - Code before/after: `<CodeDiff mode="split">` with two `<pre>` blocks
56
+ - Image before/after: `<ImageCompare before="/a.png" after="/b.png" />`
57
+ - Pros/cons: `split` mode with `<StyledList marker="check" color="success">` left and `<StyledList marker="arrow" color="danger">` right
58
+ - SWOT analysis: `<SwotGrid :strengths="[...]" :weaknesses="[...]" :opportunities="[...]" :threats="[...]" />`
59
+ - Impact/effort or 2x2 matrix: `<MatrixGrid :cells="[{title, items}]" />`
60
+ - Pricing tiers: `<PricingTable :plans="[{name, price, features, highlighted}]" />`
61
+
62
+ ## 2d. Type 4: Narrative / People
63
+
64
+ **Detection:** quotes, testimonials, stories, team members, speakers, conversations, Q&A, dialogue, case studies, experiences.
65
+
66
+ **Layout:** `fullscreen` for quotes and hero testimonials. `columns` for team grids and case studies.
67
+
68
+ **Components:**
69
+ - Large quote: `<QuoteBlock author="Name" source="Context">Quote text</QuoteBlock>` in fullscreen
70
+ - Customer testimonial: `<Testimonial quote="..." author="Name" role="Title" :rating="5" variant="featured" />`
71
+ - Team grid: `<PersonCard name="Name" role="Role" avatar="/photo.jpg" />` in columns with `cols: 3-4`
72
+ - Speaker intro: `<PersonCard name="Name" role="Role" avatar="/photo.jpg" horizontal />` in single column
73
+ - Dialog/chat: `<Conversation :messages="[{from: 'Alice', text: '...'}]" mode="clicks" />`
74
+ - Case study: `<CaseStudy :sections="[{title, content, color}]" />`
75
+
76
+ ## 2e. Type 5: Conceptual
77
+
78
+ **Detection:** definitions, key ideas, statements, principles, announcements, focus points, terms, vocabulary, big reveals.
79
+
80
+ **Layout:** `fullscreen` for impact statements and definitions. `columns` for explanations with examples.
81
+
82
+ **Components:**
83
+ - Term definition: `<Definition term="API" pronunciation="/ei.pi.ai/" partOfSpeech="noun">Description</Definition>`
84
+ - Key statement: `<StyledText tag="h1" color="primary" align="center">Big Idea</StyledText>` in fullscreen
85
+ - Important note: `<Callout type="info" title="Key Insight">Text</Callout>`
86
+ - Spoiler/reveal: `<StyledText inline spoiler>Hidden answer</StyledText>` (auto v-click)
87
+ - Announcement with flair: fullscreen with `<Background :gradient="'accent'" />` + `<StyledText tag="h1">`
88
+
89
+ Go to Step 3.
90
+
91
+ # Step 3: Select Layout
92
+
93
+ Apply this decision tree for each slide:
94
+
95
+ ```
96
+ Is it a single hero element (quote, KPI, statement, full-screen media)?
97
+ YES -> fullscreen
98
+
99
+ Is it a two-sided comparison (image+text, before/after, code+explanation)?
100
+ YES -> split
101
+
102
+ Everything else -> columns (default)
103
+ - 1 column: text + list, single component, definition
104
+ - 2 columns: comparison, feature pairs, code + output
105
+ - 3 columns: triple feature, team row, KPI trio
106
+ - 4 columns: dashboard, icon grid (rare - content gets cramped)
107
+ ```
108
+
109
+ Go to Step 4.
110
+
111
+ # Step 4: Select Components
112
+
113
+ Using the classified type (Step 2) and selected layout (Step 3), pick components from the matching type's component list. Use the first listed component for each content pattern (default); use alternatives when content does not fit the primary recommendation.
114
+
115
+ ## 4a. Content Limits
116
+
117
+ | Context | Limit |
118
+ |---|---|
119
+ | Full-width code block | 12-15 lines, 80 chars |
120
+ | Two-column code block | 8-10 lines, 40 chars |
121
+ | Mermaid flowchart nodes | 6-8 max, 2-8 char labels |
122
+ | Mermaid xychart x-axis labels | 6-8 max, 3 chars each |
123
+ | Mermaid sequence participants | 4 max, 2-6 chars each |
124
+ | Mermaid pie segments | 5 max, 12 chars each |
125
+ | Stepper items | 3-8 items |
126
+ | Columns | 1-4 (4 gets cramped) |
127
+ | Bullet points before using StyledList | 3+ items |
128
+
129
+ ## 4b. Semantic Colors
130
+
131
+ Available everywhere components accept a `color` prop: `primary`, `secondary`, `tertiary`, `success`, `warning`, `danger`, `info`, `accent`, `soft`, `muted`.
132
+
133
+ Gradient presets for `<Background>`: `"accent"` (colorful), `"subtle"` (neutral), `"section"` (section divider).
134
+
135
+ ## 4c. Component Quick Reference
136
+
137
+ **Primitives** (full API in `@components/{Name}.md`):
138
+
139
+ | Component | Use When |
140
+ |---|---|
141
+ | `Background` | Any bg slot: solid color, gradient, image, video |
142
+ | `StyledText` | Colored/styled heading or text, spoiler reveals |
143
+ | `Image` | Content image with caption, border, rounding |
144
+ | `Icon` | Inline icon (Phosphor set, `ph-*` names) |
145
+ | `Metric` | Single KPI / number display, optional count-up |
146
+ | `PersonCard` | Person with avatar, name, role |
147
+ | `Iframe` | Embed external page or interactive content |
148
+ | `ColorSwatch` | Display theme color with resolved value |
149
+ | `StyledList` | Styled bullet/number/check/arrow list markers |
150
+ | `CodeHighlight` | Syntax-highlighted code with line numbers |
151
+
152
+ **Widgets** (full API in `@components/{Name}.md`):
153
+
154
+ | Component | Use When |
155
+ |---|---|
156
+ | `Stepper` | Steps, timeline, progress (dots/numbers/arrows) |
157
+ | `Callout` | Admonition: info, tip, warning, danger, note |
158
+ | `Card` / `CardGrid` | Feature cards in a grid |
159
+ | `QRCode` | Link as scannable QR code |
160
+ | `Tags` | Tag pills / labels |
161
+ | `Progress` | Progress bar toward goal |
162
+ | `SpeechBubble` | Speech or thought bubble |
163
+ | `Conversation` | iMessage-style multi-message chat |
164
+ | `DeviceMockup` | Screenshot in device frame (iPhone, MacBook, browser, tablet) |
165
+ | `Countdown` | Animated countdown timer |
166
+ | `AnimatedCounter` | Count-up number animation |
167
+ | `Typewriter` | Typing animation effect |
168
+ | `Confetti` | Celebration particles (bg slot) |
169
+ | `ImageCompare` | Before/after image slider |
170
+ | `CodeDiff` | Side-by-side or unified code diff |
171
+ | `Testimonial` | Customer quote card with rating |
172
+ | `QuoteBlock` | Large centered quote with author |
173
+ | `Funnel` | Conversion funnel visualization |
174
+ | `Pyramid` | Hierarchical level diagram |
175
+ | `PricingTable` | Pricing tier comparison cards |
176
+ | `MatrixGrid` | 2x2 quadrant grid |
177
+ | `SwotGrid` | SWOT analysis (wraps MatrixGrid) |
178
+ | `CaseStudy` | Multi-section case study with colored borders |
179
+ | `Definition` | Term + pronunciation + definition |
180
+ | `MermaidChart` | Wrapper for any Mermaid diagram type |
181
+
182
+ Go to Step 5.
183
+
184
+ # Step 5: Apply Deck Rules
185
+
186
+ When creating or reviewing 3+ slides, apply these deck-level rules. For single slides, go to Step 6.
187
+
188
+ **Repetition Limits:**
189
+ - Max 2 consecutive slides with the same mode (fullscreen/split/columns)
190
+ - Max 2 consecutive slides with the same primary component
191
+ - If 3+ slides in a row are columns mode, vary `cols` count or introduce a split/fullscreen break
192
+
193
+ **Section Rhythm:**
194
+ - Insert section dividers (fullscreen + `<Background :gradient="'section'" />`) every 5-8 content slides
195
+ - Alternate density: text-heavy slide -> visual/component slide -> text-heavy slide
196
+ - End each section with a visual slide (chart, quote, or KPI) not a bullet list
197
+
198
+ **Color Rotation:**
199
+ Rotate semantic colors across consecutive slides: `primary` -> `success` -> `info` -> `accent` -> `warning`. Don't use the same color on 3+ consecutive slides.
200
+
201
+ **Transition Variety:**
202
+ - Content slides: `slide-left` (default, set once in first slide frontmatter)
203
+ - Section dividers: `transition: fade` (override per slide)
204
+
205
+ Go to Step 6.
206
+
207
+ # Step 6: Check Anti-Patterns
208
+
209
+ Scan each slide for these anti-patterns. If any are found, apply the fix.
210
+
211
+ | Anti-Pattern | Fix |
212
+ |---|---|
213
+ | Plain markdown bullets for >3 items | `<StyledList marker="check/arrow/number">` |
214
+ | Numbers written as text ("Revenue: $10M") | `<Metric :value="10000000" label="Revenue" prefix="$" animated />` |
215
+ | Process described as bullet list | `<Stepper :items="[...]" mode="clicks" />` |
216
+ | Raw `![](img)` for background | `<Background src="..." />` in `::bg::` slot |
217
+ | Raw `![](img)` for content image | `<Image src="..." caption="..." />` |
218
+ | Same `cols: 2` layout for 5+ slides | Alternate with fullscreen, split, or different col counts |
219
+ | Hardcoded hex colors (`#ff0000`) | Semantic names: `primary`, `success`, `danger`, etc. |
220
+ | Inline `style="..."` on elements | CSS classes or component props |
221
+ | Long code block (>15 lines) | Split across slides or use `highlights` to focus |
222
+ | Mermaid diagram with >8 nodes | Simplify labels, reduce nodes, or split into 2 diagrams |
223
+ | Quote as plain markdown `>` | `<QuoteBlock>` for impact, `<Callout>` for notes |
224
+ | Steps numbered manually (1. 2. 3.) | `<Stepper>` or `<StyledList marker="number">` |
225
+ | Multiple paragraphs of prose | Split into slides, use `split` mode with visual, or extract key points |
226
+ | `<Header>`, `<Subheader>`, `<Text>` | REMOVED. Use `<StyledText tag="h1/h2/p">` |
227
+ | `<Timeline>`, `<Steps>`, `<ProcessFlow>` | REMOVED. Use `<Stepper>` |
228
+ | `class: two-cols` or other CSS variants | REMOVED. Use `cols: 2` prop or `mode: split` |
229
+
230
+ Go to Step 7.
231
+
232
+ # Step 7: Output
233
+
234
+ Output the slide markdown directly. Each slide uses this structure:
235
+
236
+ ```md
237
+ ---
238
+ layout: slide
239
+ mode: {fullscreen|split|columns}
240
+ {additional props as needed}
241
+ ---
242
+
243
+ {slot assignments and component markup}
244
+ ```
245
+
246
+ When presenting recommendations before generating markdown, use this format:
247
+
248
+ **Slide N: {title}**
249
+ - Type: {Quantitative|Process|Comparative|Narrative|Conceptual}
250
+ - Layout: `{mode}` with `{key props}`
251
+ - Components: `<ComponentName>`, `<ComponentName>`
252
+ - Rationale: {1 sentence why this layout+components fit the content}
253
+
254
+ ## 7a. Before/After Examples
255
+
256
+ ### KPI Data
257
+
258
+ **Before (text-heavy):**
259
+ ```md
260
+ ---
261
+ layout: slide
262
+ ---
263
+
264
+ # Q3 Results
265
+
266
+ - Monthly active users: 2.4 million
267
+ - Revenue growth: 47%
268
+ - Customer satisfaction: 4.8/5
269
+ - Uptime: 99.97%
270
+ ```
271
+
272
+ **After (visual):**
273
+ ```md
274
+ ---
275
+ layout: slide
276
+ cols: 4
277
+ ---
278
+
279
+ # Q3 Results
280
+
281
+ ::col1::
282
+ <Metric :value="2400000" label="Active Users" color="primary" animated separator="," />
283
+
284
+ ::col2::
285
+ <Metric value="47%" label="Revenue Growth" color="success" gradient />
286
+
287
+ ::col3::
288
+ <Metric value="4.8/5" label="Satisfaction" color="info" />
289
+
290
+ ::col4::
291
+ <Metric value="99.97%" label="Uptime" color="accent" />
292
+ ```
293
+
294
+ ### Process Steps
295
+
296
+ **Before (bullet list):**
297
+ ```md
298
+ ---
299
+ layout: slide
300
+ ---
301
+
302
+ # Deployment Pipeline
303
+
304
+ 1. Developer pushes code to main branch
305
+ 2. CI runs automated tests
306
+ 3. Docker image is built and tagged
307
+ 4. Staging deployment and smoke tests
308
+ 5. Production rollout with canary release
309
+ ```
310
+
311
+ **After (interactive stepper):**
312
+ ```md
313
+ ---
314
+ layout: slide
315
+ ---
316
+
317
+ # Deployment Pipeline
318
+
319
+ <Stepper
320
+ :items="['Push to main', 'Run CI tests', 'Build Docker', 'Stage + smoke', 'Canary release']"
321
+ variant="arrows"
322
+ mode="clicks"
323
+ color="info"
324
+ />
325
+ ```
326
+
327
+ ### Pros/Cons Comparison
328
+
329
+ **Before (single column):**
330
+ ```md
331
+ ---
332
+ layout: slide
333
+ ---
334
+
335
+ # Microservices vs Monolith
336
+
337
+ **Pros of microservices:**
338
+ - Independent scaling
339
+ - Technology flexibility
340
+ - Team autonomy
341
+
342
+ **Cons of microservices:**
343
+ - Network complexity
344
+ - Data consistency challenges
345
+ - Operational overhead
346
+ ```
347
+
348
+ **After (split layout):**
349
+ ```md
350
+ ---
351
+ layout: slide
352
+ mode: split
353
+ ---
354
+
355
+ ::left-bg::
356
+ <Background color="success" />
357
+
358
+ ::left::
359
+ ## Microservices
360
+
361
+ <StyledList marker="check" color="success">
362
+
363
+ - Independent scaling
364
+ - Tech flexibility
365
+ - Team autonomy
366
+
367
+ </StyledList>
368
+
369
+ ::right-bg::
370
+ <Background color="danger" />
371
+
372
+ ::right::
373
+ ## Monolith
374
+
375
+ <StyledList marker="arrow" color="danger">
376
+
377
+ - Simpler networking
378
+ - Easier consistency
379
+ - Lower ops overhead
380
+
381
+ </StyledList>
382
+ ```
383
+
384
+ ### Quote with Attribution
385
+
386
+ **Before (plain markdown):**
387
+ ```md
388
+ ---
389
+ layout: slide
390
+ ---
391
+
392
+ # Inspiration
393
+
394
+ > "The best way to predict the future is to invent it."
395
+ >
396
+ > -- Alan Kay, 1971
397
+ ```
398
+
399
+ **After (fullscreen quote):**
400
+ ```md
401
+ ---
402
+ layout: slide
403
+ mode: fullscreen
404
+ transition: fade
405
+ ---
406
+
407
+ ::bg::
408
+ <Background :gradient="'subtle'" />
409
+
410
+ ::default::
411
+ <QuoteBlock author="Alan Kay" source="1971">
412
+ The best way to predict the future is to invent it.
413
+ </QuoteBlock>
414
+ ```
@@ -0,0 +1,35 @@
1
+ <!--
2
+ AnimatedCounter — animated number counting up with easing.
3
+ Building block for Metric. Also usable standalone for custom animated numbers.
4
+
5
+ Implementation: ../components_base/AnimatedCounter.vue
6
+
7
+ Integrates with Slidev v-click system via `at` prop.
8
+ Resets when navigating back past the trigger click.
9
+ Resets and re-triggers on slide re-enter (slide activation detection).
10
+
11
+ Props:
12
+ value: number — Target number (required)
13
+ from: number — Starting number (default: 0)
14
+ duration: number — Animation duration in ms (default: 2000)
15
+ prefix: string — Text before number, e.g. "$"
16
+ suffix: string — Text after number, e.g. "%"
17
+ decimals: number — Decimal places (default: 0)
18
+ separator: string — Thousands separator, e.g. ","
19
+ easing: string — linear | easeOut | easeInOut (default: easeOut)
20
+ at: number — V-click trigger: 0 = on slide enter, N = at click N
21
+
22
+ Exposed methods (via ref):
23
+ animate() — Trigger animation manually
24
+ resetToStart() — Reset to `from` value
25
+
26
+ Usage:
27
+ <AnimatedCounter :value="1000" />
28
+ <AnimatedCounter :value="95" suffix="%" :at="1" />
29
+ <AnimatedCounter :value="50000" prefix="$" separator="," />
30
+ <AnimatedCounter :value="3.14" :decimals="2" :duration="2000" />
31
+ -->
32
+ <script>
33
+ import AnimatedCounter from '../components_base/AnimatedCounter.vue'
34
+ export default AnimatedCounter
35
+ </script>