slidev-theme-one-purple-unicorn-pro 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/LICENSE +21 -0
- package/README.md +199 -80
- package/components/Badge.vue +14 -26
- package/components/ComplexityTable.vue +42 -25
- package/components/Countdown.vue +7 -7
- package/components/Footnote.vue +20 -7
- package/components/Kbd.vue +5 -5
- package/components/LinkCard.vue +5 -6
- package/components/PatternCard.vue +50 -44
- package/components/PresenterNote.vue +3 -3
- package/components/QRCode.vue +19 -8
- package/components/StageProgress.vue +53 -42
- package/components/StoryBox.vue +25 -37
- package/components/Timeline.vue +14 -9
- package/components/internal/ColumnsLayout.vue +49 -0
- package/components/internal/FullBleed.vue +5 -9
- package/components/internal/GridColumns.vue +14 -14
- package/components/internal/MediaPanel.vue +5 -17
- package/components/internal/ScaledIframe.vue +36 -0
- package/global-bottom.vue +56 -20
- package/layouts/center.vue +5 -2
- package/layouts/comparison.vue +15 -0
- package/layouts/cover.vue +5 -2
- package/layouts/default.vue +2 -1
- package/layouts/end.vue +5 -2
- package/layouts/fact.vue +6 -3
- package/layouts/full-center.vue +12 -0
- package/layouts/full-dark.vue +34 -0
- package/layouts/full-image.vue +5 -3
- package/layouts/full-split.vue +1 -1
- package/layouts/full-text.vue +2 -5
- package/layouts/full.vue +1 -1
- package/layouts/iframe-left.vue +12 -0
- package/layouts/iframe-right.vue +12 -0
- package/layouts/iframe.vue +4 -18
- package/layouts/image-left.vue +12 -0
- package/layouts/image-right.vue +12 -0
- package/layouts/image.vue +1 -1
- package/layouts/intro.vue +8 -2
- package/layouts/quote.vue +35 -7
- package/layouts/section.vue +5 -2
- package/layouts/statement.vue +6 -3
- package/layouts/three-cols.vue +19 -25
- package/layouts/two-cols-header.vue +15 -0
- package/layouts/two-cols.vue +15 -29
- package/package.json +19 -26
- package/setup/main.ts +5 -4
- package/styles/animations.css +262 -158
- package/styles/colors.css +14 -84
- package/styles/gradients.css +18 -227
- package/styles/index.css +23 -45
- package/styles/layout-fix.css +15 -30
- package/styles/layout.css +11 -38
- package/styles/light-theme.css +95 -105
- package/styles/macos-buttons.css +5 -11
- package/styles/main.css +40 -113
- package/styles.css +2 -2
- package/uno.config.ts +6 -17
- package/utils/border-beam.ts +84 -0
- package/utils/layout-props.ts +7 -0
- package/utils/layouts.ts +12 -0
- package/utils/pages.ts +11 -0
- package/utils/rich-text.ts +25 -0
- package/index.ts +0 -11
- package/styles/dark-theme.css +0 -9
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
Includes everything from 2.2.0 (tagged, not published to npm).
|
|
6
|
+
|
|
7
|
+
### Breaking changes
|
|
8
|
+
|
|
9
|
+
- **Removed classes** (no known use in the demo or docs):
|
|
10
|
+
`.btn`, `.btn-primary`, `.btn-secondary`, `.btn-gradient`, `.gradient-bg`,
|
|
11
|
+
`.gradient-animated`, `.gradient-overlay`, `.gradient-text-animated`,
|
|
12
|
+
`.gradient-card-hover`, `.gradient-border-animated`, `.gradient-blob`,
|
|
13
|
+
`.gradient-blob-1/2/3`, `.gradient-unicorn-bg`, `.gradient-vibrant-bg`,
|
|
14
|
+
`.gradient-soft-bg`.
|
|
15
|
+
- **Removed utilities that shadowed UnoCSS** (`.mt-*`, `.mb-*`, `.text-sm/lg/xl/2xl`,
|
|
16
|
+
`.text-left/center/right`, `.grid-cols-2/3`, `.gap-4/6/8`). UnoCSS's own values already
|
|
17
|
+
applied in practice, so slides look the same.
|
|
18
|
+
- **Removed unused CSS variables**: the `--blue-*` / `--purple-*` scales, `--radius-*`,
|
|
19
|
+
`--syntax-*`, and others nothing in the theme read.
|
|
20
|
+
- **Fonts** follow the deck's `fonts:` headmatter instead of being hard-coded. The defaults
|
|
21
|
+
(Noto Sans KR / JetBrains Mono, weight 400) look the same as before.
|
|
22
|
+
- **`intro`** headings follow the `align` prop (default `left`) instead of always being
|
|
23
|
+
centered.
|
|
24
|
+
- **Light mode**: content slides use a light palette (cards, tables, badges, keys) and deeper
|
|
25
|
+
accent colors for readable text on white. Dark mode text is one step brighter.
|
|
26
|
+
- **Requires Slidev 52+** (Node 20.12+).
|
|
27
|
+
|
|
28
|
+
### Upgrading from 1.x / 2.x
|
|
29
|
+
|
|
30
|
+
- Layout names from 1.x (`image-left`, `iframe-left`, `two-cols-header`, `comparison`,
|
|
31
|
+
`full-center`, `full-dark`) still work as presets.
|
|
32
|
+
- If a slide used one of the removed classes, replace it with UnoCSS utilities or a custom
|
|
33
|
+
style.
|
|
34
|
+
- The `grid` side padding, `flex` wrapping and `absolute` max-width inside slides are kept;
|
|
35
|
+
turn them off with `--grid-padding-x: 0`, `--flex-wrap: nowrap`, `--absolute-max-width: none`.
|
|
36
|
+
- To keep the previous centered `intro` headings, set `align: center`.
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
- Progress bar: deck-wide options, `progressBarSkip` / `progressBarSkipMode`,
|
|
41
|
+
`pageNumber: false`, and export-only `progressBarInExport` / `pageNumberInExport`.
|
|
42
|
+
- `$...$` math (KaTeX) and `x^y` superscripts in component props; `\$` for a literal dollar.
|
|
43
|
+
- Every size, color and speed is a CSS variable or prop (see the README's Customization).
|
|
44
|
+
- Effects: constant-speed animated border light, size-adaptive shimmer, em-based gradient
|
|
45
|
+
text cycle, parameterized hover effects (`hover-tilt`, `hover-gradient` restored), slide
|
|
46
|
+
transition speed.
|
|
47
|
+
- Components: `StoryBox` `color` / `icon`, `PatternCard` `sections`, `Timeline` item colors,
|
|
48
|
+
`QRCode` any size / `api` / `src`, `three-cols` labels and `bottom` slot, layout
|
|
49
|
+
`padding` / `contentMaxWidth`.
|
|
50
|
+
- `npm run check:decks` (repo only): render real decks with their theme and this repo's
|
|
51
|
+
theme and report changed slides.
|
|
52
|
+
|
|
53
|
+
### Fixes
|
|
54
|
+
|
|
55
|
+
- Presenter notes show in the presenter view.
|
|
56
|
+
- Readable text: dark mode body / muted text, keys, link cards; light mode accents, slide
|
|
57
|
+
chrome; table and quote text on title slides; full-split panel text.
|
|
58
|
+
- Shimmer and hover-shine were nearly invisible; animated border was clipped inside cards;
|
|
59
|
+
`hover-*` lost to `.card:hover`.
|
|
60
|
+
- Gradient borders never showed; table corners turned square on hover; code chips in tables
|
|
61
|
+
wrapped and overlapped; PatternCard slot-only sections were hidden.
|
|
62
|
+
- Footnote sizing, stage indicator overlapping the title, symmetric quote marks.
|
|
63
|
+
- Theme font defaults listed `system-ui` / `monospace`, which made the web font request fail.
|
|
64
|
+
- KaTeX version matches Slidev's, so math superscripts render at the right size.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hawk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# One Purple Unicorn Pro - Slidev Theme
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A Slidev theme with purple → blue gradients and One Dark colors, built for technical talks.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
7
|
+
- **Light & dark modes**: content slides switch palettes; title and emphasis slides stay dark
|
|
8
|
+
- **Korean + English**: Noto Sans KR by default, any font via `fonts:`
|
|
9
|
+
- **Layouts**: title, columns, image/iframe, quote/statement/fact, full-bleed
|
|
10
|
+
- **Components**: badges, keys, footnotes, link cards, story boxes, pattern cards, complexity tables (with KaTeX), timelines, countdown, QR codes
|
|
11
|
+
- **Effects**: animated borders, shimmer, glow, gradient text, entrance animations, hover effects
|
|
12
|
+
- **Code**: custom One Dark-based Shiki theme (incl. CUDA/C++ keywords)
|
|
13
|
+
- **Customizable**: every size, color and speed has a default and a variable or prop
|
|
12
14
|
|
|
13
15
|
## Installation
|
|
14
16
|
|
|
@@ -16,137 +18,254 @@ A professional Slidev theme with purple and indigo gradients, optimized for tech
|
|
|
16
18
|
npm install slidev-theme-one-purple-unicorn-pro
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
Requires Slidev 52 or later (Node 20.12+; Slidev 53 needs Node 22.12+).
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
## Usage
|
|
22
24
|
|
|
23
25
|
```yaml
|
|
24
26
|
---
|
|
25
27
|
theme: slidev-theme-one-purple-unicorn-pro
|
|
26
|
-
colorSchema: light # or 'dark', 'auto'
|
|
27
28
|
---
|
|
28
29
|
|
|
29
30
|
# Your Presentation Title
|
|
30
31
|
```
|
|
31
32
|
|
|
33
|
+
The demo deck in [`example/slides.md`](example/slides.md) shows every layout, component and effect.
|
|
34
|
+
|
|
32
35
|
## Theme Modes
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
```yaml
|
|
36
|
-
---
|
|
37
|
-
colorSchema: light
|
|
38
|
-
---
|
|
39
|
-
```
|
|
37
|
+
Set the color mode for the whole deck in the headmatter (Slidev applies it deck-wide):
|
|
40
38
|
|
|
41
|
-
### Dark Mode
|
|
42
39
|
```yaml
|
|
43
40
|
---
|
|
44
|
-
colorSchema: dark
|
|
41
|
+
colorSchema: auto # auto (default, follows the system / toggle) | light | dark
|
|
45
42
|
---
|
|
46
43
|
```
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
Content slides switch between light and dark palettes. These layouts stay dark in both modes: `cover`, `intro`, `section`, `end`, `quote`, `statement`, `fact`, `full-image`, `full-split`, `full-dark`. Code blocks always use the dark code theme.
|
|
46
|
+
|
|
47
|
+
## Fonts
|
|
48
|
+
|
|
49
|
+
Fonts follow Slidev's `fonts:` headmatter. The theme's defaults are Noto Sans KR / Inter (sans), Noto Serif KR (serif) and JetBrains Mono / Fira Code (mono):
|
|
50
|
+
|
|
49
51
|
```yaml
|
|
50
52
|
---
|
|
51
|
-
|
|
53
|
+
fonts:
|
|
54
|
+
sans: Pretendard
|
|
55
|
+
mono: D2Coding
|
|
56
|
+
weights: '400,700' # the theme loads 400 only by default
|
|
52
57
|
---
|
|
53
58
|
```
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
```yaml
|
|
57
|
-
---
|
|
58
|
-
colorSchema: dark
|
|
59
|
-
---
|
|
60
|
+
List only web font names (Slidev loads them from Google Fonts by default); generic names like `system-ui` or `monospace` make the whole font request fail. Slidev adds system fallbacks itself.
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
```
|
|
62
|
+
The quote mark uses a serif and the macOS button styles use the system UI font by design.
|
|
63
63
|
|
|
64
|
-
##
|
|
64
|
+
## Layouts
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
| Layout | Use | Options (frontmatter) |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `cover`, `intro`, `section`, `end` | Title slides | `padding`, `contentMaxWidth` (`intro`: also `align`, default `left`) |
|
|
69
|
+
| `default` | Content slide (title pinned at the top) | |
|
|
70
|
+
| `center` | Centered content | `padding`, `contentMaxWidth` |
|
|
71
|
+
| `two-cols`, `three-cols` | Columns with a header (default slot) and a `bottom` slot | `leftWidth`, `centerWidth`, `rightWidth`, `divider`, `leftLabel`, `centerLabel`, `rightLabel`, `leftLabelColor`, `centerLabelColor`, `rightLabelColor` |
|
|
72
|
+
| `image` | Image beside content | `image`, `side` (`left`/`right`), `backgroundSize` |
|
|
73
|
+
| `iframe` | Embedded page, full or beside content | `url`, `side` (`full`/`left`/`right`), `scale` |
|
|
74
|
+
| `quote`, `statement`, `fact` | Emphasis slides | `padding`, `contentMaxWidth` |
|
|
75
|
+
| `full` | No padding, build your own | |
|
|
76
|
+
| `full-text` | Full-width text, no pinned title | |
|
|
77
|
+
| `full-image` | Background image with overlay | `image`, `overlay`, `position`, `backgroundSize`, `align`, `padding` |
|
|
78
|
+
| `full-split` | Background image with a text panel | `image`, `panelWidth`, `panelSide`, `panelColor`, `backgroundSize`, `backgroundPosition` |
|
|
79
|
+
| `full-dark` | Dark centered slide with a large heading | `padding`, `contentMaxWidth` |
|
|
71
80
|
|
|
72
|
-
|
|
73
|
-
Subtitle or description
|
|
74
|
-
```
|
|
81
|
+
Column slots:
|
|
75
82
|
|
|
76
|
-
|
|
77
|
-
```yaml
|
|
83
|
+
```md
|
|
78
84
|
---
|
|
79
|
-
layout:
|
|
85
|
+
layout: two-cols
|
|
86
|
+
leftLabel: Before
|
|
87
|
+
rightLabel: After
|
|
88
|
+
divider: true
|
|
80
89
|
---
|
|
81
90
|
|
|
82
|
-
#
|
|
83
|
-
```
|
|
91
|
+
# Header
|
|
84
92
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
layout: intro
|
|
89
|
-
---
|
|
93
|
+
::left::
|
|
94
|
+
Left content
|
|
90
95
|
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
::right::
|
|
97
|
+
Right content
|
|
98
|
+
|
|
99
|
+
::bottom::
|
|
100
|
+
Full-width footer
|
|
93
101
|
```
|
|
94
102
|
|
|
95
|
-
|
|
96
|
-
```yaml
|
|
97
|
-
---
|
|
98
|
-
layout: end
|
|
99
|
-
---
|
|
103
|
+
`quote`: the quote text paragraphs, then a last paragraph as the attribution (`**— Name**`).
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
### Compatibility Aliases
|
|
106
|
+
|
|
107
|
+
Layout names from 1.x still work as presets of current layouts; frontmatter values override the preset:
|
|
108
|
+
|
|
109
|
+
| Alias | Equivalent |
|
|
110
|
+
|---|---|
|
|
111
|
+
| `image-left` / `image-right` | `image` + `side: left` / `right` |
|
|
112
|
+
| `iframe-left` / `iframe-right` | `iframe` + `side: left` / `right` |
|
|
113
|
+
| `two-cols-header` | `two-cols` |
|
|
114
|
+
| `comparison` | `two-cols` + `divider: true`, `leftLabel: Before`, `rightLabel: After` |
|
|
115
|
+
| `full-center` | `center` + `padding: 2rem` |
|
|
116
|
+
|
|
117
|
+
## Components
|
|
118
|
+
|
|
119
|
+
| Component | Props |
|
|
120
|
+
|---|---|
|
|
121
|
+
| `<Badge>` | `variant`: `default` `blue` `green` `red` `yellow` `cyan` `gray` |
|
|
122
|
+
| `<Kbd>` | |
|
|
123
|
+
| `<Footnote>` | (slot; pinned at the bottom of the slide) |
|
|
124
|
+
| `<LinkCard>` | `href`, `title`, `description`, `icon`, `compact` |
|
|
125
|
+
| `<FloatImage>` | `src`, `alt`, `caption`, `position` (`left`/`right`), `width`, `rounded` |
|
|
126
|
+
| `<StoryBox>` | `title`, `variant` (`history` `insight` `warning` `tip` `person`), `year`, `source`, `color`, `icon` |
|
|
127
|
+
| `<PatternCard>` | `signal`, `template`, `alternatives`, `sections` (`[{ key, label, icon, color, text }]`); same-named slots for rich content |
|
|
128
|
+
| `<Timeline>` | `items` (`[{ title, year, desc, color }]`), `active` |
|
|
129
|
+
| `<ComplexityTable>` | `title`, `rows` (`[{ n, target, algo, complexity, highlight }]`), `showComplexity` |
|
|
130
|
+
| `<Countdown>` | `minutes`, `size` (`sm` `default` `lg` `xl`), `label`, `autoStart`, `showZero` |
|
|
131
|
+
| `<QRCode>` | `url`, `size` (preset or any CSS length), `caption`, `api` (`{data}` is replaced), `src` |
|
|
132
|
+
| `<PresenterNote>` | (slot; shown only in the presenter view) |
|
|
133
|
+
|
|
134
|
+
Text in `ComplexityTable`, `PatternCard`, `Timeline` and `StoryBox` props supports `$...$` math (KaTeX) and `x^y` superscripts; write `\$` for a literal dollar sign.
|
|
135
|
+
|
|
136
|
+
### Stage indicator
|
|
104
137
|
|
|
105
|
-
### Two Columns Layout
|
|
106
138
|
```yaml
|
|
107
139
|
---
|
|
108
|
-
|
|
140
|
+
stages: ["Concept", "Implementation", "Practice"]
|
|
141
|
+
currentStage: 1
|
|
142
|
+
stagePosition: top # top | top-left | top-right | bottom | left | right
|
|
109
143
|
---
|
|
144
|
+
```
|
|
110
145
|
|
|
111
|
-
|
|
146
|
+
Click a stage to jump to the matching slide (or give `stageMap: [3, 7, 12]`).
|
|
112
147
|
|
|
113
|
-
|
|
148
|
+
## CSS Classes
|
|
114
149
|
|
|
115
|
-
|
|
150
|
+
| Class | |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `.card` | Card container with hover lift |
|
|
153
|
+
| `.alert` + `.alert-info` / `-success` / `-warning` / `-error` | Callouts |
|
|
154
|
+
| `.gradient-text`, `.gradient-text-1` / `-2` / `-3` | Gradient text |
|
|
155
|
+
| `.gradient-card` | Card with a gradient bar on top |
|
|
156
|
+
| `.gradient-border` | Gradient outline |
|
|
157
|
+
| `.glass-gradient` | Frosted glass card |
|
|
158
|
+
| `.btn-macos` (+ `-primary` `-secondary` `-destructive` `-success`, `-small` `-regular` `-large`, `-rounded` `-capsule`, `-icon`, `-toolbar`, `-loading`), `.btn-macos-group` | macOS-style buttons |
|
|
159
|
+
| `.macos-traffic-lights` / `.macos-traffic-light` | Window dots |
|
|
160
|
+
| `.table-compact`, `.table-dense`, `.table-auto`, `.table-square` | Table variants (on the table or a wrapper) |
|
|
116
161
|
|
|
117
|
-
|
|
162
|
+
## Progress Bar & Page Number
|
|
163
|
+
|
|
164
|
+
Set deck-wide options in the headmatter; a slide's own `progressBar` / `pageNumber` overrides it for that slide.
|
|
118
165
|
|
|
119
|
-
|
|
166
|
+
```yaml
|
|
167
|
+
---
|
|
168
|
+
progressBar: content # always (default) | content | false
|
|
169
|
+
progressBarSkip: 2, 5-6 # pages without the bar (list, ranges, or an array)
|
|
170
|
+
progressBarSkipMode: exclude # hide (default): only hide the bar
|
|
171
|
+
# exclude: also leave skipped pages out of the progress
|
|
172
|
+
pageNumber: false # hide the page number (default: shown, except on title slides)
|
|
173
|
+
|
|
174
|
+
# Exports only (PDF / PNG / ?print); the presentation is unchanged
|
|
175
|
+
progressBarInExport: false
|
|
176
|
+
pageNumberInExport: false
|
|
177
|
+
---
|
|
120
178
|
```
|
|
121
179
|
|
|
122
|
-
##
|
|
180
|
+
## Customization
|
|
123
181
|
|
|
124
|
-
|
|
125
|
-
- **Secondary**: `#6366f1` (Indigo)
|
|
126
|
-
- **Accent**: `#ec4899` (Pink)
|
|
127
|
-
- **Gradient**: Purple → Blue
|
|
182
|
+
Every value below defaults to the theme's look.
|
|
128
183
|
|
|
129
|
-
|
|
184
|
+
**Where to set a variable**
|
|
130
185
|
|
|
131
|
-
- **
|
|
132
|
-
- **
|
|
133
|
-
-
|
|
186
|
+
- **Anywhere** (inline `style`, a wrapper element, or `:root` in your `styles/index.css`): all variables listed below, except the ones in the next point.
|
|
187
|
+
- **On the element** (inline `style`) for component colors that a variant already sets: `--badge-color`, `--story-color`, `--pattern-color`. Prefer the props (`variant`, `color`, `sections`).
|
|
188
|
+
- Effect classes like `anim-border-ocean` or `anim-shimmer-slow` set their variables on the element, so an inline value on that element wins over them.
|
|
134
189
|
|
|
135
|
-
|
|
190
|
+
```html
|
|
191
|
+
<div class="anim-border" style="--ab-c1: #ff6b6b; --ab-duration: 3s">…</div>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
```css
|
|
195
|
+
/* styles/index.css in your deck */
|
|
196
|
+
:root {
|
|
197
|
+
--hover-lift: 8px;
|
|
198
|
+
--glow-intensity: 0.5;
|
|
199
|
+
--table-radius: 0;
|
|
200
|
+
}
|
|
201
|
+
```
|
|
136
202
|
|
|
137
|
-
|
|
203
|
+
### Slides
|
|
204
|
+
|
|
205
|
+
| | Variables |
|
|
206
|
+
|---|---|
|
|
207
|
+
| Content slides | `--slide-padding`, `--slide-padding-x`, `--slide-title-top`, `--slide-font-size` |
|
|
208
|
+
| Emphasis layouts | `--quote-mark-size`, `--quote-size`, `--statement-size`, `--fact-size`, `--full-text-padding` |
|
|
209
|
+
| Utility guards | `--grid-padding-x` (2rem side padding on `grid` inside slides), `--flex-wrap` (`flex` wraps by default), `--absolute-max-width` |
|
|
210
|
+
| Slide transitions | `--slide-transition-duration` |
|
|
211
|
+
| Progress bar / page number | `--progress-height`, `--progress-color`, `--progress-track`, `--progress-glow`, `--page-number-size`, `--page-number-color`, `--page-number-right`, `--page-number-bottom` |
|
|
212
|
+
| Stage indicator | `--stage-done-color`, `--stage-active-color`, `--stage-upcoming-color`, `--stage-dot-size`, `--stage-font-size` |
|
|
213
|
+
|
|
214
|
+
### Components
|
|
215
|
+
|
|
216
|
+
| | Variables |
|
|
217
|
+
|---|---|
|
|
218
|
+
| `<Badge>` | `--badge-color` |
|
|
219
|
+
| `<Kbd>`, gray badge | `--key-bg` (light mode: `--light-key-bg`) |
|
|
220
|
+
| `<StoryBox>` | `--story-color`, `--story-padding`, `--story-radius` |
|
|
221
|
+
| `<PatternCard>` | `--pattern-color` |
|
|
222
|
+
| `<Timeline>` | `--tl-dot-color`, `--tl-active-color`, `--tl-line-color`, `--tl-year-color` |
|
|
223
|
+
| `<Footnote>` | `--footnote-size`, `--footnote-bottom`, `--footnote-left`, `--footnote-right` |
|
|
224
|
+
| `<Countdown>` | `--countdown-size`, `--countdown-color` |
|
|
225
|
+
| `<QRCode>` | `--qrcode-size` |
|
|
226
|
+
| Tables, `<ComplexityTable>` | `--table-radius` (or `.table-square`) |
|
|
227
|
+
| `.card` | `--card-radius`, `--card-padding`, `--card-margin`, `--card-hover-lift` |
|
|
228
|
+
| `.alert` | `--alert-padding`, `--alert-margin`, `--alert-radius`, `--alert-border-width` |
|
|
229
|
+
| `.btn-macos` | `--macos-radius`, `--macos-font-size`, `--macos-padding`, `--macos-height` |
|
|
230
|
+
|
|
231
|
+
### Animations
|
|
232
|
+
|
|
233
|
+
| Effect | Variables | Presets |
|
|
234
|
+
|---|---|---|
|
|
235
|
+
| Entrances (`anim-fade-in` / `-up` / `-left` / `-right`, `anim-pop`) | `--anim-duration`, `--anim-distance`, `--anim-delay`, `--pop-scale` | `anim-delay-1` … `-5` |
|
|
236
|
+
| `anim-float`, `anim-cursor` | `--float-distance`, `--float-duration`, `--cursor-color`, `--cursor-duration` | |
|
|
237
|
+
| `anim-border` | `--ab-c1`, `--ab-c2`, `--ab-c3`, `--ab-dim`, `--ab-len`, `--ab-duration` (`s` or `ms`) | colors `-ocean` `-sunset` `-neon` `-ice` `-fire` `-mint` `-gold`; `-slow` `-fast` `-ccw` |
|
|
238
|
+
| `anim-shimmer` | `--shimmer-color`, `--shimmer-width`, `--shimmer-travel`, `--shimmer-duration` | directions `-right` `-down` `-up` `-diag`; colors `-purple` `-blue` `-green` `-warm` `-neon`; `-slow` `-fast` |
|
|
239
|
+
| `anim-glow` | `--glow` (any color), `--glow-intensity`, `--glow-duration` | colors `-purple` `-blue` `-green` `-red` `-cyan` `-gold` `-neon`; `-slow` `-fast` |
|
|
240
|
+
| `anim-gradient-text` | `--gt-c1` … `--gt-c5`, `--gt-period`, `--gt-duration` | `-ocean` `-sunset` `-fire` `-neon`; `-slow` `-fast` |
|
|
241
|
+
| `hover-lift` / `-scale` / `-tilt` / `-glow` / `-border` / `-gradient` / `-shine` | `--hover-duration`, `--hover-lift`, `--hover-scale`, `--hover-tilt-x`, `--hover-tilt-y`, `--hover-glow`, `--hover-border-c1` / `-c2`, `--hover-gradient-c1` / `-c2`, `--hover-shine-color`, `--hover-shine-width` | `hover-glow-blue`, `hover-glow-green` |
|
|
242
|
+
| Slide transitions (`transition:` frontmatter) | `--slide-transition-duration` | `slide-left` `slide-right` `slide-up` `fade` `scale-fade` `blur-fade` |
|
|
243
|
+
|
|
244
|
+
The animated border light runs at a constant speed along the border (a small script); exports and print show a static gradient ring. All animations respect `prefers-reduced-motion`.
|
|
245
|
+
|
|
246
|
+
## Colors
|
|
247
|
+
|
|
248
|
+
One Dark accents with a purple → blue gradient:
|
|
249
|
+
|
|
250
|
+
| Token | Dark mode | Light mode | Override light |
|
|
251
|
+
|---|---|---|---|
|
|
252
|
+
| `--one-dark-blue` | `#61afef` | `#1f6fb2` | `--light-blue` |
|
|
253
|
+
| `--one-dark-magenta` / `--primary-400` | `#c678dd` | `#9b3fb8` | `--light-magenta` / `--light-primary` |
|
|
254
|
+
| `--one-dark-green` | `#98c379` | `#3d7a1f` | `--light-green` |
|
|
255
|
+
| `--one-dark-yellow` | `#e5c07b` | `#8a6200` | `--light-yellow` |
|
|
256
|
+
| `--one-dark-red` | `#e06c75` | `#b8323f` | `--light-red` |
|
|
257
|
+
| `--one-dark-cyan` | `#56b6c2` | `#157a87` | `--light-cyan` |
|
|
258
|
+
| `--text-primary` / `--text-muted` | `#c0c6d0` / `#858c98` | `#1a1d23` / `#6b7280` | `--light-text-primary` / `--light-text-muted` |
|
|
259
|
+
|
|
260
|
+
Light-mode accents are deeper so text stays readable (≥ 4.5:1) on white. To recolor, set the dark-mode tokens and their light counterparts on `:root`:
|
|
138
261
|
|
|
139
262
|
```css
|
|
140
263
|
:root {
|
|
141
|
-
--primary: #
|
|
142
|
-
--primary
|
|
143
|
-
--primary-dark: #7c3aed;
|
|
144
|
-
--secondary: #6366f1;
|
|
145
|
-
--accent: #ec4899;
|
|
146
|
-
--gradient: linear-gradient(135deg, var(--primary), var(--secondary));
|
|
264
|
+
--primary-400: #a855f7; /* dark mode */
|
|
265
|
+
--light-primary: #7e22ce; /* light mode */
|
|
147
266
|
}
|
|
148
267
|
```
|
|
149
268
|
|
|
150
269
|
## License
|
|
151
270
|
|
|
152
|
-
MIT
|
|
271
|
+
[MIT](LICENSE)
|
package/components/Badge.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span class="badge" :class="`badge-${variant}
|
|
2
|
+
<span class="badge" :class="[`badge-${variant}`, { 'tint-chip': variant !== 'gray' }]">
|
|
3
3
|
<slot />
|
|
4
4
|
</span>
|
|
5
5
|
</template>
|
|
@@ -23,38 +23,26 @@ defineProps({
|
|
|
23
23
|
vertical-align: middle;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.badge
|
|
27
|
-
|
|
28
|
-
color: var(--primary-400, #c678dd);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.badge-blue {
|
|
32
|
-
background: rgba(97, 175, 239, 0.15);
|
|
33
|
-
color: var(--one-dark-blue, #61afef);
|
|
26
|
+
.badge {
|
|
27
|
+
/* default variant; others override */
|
|
28
|
+
--badge-color: var(--primary-400, #c678dd);
|
|
34
29
|
}
|
|
35
30
|
|
|
36
|
-
.badge-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
31
|
+
.badge-blue { --badge-color: var(--one-dark-blue, #61afef); }
|
|
32
|
+
.badge-green { --badge-color: var(--one-dark-green, #98c379); }
|
|
33
|
+
.badge-red { --badge-color: var(--one-dark-red, #e06c75); }
|
|
34
|
+
.badge-yellow { --badge-color: var(--one-dark-yellow, #e5c07b); }
|
|
35
|
+
.badge-cyan { --badge-color: var(--one-dark-cyan, #56b6c2); }
|
|
40
36
|
|
|
41
|
-
.badge
|
|
42
|
-
|
|
43
|
-
color: var(--one-dark-red, #e06c75);
|
|
37
|
+
.badge {
|
|
38
|
+
--tint: var(--badge-color);
|
|
44
39
|
}
|
|
45
40
|
|
|
46
|
-
.badge-yellow {
|
|
47
|
-
background: rgba(229, 192, 123, 0.15);
|
|
48
|
-
color: var(--one-dark-yellow, #e5c07b);
|
|
49
|
-
}
|
|
50
41
|
|
|
51
|
-
.badge-cyan {
|
|
52
|
-
background: rgba(86, 182, 194, 0.15);
|
|
53
|
-
color: var(--one-dark-cyan, #56b6c2);
|
|
54
|
-
}
|
|
55
42
|
|
|
43
|
+
/* Same treatment as <Kbd>: neutral fill with readable text */
|
|
56
44
|
.badge-gray {
|
|
57
|
-
background: var(--bg
|
|
58
|
-
color: var(--text-
|
|
45
|
+
background: var(--key-bg, #4b5263);
|
|
46
|
+
color: var(--text-bright, #e6e6e6);
|
|
59
47
|
}
|
|
60
48
|
</style>
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="complexity-table">
|
|
3
|
-
<div v-if="title" class="ct-title">{{ title }}</div>
|
|
3
|
+
<div v-if="title" class="ct-title tint-chip">{{ title }}</div>
|
|
4
4
|
<table>
|
|
5
5
|
<thead>
|
|
6
6
|
<tr>
|
|
7
|
-
<th>
|
|
8
|
-
<th>Target</th>
|
|
9
|
-
<th>Algorithm</th>
|
|
10
|
-
<th v-if="showComplexity">Complexity</th>
|
|
7
|
+
<th v-for="c in columns" :key="c.key">{{ c.label }}</th>
|
|
11
8
|
</tr>
|
|
12
9
|
</thead>
|
|
13
10
|
<tbody>
|
|
@@ -16,10 +13,7 @@
|
|
|
16
13
|
:key="`row-${row.n}-${i}`"
|
|
17
14
|
:class="{ 'ct-highlight': row.highlight }"
|
|
18
15
|
>
|
|
19
|
-
<td class="ct-
|
|
20
|
-
<td class="ct-target">{{ row.target }}</td>
|
|
21
|
-
<td class="ct-algo">{{ row.algo }}</td>
|
|
22
|
-
<td v-if="showComplexity" class="ct-complexity">{{ row.complexity }}</td>
|
|
16
|
+
<td v-for="c in columns" :key="c.key" :class="`ct-${c.key}`" v-html="richText(row[c.key])" />
|
|
23
17
|
</tr>
|
|
24
18
|
</tbody>
|
|
25
19
|
</table>
|
|
@@ -36,18 +30,23 @@ interface Row {
|
|
|
36
30
|
}
|
|
37
31
|
|
|
38
32
|
const DEFAULT_ROWS: Row[] = [
|
|
39
|
-
{ n: 'N
|
|
40
|
-
{ n: 'N
|
|
41
|
-
{ n: 'N
|
|
42
|
-
{ n: 'N
|
|
43
|
-
{ n: 'N
|
|
44
|
-
{ n: 'N
|
|
45
|
-
{ n: 'N
|
|
33
|
+
{ n: '$N \\le 10$', target: '$O(N!)$', algo: 'Brute Force / Permutation', complexity: '$O(N!)$' },
|
|
34
|
+
{ n: '$N \\le 20$', target: '$O(2^N)$', algo: 'Bitmask DP / Backtracking', complexity: '$O(2^N \\cdot N)$' },
|
|
35
|
+
{ n: '$N \\le 500$', target: '$O(N^3)$', algo: 'Floyd-Warshall / DP', complexity: '$O(N^3)$' },
|
|
36
|
+
{ n: '$N \\le 5{,}000$', target: '$O(N^2)$', algo: 'DP / Brute Force', complexity: '$O(N^2)$' },
|
|
37
|
+
{ n: '$N \\le 10^5$', target: '$O(N \\log N)$', algo: 'Sort / Segment Tree', complexity: '$O(N \\log N)$' },
|
|
38
|
+
{ n: '$N \\le 10^6$', target: '$O(N)$', algo: 'Greedy / Linear Scan', complexity: '$O(N)$' },
|
|
39
|
+
{ n: '$N \\le 10^{18}$', target: '$O(\\log N)$', algo: 'Binary Search / Math', complexity: '$O(\\log N)$' },
|
|
46
40
|
]
|
|
47
41
|
</script>
|
|
48
42
|
|
|
49
43
|
<script setup lang="ts">
|
|
50
|
-
|
|
44
|
+
import { computed } from 'vue'
|
|
45
|
+
|
|
46
|
+
// Cells accept $...$ (KaTeX) and x^y (superscript)
|
|
47
|
+
import { richText } from '../utils/rich-text'
|
|
48
|
+
|
|
49
|
+
const props = defineProps({
|
|
51
50
|
title: { type: String, default: '' },
|
|
52
51
|
rows: {
|
|
53
52
|
type: Array as () => Row[],
|
|
@@ -55,12 +54,23 @@ defineProps({
|
|
|
55
54
|
},
|
|
56
55
|
showComplexity: { type: Boolean, default: true },
|
|
57
56
|
})
|
|
57
|
+
|
|
58
|
+
const COLUMNS = [
|
|
59
|
+
{ key: 'n', label: 'N' },
|
|
60
|
+
{ key: 'target', label: 'Target' },
|
|
61
|
+
{ key: 'algo', label: 'Algorithm' },
|
|
62
|
+
{ key: 'complexity', label: 'Complexity' },
|
|
63
|
+
] as const
|
|
64
|
+
|
|
65
|
+
const columns = computed(() =>
|
|
66
|
+
props.showComplexity ? COLUMNS : COLUMNS.filter(c => c.key !== 'complexity')
|
|
67
|
+
)
|
|
58
68
|
</script>
|
|
59
69
|
|
|
60
70
|
<style scoped>
|
|
61
71
|
.complexity-table {
|
|
62
72
|
margin: 0.75rem 0;
|
|
63
|
-
border-radius: 0.75rem;
|
|
73
|
+
border-radius: var(--table-radius, 0.75rem);
|
|
64
74
|
overflow: hidden;
|
|
65
75
|
border: 1px solid var(--border-default, rgba(255, 255, 255, 0.1));
|
|
66
76
|
background: var(--bg-secondary, #1e2030);
|
|
@@ -70,8 +80,8 @@ defineProps({
|
|
|
70
80
|
font-weight: 700;
|
|
71
81
|
font-size: 0.8rem;
|
|
72
82
|
padding: 0.5rem 1rem;
|
|
73
|
-
|
|
74
|
-
|
|
83
|
+
--tint: var(--primary-400, #c678dd);
|
|
84
|
+
--tint-amount: 10%;
|
|
75
85
|
border-bottom: 1px solid var(--border-default, rgba(255, 255, 255, 0.06));
|
|
76
86
|
letter-spacing: 0.02em;
|
|
77
87
|
}
|
|
@@ -96,7 +106,7 @@ th {
|
|
|
96
106
|
font-size: 0.65rem;
|
|
97
107
|
text-transform: uppercase;
|
|
98
108
|
letter-spacing: 0.06em;
|
|
99
|
-
color: var(--text-
|
|
109
|
+
color: var(--text-primary, #c0c6d0);
|
|
100
110
|
border-bottom: 1px solid var(--border-default, rgba(255, 255, 255, 0.06));
|
|
101
111
|
}
|
|
102
112
|
|
|
@@ -111,22 +121,27 @@ tbody tr:hover {
|
|
|
111
121
|
}
|
|
112
122
|
|
|
113
123
|
.ct-highlight {
|
|
114
|
-
background:
|
|
124
|
+
background: color-mix(in srgb, var(--primary-400) 8%, transparent) !important;
|
|
115
125
|
}
|
|
116
126
|
|
|
117
127
|
.ct-highlight td {
|
|
118
128
|
color: var(--text-primary, #dce0e8);
|
|
119
129
|
}
|
|
120
130
|
|
|
131
|
+
.complexity-table :deep(sup) {
|
|
132
|
+
font-size: 0.7em;
|
|
133
|
+
line-height: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
121
136
|
.ct-n {
|
|
122
|
-
font-family: var(--
|
|
137
|
+
font-family: var(--font-mono);
|
|
123
138
|
font-weight: 600;
|
|
124
139
|
color: var(--one-dark-cyan, #56b6c2);
|
|
125
140
|
white-space: nowrap;
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
.ct-target {
|
|
129
|
-
font-family: var(--
|
|
144
|
+
font-family: var(--font-mono);
|
|
130
145
|
color: var(--one-dark-yellow, #e5c07b);
|
|
131
146
|
white-space: nowrap;
|
|
132
147
|
}
|
|
@@ -136,8 +151,10 @@ tbody tr:hover {
|
|
|
136
151
|
}
|
|
137
152
|
|
|
138
153
|
.ct-complexity {
|
|
139
|
-
font-family: var(--
|
|
154
|
+
font-family: var(--font-mono);
|
|
140
155
|
color: var(--one-dark-green, #98c379);
|
|
141
156
|
white-space: nowrap;
|
|
142
157
|
}
|
|
158
|
+
|
|
159
|
+
|
|
143
160
|
</style>
|