slidetake 0.1.1 → 0.2.1
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 +8 -2
- package/dist/index.html +138 -81
- package/dist/slidetake.js +59 -48
- package/examples/embed.html +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,13 +70,19 @@ window.SLIDETAKE = {
|
|
|
70
70
|
base: location.href, // where relative images resolve
|
|
71
71
|
trail: [{label: "My site", url: "/"}, // the header: the site, down to the deck's section
|
|
72
72
|
{label: "Talks", url: "/talks/"}],
|
|
73
|
-
themeKey: "my-site-theme"
|
|
73
|
+
themeKey: "my-site-theme", // optional: the site's light/dark/auto key
|
|
74
|
+
colors: { // optional: the site's colours instead of Slidetake's green
|
|
75
|
+
light: {accent: "#7a5c12", line: "#f5c542", header: "linear-gradient(135deg,#f5c542,#d4af37)", headerText: "#1a1408"},
|
|
76
|
+
dark: {accent: "#e0b024", line: "#966f04"}
|
|
77
|
+
}
|
|
74
78
|
// recording: true // optional: always show Camera and Record
|
|
75
79
|
};
|
|
76
80
|
</script>
|
|
77
|
-
<script src="https://cdn.jsdelivr.net/npm/slidetake@0.
|
|
81
|
+
<script src="https://cdn.jsdelivr.net/npm/slidetake@0.2.0/dist/slidetake.js"></script>
|
|
78
82
|
```
|
|
79
83
|
|
|
84
|
+
`colors` takes any CSS colour per token, for both modes or under `light` / `dark`: `accent` (text and the current slide), `accentSoft` (smaller headings), `line` (borders and the active path), `ring` (the current slide's outline), `header` and `headerText` (a band of colour behind the header). A deck can also set its own with `accent:` in its top block.
|
|
85
|
+
|
|
80
86
|
Load it from npm through a CDN (pin the version, as above), or copy `dist/slidetake.js` into your site, or `npm install slidetake` and serve `node_modules/slidetake/dist/slidetake.js`.
|
|
81
87
|
|
|
82
88
|
The page then shows that deck, read-only, in one of two modes:
|
package/dist/index.html
CHANGED
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
|
|
38
38
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.2/marked.min.js"></script>
|
|
39
39
|
<style>
|
|
40
|
-
/*
|
|
41
|
-
|
|
40
|
+
/* Every colour comes from these tokens. Slidetake's own is terminal green: bright on zinc in dark mode,
|
|
41
|
+
deep on white in light mode. A host page passes its own (window.SLIDETAKE.colors) and a deck can carry
|
|
42
|
+
its own (accent: in its top block); see applyColors in app.js. */
|
|
42
43
|
:root{
|
|
43
44
|
--bg:#09090b;
|
|
44
45
|
--grid-dot:#1d1d21;
|
|
@@ -46,14 +47,14 @@
|
|
|
46
47
|
--panel-line:#27272a;
|
|
47
48
|
--node-bg:#18181b;
|
|
48
49
|
--node-border:#323238;
|
|
49
|
-
--accent:#
|
|
50
|
-
--accent-teal:#
|
|
50
|
+
--accent:#4ade80;
|
|
51
|
+
--accent-teal:#86efac; /* headings below h2 */
|
|
51
52
|
--text:#e4e4e7;
|
|
52
53
|
--text-muted:#a1a1aa;
|
|
53
54
|
--danger:#e0645c;
|
|
54
55
|
--code-bg:#0f0f12;
|
|
55
56
|
--overlay:rgba(17,17,19,.9); /* breadcrumbs, nav bar, minimap */
|
|
56
|
-
--on-accent:#
|
|
57
|
+
--on-accent:#052e16; /* text on an accent-filled button */
|
|
57
58
|
--card-shadow:0 6px 24px rgba(0,0,0,.35);
|
|
58
59
|
--brand-shadow:0 1px 6px rgba(0,0,0,.6);
|
|
59
60
|
--mono: 'IBM Plex Mono', ui-monospace, monospace;
|
|
@@ -63,16 +64,18 @@
|
|
|
63
64
|
/* Tokens derived from others are declared on body, not :root: a custom property resolves var() where
|
|
64
65
|
it is declared, so on :root these would freeze the default palette's colours. */
|
|
65
66
|
body{
|
|
66
|
-
--accent-line:#
|
|
67
|
+
--accent-line:#15803d; /* borders and connector lines on the active path */
|
|
67
68
|
--accent-ring:var(--accent); /* the current slide's border, glow and the progress bar */
|
|
68
69
|
--edge:var(--node-border); /* connector lines off the active path */
|
|
70
|
+
--header-bg:none; /* a host's band of colour behind the header (an image layer) */
|
|
71
|
+
--header-ink:var(--text); /* text on that band */
|
|
69
72
|
}
|
|
70
|
-
/* Light mode (L, mode: light, ?mode=light): #
|
|
73
|
+
/* Light mode (L, mode: light, ?mode=light): #15803d carries text (5.0:1 on white); the brighter green
|
|
71
74
|
only rings and lines, which never need to be read. */
|
|
72
75
|
body[data-mode="light"]{
|
|
73
76
|
--bg:#fafaf9; --grid-dot:#e7e5e4; --panel:#ffffff; --panel-line:#e4e4e7;
|
|
74
77
|
--node-bg:#ffffff; --node-border:#e4e4e7; --edge:#d4d4d8;
|
|
75
|
-
--accent:#
|
|
78
|
+
--accent:#15803d; --accent-teal:#166534; --accent-line:#4ade80; --accent-ring:#22c55e;
|
|
76
79
|
--text:#27272a; --text-muted:#71717a; --danger:#c2410c;
|
|
77
80
|
--code-bg:#f4f4f5; --overlay:rgba(255,255,255,.92); --on-accent:#ffffff;
|
|
78
81
|
--card-shadow:0 4px 18px rgba(24,24,27,.08); --brand-shadow:0 1px 4px rgba(255,255,255,.9);
|
|
@@ -98,10 +101,14 @@
|
|
|
98
101
|
min-height:56px;flex:none;
|
|
99
102
|
display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;
|
|
100
103
|
padding:8px 16px;
|
|
101
|
-
background:var(--panel);
|
|
104
|
+
background:var(--header-bg), var(--panel);
|
|
102
105
|
border-bottom:1px solid var(--panel-line);
|
|
103
106
|
z-index:20;
|
|
104
107
|
}
|
|
108
|
+
/* a host's coloured header band: its own ink for the text, buttons and borders on it */
|
|
109
|
+
body.st-header-color header{color:var(--header-ink);border-bottom-color:transparent;
|
|
110
|
+
--text:var(--header-ink);--text-muted:color-mix(in srgb, var(--header-ink) 72%, transparent);
|
|
111
|
+
--node-border:color-mix(in srgb, var(--header-ink) 28%, transparent);}
|
|
105
112
|
.brand{display:flex;align-items:baseline;gap:10px;}
|
|
106
113
|
.brand .mark{font-family:var(--display);font-weight:700;font-size:17px;letter-spacing:.02em;color:inherit;text-decoration:none;display:inline-flex;align-items:center;gap:7px;align-self:center;}
|
|
107
114
|
.brand .mark .logo{width:20px;height:20px;fill:var(--accent);flex:none;}
|
|
@@ -455,7 +462,7 @@
|
|
|
455
462
|
.node.card-full.img-overlay .body figure.media img{object-fit:cover;}
|
|
456
463
|
.node.img-overlay .body figure.media figcaption{position:absolute;left:0;right:0;bottom:0;padding:36px 18px 14px;
|
|
457
464
|
color:#f4f4f5;background:linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.78));}
|
|
458
|
-
.node.img-overlay .body .gallery.carousel figure.media figcaption::before{color
|
|
465
|
+
.node.img-overlay .body .gallery.carousel figure.media figcaption::before{color:color-mix(in srgb, var(--accent) 55%, #fff);}
|
|
459
466
|
/* <!-- view: full -->: a 16:9 card that fills the screen, with the map and breadcrumbs out of the way */
|
|
460
467
|
div.node.card-full{height:540px;overflow:hidden;}
|
|
461
468
|
body.full-card #breadcrumbs, body.full-card #minimap{opacity:0;pointer-events:none;}
|
|
@@ -550,10 +557,10 @@
|
|
|
550
557
|
#brand .st-mark .logo{width:24px;height:24px;fill:var(--accent);}
|
|
551
558
|
#brand .st-mark .word > span{color:var(--accent);}
|
|
552
559
|
#brand img{height:40px;width:auto;display:block;}
|
|
553
|
-
/* optional
|
|
560
|
+
/* optional accent chip, as on the decks' title slides (brand_style: chip); plain text is the default */
|
|
554
561
|
#brand .chip{display:inline-block;padding:5px 22px;border-radius:30px;color:#fff;font-family:var(--body);
|
|
555
562
|
font-size:15px;font-weight:600;letter-spacing:.01em;text-shadow:none;
|
|
556
|
-
background:linear-gradient(90deg,
|
|
563
|
+
background:linear-gradient(90deg, var(--accent-line), color-mix(in srgb, var(--accent-line) 80%, #000));box-shadow:0 2px 10px rgba(0,0,0,.25);}
|
|
557
564
|
|
|
558
565
|
/* PIP camera: slides are laid out to keep clear of this box */
|
|
559
566
|
#pip{
|
|
@@ -698,12 +705,12 @@
|
|
|
698
705
|
<tr><td><kbd>↓</kbd> <kbd>↑</kbd></td><td>first child / parent</td></tr>
|
|
699
706
|
<tr><td><kbd>O</kbd></td><td>the whole map; <kbd>O</kbd> or <kbd>Esc</kbd> goes back</td></tr>
|
|
700
707
|
<tr><td><kbd>1</kbd>–<kbd>4</kbd></td><td>tree, radial, path, focus</td></tr>
|
|
701
|
-
<tr><td><kbd>F</kbd></td><td>fullscreen</td></tr>
|
|
708
|
+
<tr><td><kbd>F</kbd></td><td>fullscreen; <kbd>F</kbd> or <kbd>Esc</kbd> leaves</td></tr>
|
|
702
709
|
<tr><td><kbd>+</kbd> <kbd>−</kbd></td><td>bigger / smaller slides</td></tr>
|
|
703
710
|
<tr><td><kbd>E</kbd></td><td>editor: write, open, share</td></tr>
|
|
704
711
|
<tr><td><kbd>L</kbd></td><td>light / dark</td></tr>
|
|
705
712
|
<tr class="rec"><td><kbd>C</kbd> <kbd>V</kbd> <kbd>R</kbd></td><td>camera, camera layouts, record</td></tr>
|
|
706
|
-
<tr><td><kbd>K</kbd> <kbd>?</kbd></td><td>this card</td></tr>
|
|
713
|
+
<tr><td><kbd>K</kbd> <kbd>?</kbd></td><td>this card; again or <kbd>Esc</kbd> closes it</td></tr>
|
|
707
714
|
</table>
|
|
708
715
|
<p>Drag to pan, scroll or pinch to zoom, click a card to fly to it.</p>
|
|
709
716
|
<p><a href="/help" target="_blank" rel="noopener">The full guide →</a> writing decks, sharing, recording, camera, review and cut.</p>
|
|
@@ -849,7 +856,7 @@
|
|
|
849
856
|
var sample_default = "---\ntitle: Slidetake \u2014 write in markdown, record without timeline editing\nbrand: slidetake\npip: bottom-right\n---\n\n<!-- camera: on, full, on -->\n\n#  Slidetake\n\n**Write in markdown. Present on a spatial canvas. Record without timeline editing.**\n\nFor developers and technical educators who explain things on video. You're inside a Slidetake deck right now: press \u2192 to walk it, **O** for the map.\n\n## \u2702\uFE0F Stop editing on a timeline\n\n**Retake by slide.** The slide is the timeline marker, so a fumbled line costs one press, not an editing session.\n\n### Every slide is a take\n\nStumbled on a slide? Press \u2190 and say it again. Every attempt is kept, and recording carries on.\n\n### Pick, don't scrub\n\nChoose the best take of each slide. Slidetake writes the frame-exact **ffmpeg** cut, the YouTube **chapters** and the description.\n\n## \u{1F5FA}\uFE0F A map, not a stack\n\n<!-- view: overview -->\n\nYour headings are the hierarchy: zoom out for the whole system, zoom in for one part. This slide just showed you the map.\n\n### Headings become cards\n\n`#` is the first card, `##` branches from it, `###` goes a level deeper. No layout to draw.\n\n### A path your viewer can follow\n\n\u2192 always walks the same order, and **path** lays it out as a staircase, so the audience never loses its place.\n\n## \u{1F3A5} The camera is part of the deck\n\n<!-- camera: on, full, on -->\n\nA comment in a slide moves you: corner, full screen, or off. Turn on **Camera** and watch this slide do it.\n\n### Broadcast-quality recording\n\n**[OBS](https://obsproject.com)** records at full quality; Slidetake drives it. No scenes to switch, no recording to watch.\n\n### One session, one finished video\n\nWrite, present and record in one sitting. What comes out is ready to upload.\n\n## \u270D\uFE0F Plain text in\n\nMarkdown you already know: headings, lists, tables, code, diagrams, charts, images and YouTube links. [See every example \u2192](/examples)\n\n### Your copy\n\nType in any deck, this one included, and it becomes your own copy. The original stays as it is.\n\n### Open and share\n\n**\u21E3 Load** a GitHub file or gist, start from a template, and **Share** a link with the deck inside it.\n\n## \u{1F49B} Free and open\n\nOpen source, Apache 2.0: [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake).\n\nEverything else is in the guide: **[slidetake.com/help](/help)**.\n";
|
|
850
857
|
|
|
851
858
|
// src/help.md
|
|
852
|
-
var help_default = "---\ntitle: Slidetake help\nbrand: slidetake\npip: none\n---\n\n#  Slidetake help\n\nThe details behind the [home deck](/): writing, sharing, presenting, recording and the camera. Press \u2192 to read in order, \u2193 \u2191 to go into a section and back out, or **O** for the whole map.\n\n## \u270D\uFE0F Writing a deck\n\nA deck is an ordinary markdown file. **Every heading becomes a card**, and a heading branches off the nearest shallower heading above it.\n\n```md\n# Product \u2190 the first card\nIntro text.\n\n## Pricing \u2190 branches from Product\n### Enterprise \u2190 branches from Pricing\n## Roadmap {#plan} \u2190 branches from Product, id \"plan\"\n\nSee the [roadmap](#plan).\n```\n\n### Rules\n\n- Text before the first heading becomes a card of its own.\n- Headings inside fenced code blocks are ignored.\n- A card's id is its heading slugified (`## Moving around` \u2192 `moving-around`), or set one with `{#id}` at the end of the heading.\n- A link to `#id` flies to that card.\n\n### What a card can hold\n\nPlain markdown, and the layout follows from what's on the card. [See every one \u2192](/examples)\n\n| Write | Get |\n|---|---|\n| `<!-- steps -->` before a list | one item per press |\n| ` ```dot `, ` ```d2 ` | a Graphviz or D2 diagram |\n| ` ```echarts ` with JSON options | a chart, in the deck's colors for dark and light |\n| ` ```svg ` or `` | an SVG drawing |\n| an image alone | an image card: a phone shot sits beside the heading and caption, a landscape one spans the card between them, a 16:9 one fills it |\n| an image and text | a split card: the image sits on the side written first |\n| a list of images | a gallery; with `<!-- steps -->` a carousel, one image per press, laid out like an image card |\n| `<!-- view: full -->` in a card | the card fills the whole screen |\n| images in one paragraph | a grid, up to four a row |\n| a YouTube link alone on a line | the video: the next press plays it, leaving pauses it |\n\nThe first and last cards animate in on their own. The alt text of an image is its caption.\n\n### reveal.js decks\n\nDecks written for reveal.js open as they are: `---` starts a slide and `--` a vertical one beneath it, and the first slide becomes the root card.\n\nSupported: fragments (`fade-up`, `fade-in-then-out`, `grow`, \u2026, one per \u2192), `r-stack`, `<!-- .element: \u2026 -->`, `<section>` slides, `data-autoslide`, Graphviz `dot` diagrams, ECharts charts, `data-gsap` entrance animations and `title-scramble`.\n\n### Older +++ decks\n\nDecks that separate slides with `+++` and use `id`, `parent`, `x`, `y` frontmatter still load.\n\n### Wide content\n\nCards widen for wide tables, columns, diagrams and embeds; anything wider still is scaled to fit.\n\n## \u{1F517} Opening, editing and sharing\n\nEvery deck you open is **read-only**: Slidetake's own decks, templates, files on the web and shared links. Viewing one never changes anything.\n\n**Type in it**, and it becomes **your copy**, at `/edit`. Your copy lives in this browser, remembers where it came from, and is there whenever you come back: the **Your copy \u2192** button at the top takes you to it.\n\n### Where decks come from\n\nPress **\u270E Editor**, then **\u21E3 Load**, and paste a link: a GitHub file or folder, a gist, or any URL that lets other sites read it. Or link straight to a deck:\n\n| Link | Opens |\n|---|---|\n| `/gh/owner/repo/path/deck.md` | a GitHub file, default branch |\n| `/gh/owner/repo@branch/deck.md` | another branch or tag |\n| `/gist/<id>` | a gist's first markdown file |\n| `/?src=https://\u2026/deck.md` | anything else |\n| `/share#deflate:\u2026` | a shared deck, carried inside the link |\n| `/new` | a template: blank, talk or recording |\n\nImages next to the deck load as they are. **Open** opens a markdown file from your computer, straight into your copy.\n\n### Your copy\n\nThere's one working copy at a time. The editor bar says whose copy it is, and marks **edited** while it has changes you haven't saved or shared.\n\n- **Reset to original** throws your edits away and goes back to the deck you started from.\n- Starting a new copy, by typing in another deck or opening a file, asks first if the old one has edits you haven't kept.\n\n### Saving and sharing\n\n**Save** downloads your markdown as a file. **Share** copies a link: the short link while your copy still matches an online original, and otherwise a `/share#deflate:\u2026` link with the whole deck compressed inside it. That part of a link is never sent to a server, so nothing is uploaded. Shared links never include `?obs=`.\n\nFor a file from your computer whose images sit next to it online, add `base: https://\u2026/deck-folder/` to its top block.\n\n### Address options\n\n| Option | Does |\n|---|---|\n| `?edit=1` | opens the editor |\n| `?layout=tree` (radial, path, focus) | picks the layout |\n| `?mode=light` | light theme |\n| `?duration=10m` | talk length for the timer |\n| `#card-id` | opens at a card |\n\n## \u{1F9ED} Moving around\n\n| Key | Does |\n|---|---|\n| \u2192 \u2190 Space | next / previous step, in document order |\n| \u2193 \u2191 | first child / parent |\n| O | the whole map; O or Esc goes back to your slide |\n| 1 2 3 4 | tree, radial, path, focus |\n| F | fullscreen |\n| + \u2212 | bigger / smaller slides (remembered) |\n| E | editor |\n| L | light / dark |\n| K or ? | keys (also \u2328 Keys on screen) |\n| C \xB7 V \xB7 R | camera, camera layouts, record |\n\nClick a card to fly to it. Drag to pan; scroll or pinch to zoom. On a touch screen, the bottom bar adds \u2190 \u2192 buttons.\n\n### Layouts\n\n**Tree** is a top-down chart and **radial** rings out from the root.\n\n**Path** is made for video: a staircase in presenting order. Each section is a row, and the next one starts just below where the last ended, so every move is a short step right or down.\n\n**Focus** doesn't travel at all: the next slide fades in where the last one was.\n\n### Steady text\n\nText keeps one size within a section and only changes when the section does. Charts and diagrams are fitted on their own.\n\n### Map moments\n\n`<!-- view: overview -->` on a slide pulls back to the whole map for a beat before flying in: a good start to a chapter.\n\n## \u{1F3AC} Presenting\n\n**F** goes fullscreen. The current slide fills the screen, and the cursor and controls hide after two seconds without the mouse moving.\n\n### Progress and talk timer\n\nWhile presenting, a thin bar along the bottom fills with every press.\n\nGive the deck a length, `duration: 10m` (or `90s`, `1h`, `12:30`), and a lighter layer of the same colour grows behind it with the clock: if the lighter stretch shows past the solid fill, you're behind; if it reaches the end, the bar pulses.\n\nThe timer is for you, so recordings show progress only, unless the deck says `timer: always`. `progress: off` hides the bar.\n\n## \u23FA\uFE0F Recording\n\nRecording needs **[OBS Studio](https://obsproject.com)** (free) with its WebSocket server on: in OBS, Tools \u2192 WebSocket Server Settings. OBS records; Slidetake drives it.\n\n### Connecting to OBS\n\nPress **\u25CF Record** and enter where OBS is: host, port and the password from OBS's WebSocket settings. Tick *Remember* to skip this next time.\n\n`?obs=localhost:4455` (or `?obs=host:port:password`) in the address fills this in and connects as the page opens.\n\n### A 16:9 screen\n\nYouTube is 16:9, and many laptop screens aren't. The Record dialog checks yours: if it isn't 16:9, move the window to a screen that is, physical or virtual (say 1920\xD71080), and press **F** there.\n\n### OBS on another computer\n\nFrom https://slidetake.com, OBS must be on the same computer (`localhost`): browsers block secure pages from reaching plain `ws://` addresses elsewhere. For OBS on another machine, serve a local copy of [`dist/index.html`](https://github.com/slidetake/slidetake) over http.\n\n### Taking a take\n\n**\u25CF Record** (or **R**) connects to OBS, counts down and starts recording. From then on the deck drives everything: camera layouts, reveals and slides follow \u2192 (a Bluetooth clicker works).\n\n- **\u2190** takes the current slide again, keeping every attempt\n- **B** pauses and resumes\n- one press past the last step stops OBS\n\nClicks, dragging and the map are locked so the take only moves forward.\n\n### Review and cut\n\nThen the review opens: every slide with its takes (the last one picked), previews from the OBS file, a ready-to-run **ffmpeg** command for the picked takes (frame-exact), and the YouTube title, description with **chapters** and links, and tags.\n\nSessions are kept in this browser, so a take can be reviewed again later from \u25CF Record.\n\n## \u{1F4F7} Camera\n\n**C** (or **Camera** in the bottom bar) turns your webcam on in its box; a plain screen recording then captures you and the slides together. The camera is off every time the page opens, and until it's on, the deck's camera settings are ignored, so readers get slides using the whole screen.\n\n### Deck settings\n\nAn optional block at the top of the file:\n\n```yaml\n---\nbrand: example.com/talks \u2190 text in the top-right corner\nlogo: https://\u2026/logo.png \u2190 image beside it\npip: bottom-right \u2190 camera corner, or none\npip_size: 24% \u2190 camera box width\npip_shape: rect \u2190 rect (16:9) or circle\npip_mirror: yes \u2190 mirror the webcam\ncamera: 24%, 40%, full, off \u2190 layouts V cycles through\n---\n```\n\nSlides are always placed clear of the brand and the camera box.\n\n### Camera per slide\n\nA comment in a slide changes the camera from that slide on:\n\n```md\n## Intro\n<!-- camera: full --> \u2190 camera fills the screen\n\n## Pricing\n<!-- camera: 18% flip --> \u2190 small, on the other side\n```\n\nWords you can combine: `on`, `off`, `full`, a size like `30%`, a corner, `flip`, `circle` / `rect`, `mirror` / `unmirror`.\n\n### Several steps on one slide\n\nList layouts with commas to step through them: `full, on` opens full screen on you, and the next \u2192 shrinks the camera to its corner and shows the slide. `on, full, on, off` ends a closing slide on you, then the slide again, then without the camera.\n\n**V** steps through the deck's `camera:` list for the current slide.\n\n## \u{1F4CB} Publish pack\n\nThe review fills the YouTube description from the deck's top block:\n\n| Key | Used for |\n|---|---|\n| `title` | the video title |\n| `summary` | the description's first paragraph |\n| `related` | a list of `[Title](url)` links |\n| `tags` | tags (any other list ending in `_tags` is added too) |\n| `permalink` or `site` | the link back to the deck |\n\n## \u{1F512} Your data\n\nYour draft and settings stay in this browser. Decks inside links live in the part of the address after `#`, which browsers never send to a server. Slidetake has no accounts and stores no decks.\n\nslidetake.com counts visits with Google Analytics. What it records leaves out the `#` part and `?obs=`, so neither your deck nor an OBS password reaches it. Copies you host yourself send nothing.\n\nSlidetake is open source: [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake).\n";
|
|
859
|
+
var help_default = "---\ntitle: Slidetake help\nbrand: slidetake\npip: none\n---\n\n#  Slidetake help\n\nThe details behind the [home deck](/): writing, sharing, presenting, recording and the camera. Press \u2192 to read in order, \u2193 \u2191 to go into a section and back out, or **O** for the whole map.\n\n## \u270D\uFE0F Writing a deck\n\nA deck is an ordinary markdown file. **Every heading becomes a card**, and a heading branches off the nearest shallower heading above it.\n\n```md\n# Product \u2190 the first card\nIntro text.\n\n## Pricing \u2190 branches from Product\n### Enterprise \u2190 branches from Pricing\n## Roadmap {#plan} \u2190 branches from Product, id \"plan\"\n\nSee the [roadmap](#plan).\n```\n\n### Rules\n\n- Text before the first heading becomes a card of its own.\n- Headings inside fenced code blocks are ignored.\n- A card's id is its heading slugified (`## Moving around` \u2192 `moving-around`), or set one with `{#id}` at the end of the heading.\n- A link to `#id` flies to that card.\n\n### What a card can hold\n\nPlain markdown, and the layout follows from what's on the card. [See every one \u2192](/examples)\n\n| Write | Get |\n|---|---|\n| `<!-- steps -->` before a list | one item per press |\n| ` ```dot `, ` ```d2 ` | a Graphviz or D2 diagram |\n| ` ```echarts ` with JSON options | a chart, in the deck's colors for dark and light |\n| ` ```svg ` or `` | an SVG drawing |\n| an image alone | an image card: a phone shot sits beside the heading and caption, a landscape one spans the card between them, a 16:9 one fills it |\n| an image and text | a split card: the image sits on the side written first |\n| a list of images | a gallery; with `<!-- steps -->` a carousel, one image per press, laid out like an image card |\n| `<!-- view: full -->` in a card | the card fills the whole screen |\n| images in one paragraph | a grid, up to four a row |\n| a YouTube link alone on a line | the video: the next press plays it, leaving pauses it |\n\nThe first and last cards animate in on their own. The alt text of an image is its caption.\n\n### reveal.js decks\n\nDecks written for reveal.js open as they are: `---` starts a slide and `--` a vertical one beneath it, and the first slide becomes the root card.\n\nSupported: fragments (`fade-up`, `fade-in-then-out`, `grow`, \u2026, one per \u2192), `r-stack`, `<!-- .element: \u2026 -->`, `<section>` slides, `data-autoslide`, Graphviz `dot` diagrams, ECharts charts, `data-gsap` entrance animations and `title-scramble`.\n\n### Older +++ decks\n\nDecks that separate slides with `+++` and use `id`, `parent`, `x`, `y` frontmatter still load.\n\n### Wide content\n\nCards widen for wide tables, columns, diagrams and embeds; anything wider still is scaled to fit.\n\n## \u{1F517} Opening, editing and sharing\n\nEvery deck you open is **read-only**: Slidetake's own decks, templates, files on the web and shared links. Viewing one never changes anything.\n\n**Type in it**, and it becomes **your copy**, at `/edit`. Your copy lives in this browser, remembers where it came from, and is there whenever you come back: the **Your copy \u2192** button at the top takes you to it.\n\n### Where decks come from\n\nPress **\u270E Editor**, then **\u21E3 Load**, and paste a link: a GitHub file or folder, a gist, or any URL that lets other sites read it. Or link straight to a deck:\n\n| Link | Opens |\n|---|---|\n| `/gh/owner/repo/path/deck.md` | a GitHub file, default branch |\n| `/gh/owner/repo@branch/deck.md` | another branch or tag |\n| `/gist/<id>` | a gist's first markdown file |\n| `/?src=https://\u2026/deck.md` | anything else |\n| `/share#deflate:\u2026` | a shared deck, carried inside the link |\n| `/new` | a template: blank, talk or recording |\n\nImages next to the deck load as they are. **Open** opens a markdown file from your computer, straight into your copy.\n\n### Your copy\n\nThere's one working copy at a time. The editor bar says whose copy it is, and marks **edited** while it has changes you haven't saved or shared.\n\n- **Reset to original** throws your edits away and goes back to the deck you started from.\n- Starting a new copy, by typing in another deck or opening a file, asks first if the old one has edits you haven't kept.\n\n### Saving and sharing\n\n**Save** downloads your markdown as a file. **Share** copies a link: the short link while your copy still matches an online original, and otherwise a `/share#deflate:\u2026` link with the whole deck compressed inside it. That part of a link is never sent to a server, so nothing is uploaded. Shared links never include `?obs=`.\n\nFor a file from your computer whose images sit next to it online, add `base: https://\u2026/deck-folder/` to its top block.\n\n### Address options\n\n| Option | Does |\n|---|---|\n| `?edit=1` | opens the editor |\n| `?layout=tree` (radial, path, focus) | picks the layout |\n| `?mode=light` | light theme |\n| `?duration=10m` | talk length for the timer |\n| `#card-id` | opens at a card |\n\n## \u{1F9ED} Moving around\n\n| Key | Does |\n|---|---|\n| \u2192 \u2190 Space | next / previous step, in document order |\n| \u2193 \u2191 | first child / parent |\n| O | the whole map; O or Esc goes back to your slide |\n| 1 2 3 4 | tree, radial, path, focus |\n| F | fullscreen |\n| + \u2212 | bigger / smaller slides (remembered) |\n| E | editor |\n| L | light / dark |\n| K or ? | keys (also \u2328 Keys on screen) |\n| C \xB7 V \xB7 R | camera, camera layouts, record |\n\nClick a card to fly to it. Drag to pan; scroll or pinch to zoom. On a touch screen, the bottom bar adds \u2190 \u2192 buttons.\n\n### Layouts\n\n**Tree** is a top-down chart and **radial** rings out from the root.\n\n**Path** is made for video: a staircase in presenting order. Each section is a row, and the next one starts just below where the last ended, so every move is a short step right or down.\n\n**Focus** doesn't travel at all: the next slide fades in where the last one was.\n\n### Steady text\n\nText keeps one size within a section and only changes when the section does. Charts and diagrams are fitted on their own.\n\n### Map moments\n\n`<!-- view: overview -->` on a slide pulls back to the whole map for a beat before flying in: a good start to a chapter.\n\n## \u{1F3AC} Presenting\n\n**F** goes fullscreen, and **F** again (or **Esc**) leaves. The current slide fills the screen, and the cursor and controls hide after two seconds without the mouse moving.\n\n### Progress and talk timer\n\nWhile presenting, a thin bar along the bottom fills with every press.\n\nGive the deck a length, `duration: 10m` (or `90s`, `1h`, `12:30`), and a lighter layer of the same colour grows behind it with the clock: if the lighter stretch shows past the solid fill, you're behind; if it reaches the end, the bar pulses.\n\nThe timer is for you, so recordings show progress only, unless the deck says `timer: always`. `progress: off` hides the bar.\n\n## \u23FA\uFE0F Recording\n\nRecording needs **[OBS Studio](https://obsproject.com)** (free) with its WebSocket server on: in OBS, Tools \u2192 WebSocket Server Settings. OBS records; Slidetake drives it.\n\n### Connecting to OBS\n\nPress **\u25CF Record** and enter where OBS is: host, port and the password from OBS's WebSocket settings. Tick *Remember* to skip this next time.\n\n`?obs=localhost:4455` (or `?obs=host:port:password`) in the address fills this in and connects as the page opens.\n\n### A 16:9 screen\n\nYouTube is 16:9, and many laptop screens aren't. The Record dialog checks yours: if it isn't 16:9, move the window to a screen that is, physical or virtual (say 1920\xD71080), and press **F** there.\n\n### OBS on another computer\n\nFrom https://slidetake.com, OBS must be on the same computer (`localhost`): browsers block secure pages from reaching plain `ws://` addresses elsewhere. For OBS on another machine, serve a local copy of [`dist/index.html`](https://github.com/slidetake/slidetake) over http.\n\n### Taking a take\n\n**\u25CF Record** (or **R**) connects to OBS, counts down and starts recording. From then on the deck drives everything: camera layouts, reveals and slides follow \u2192 (a Bluetooth clicker works).\n\n- **\u2190** takes the current slide again, keeping every attempt\n- **B** pauses and resumes\n- one press past the last step stops OBS\n\nClicks, dragging and the map are locked so the take only moves forward.\n\n### Review and cut\n\nThen the review opens: every slide with its takes (the last one picked), previews from the OBS file, a ready-to-run **ffmpeg** command for the picked takes (frame-exact), and the YouTube title, description with **chapters** and links, and tags.\n\nSessions are kept in this browser, so a take can be reviewed again later from \u25CF Record.\n\n## \u{1F4F7} Camera\n\n**C** (or **Camera** in the bottom bar) turns your webcam on in its box; a plain screen recording then captures you and the slides together. The camera is off every time the page opens, and until it's on, the deck's camera settings are ignored, so readers get slides using the whole screen.\n\n### Deck settings\n\nAn optional block at the top of the file:\n\n```yaml\n---\nbrand: example.com/talks \u2190 text in the top-right corner\nlogo: https://\u2026/logo.png \u2190 image beside it\npip: bottom-right \u2190 camera corner, or none\npip_size: 24% \u2190 camera box width\npip_shape: rect \u2190 rect (16:9) or circle\npip_mirror: yes \u2190 mirror the webcam\ncamera: 24%, 40%, full, off \u2190 layouts V cycles through\naccent: \"#3b82f6\" \u2190 the deck's colour, instead of Slidetake's green\n---\n```\n\n`accent` is one colour; Slidetake sets it bright for dark mode and deep enough to read on white for light mode, and uses it for text accents, lines, charts and diagrams.\n\nSlides are always placed clear of the brand and the camera box.\n\n### Camera per slide\n\nA comment in a slide changes the camera from that slide on:\n\n```md\n## Intro\n<!-- camera: full --> \u2190 camera fills the screen\n\n## Pricing\n<!-- camera: 18% flip --> \u2190 small, on the other side\n```\n\nWords you can combine: `on`, `off`, `full`, a size like `30%`, a corner, `flip`, `circle` / `rect`, `mirror` / `unmirror`.\n\n### Several steps on one slide\n\nList layouts with commas to step through them: `full, on` opens full screen on you, and the next \u2192 shrinks the camera to its corner and shows the slide. `on, full, on, off` ends a closing slide on you, then the slide again, then without the camera.\n\n**V** steps through the deck's `camera:` list for the current slide.\n\n## \u{1F4CB} Publish pack\n\nThe review fills the YouTube description from the deck's top block:\n\n| Key | Used for |\n|---|---|\n| `title` | the video title |\n| `summary` | the description's first paragraph |\n| `related` | a list of `[Title](url)` links |\n| `tags` | tags (any other list ending in `_tags` is added too) |\n| `permalink` or `site` | the link back to the deck |\n\n## \u{1F512} Your data\n\nYour draft and settings stay in this browser. Decks inside links live in the part of the address after `#`, which browsers never send to a server. Slidetake has no accounts and stores no decks.\n\nslidetake.com counts visits with Google Analytics. What it records leaves out the `#` part and `?obs=`, so neither your deck nor an OBS password reaches it. Copies you host yourself send nothing.\n\nSlidetake is open source: [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake).\n";
|
|
853
860
|
|
|
854
861
|
// examples/blank.md
|
|
855
862
|
var blank_default = "---\ntitle: My deck\n---\n\n# My deck\n\nStart typing: this becomes your own copy, and the template stays as it is.\n\n## A section\n\nEvery heading is a card. `##` sections branch from the first card.\n\n### A detail\n\n`###` branches from the section above it.\n";
|
|
@@ -861,7 +868,7 @@
|
|
|
861
868
|
var recording_default = "---\ntitle: Video title\nduration: 10m\npip: bottom-right\npip_size: 24%\ncamera: 24%, 40%, full, off\n---\n\n<!-- camera: full, on -->\n\n# Video title\n\nOpens full screen on you; the next press shows this slide with you in the corner.\n\n## \u{1F4CC} Disclaimer\n\n<!-- camera: off, on -->\n\nOpens without the camera, so the text has the whole screen; the next press brings you back.\n\n## \u{1F9ED} Contents\n\n- Part one\n- Part two\n- Part three\n\n## \u{1F539} Part one\n\n<!-- view: overview -->\n\nThe overview comment pulls back to the whole map first: a good start to a chapter.\n\n### A detail\n\nSlides you talk over in the corner.\n\n## \u{1F538} Part two\n\n### A detail\n\n## \u{1F537} Part three\n\n### A detail\n\n## \u{1F64F} Thanks for watching\n\n<!-- camera: on, full, on, off -->\n\nEnds on you full screen, then back to the slide, then without the camera.\n";
|
|
862
869
|
|
|
863
870
|
// examples/showcase.md
|
|
864
|
-
var showcase_default = '---\ntitle: Slidetake examples\nbrand: slidetake\nduration: 10m\n---\n\n# Slidetake examples\n\nEverything a deck can hold, written in plain markdown. Open **\u270E Editor** to see the source of any card, or press **O** for the map.\n\n## \u270D\uFE0F Text\n\nParagraphs, **bold**, *italic*, `code`, [links](https://slidetake.com) and lists, as markdown writes them.\n\n- One point\n- Another point\n - A detail under it\n\n### Steps\n\nPut `<!-- steps -->` before a list and it reveals one item per press:\n\n<!-- steps -->\n- First, the problem\n- Then, the idea\n- Finally, the result\n\n### Quotes and tables\n\n> A quote stands out from the text around it.\n\n| Plan | Price | Users |\n|---|---:|---:|\n| Free | \u20B90 | 1 |\n| Team | \u20B9499 | 10 |\n\n### Code\n\n```python\ndef take(slide):\n return slide.best_attempt()\n```\n\n## \u{1F9ED} Diagrams\n\nWrite the diagram in a fenced block named after its language.\n\n### Graphviz\n\n```dot\ndigraph {\n rankdir=LR\n node [shape=box style=rounded]\n Markdown -> Deck -> Takes -> Video\n}\n```\n\n### D2\n\n```d2\ndirection: right\nwrite: Write {shape: rectangle}\npresent: Present\nrecord: Record\nwrite -> present -> record: one session\n```\n\n### SVG\n\n```svg\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 120">\n <rect x="10" y="20" width="90" height="80" rx="10" fill="#
|
|
871
|
+
var showcase_default = '---\ntitle: Slidetake examples\nbrand: slidetake\nduration: 10m\n---\n\n# Slidetake examples\n\nEverything a deck can hold, written in plain markdown. Open **\u270E Editor** to see the source of any card, or press **O** for the map.\n\n## \u270D\uFE0F Text\n\nParagraphs, **bold**, *italic*, `code`, [links](https://slidetake.com) and lists, as markdown writes them.\n\n- One point\n- Another point\n - A detail under it\n\n### Steps\n\nPut `<!-- steps -->` before a list and it reveals one item per press:\n\n<!-- steps -->\n- First, the problem\n- Then, the idea\n- Finally, the result\n\n### Quotes and tables\n\n> A quote stands out from the text around it.\n\n| Plan | Price | Users |\n|---|---:|---:|\n| Free | \u20B90 | 1 |\n| Team | \u20B9499 | 10 |\n\n### Code\n\n```python\ndef take(slide):\n return slide.best_attempt()\n```\n\n## \u{1F9ED} Diagrams\n\nWrite the diagram in a fenced block named after its language.\n\n### Graphviz\n\n```dot\ndigraph {\n rankdir=LR\n node [shape=box style=rounded]\n Markdown -> Deck -> Takes -> Video\n}\n```\n\n### D2\n\n```d2\ndirection: right\nwrite: Write {shape: rectangle}\npresent: Present\nrecord: Record\nwrite -> present -> record: one session\n```\n\n### SVG\n\n```svg\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 120">\n <rect x="10" y="20" width="90" height="80" rx="10" fill="#22c55e"/>\n <rect x="115" y="20" width="90" height="80" rx="10" fill="#22c55e" opacity=".7"/>\n <rect x="220" y="20" width="90" height="80" rx="10" fill="#22c55e" opacity=".4"/>\n</svg>\n```\n\n## \u{1F4CA} Charts\n\nECharts, as a fenced `echarts` block of JSON options.\n\n### A bar chart\n\n```echarts\n{\n "xAxis": {"type": "category", "data": ["Jan", "Feb", "Mar", "Apr", "May"]},\n "yAxis": {"type": "value"},\n "series": [{"type": "bar", "data": [12, 19, 15, 24, 30]}]\n}\n```\n\n### A donut\n\n```echarts\n{\n "series": [{"type": "pie", "radius": ["45%", "70%"],\n "data": [{"name": "Equity", "value": 85}, {"name": "Debt", "value": 5}, {"name": "Gold", "value": 10}]}]\n}\n```\n\n## \u{1F5BC}\uFE0F Images\n\nThe layout comes from what\'s on the slide; the alt text is the caption.\n\n### One image\n\n\n\n### Image and text\n\n\n\nAn image beside text makes a split card. Write the text first and the image moves to the right.\n\n### A gallery\n\nA list of images is a gallery. With `<!-- steps -->` it becomes a carousel: one image at a time, the next on each press.\n\n<!-- steps -->\n- \n- \n- \n\n### A grid\n\nSeveral images in one paragraph sit side by side, up to four a row:\n\n  \n\n### Full screen\n\n<!-- view: full -->\n\n\n\n## \u25B6\uFE0F YouTube\n\nA YouTube link alone on a line becomes the video. The next press plays it; leaving the slide pauses it.\n\nhttps://www.youtube.com/watch?v=jNQXAC9IVRw\n\n## \u{1F3A5} Camera and map\n\n<!-- camera: on, full, on -->\n<!-- view: overview -->\n\nTwo comments do what markdown can\'t: `<!-- camera: on, full, on -->` moves the presenter\'s camera, and `<!-- view: overview -->` shows the whole map first.\n\n## \u{1F680} Start your own\n\nPress **New** for a template (blank, talk or recording), or type in this deck to make it your copy.\n\nThe templates and this deck live in [examples/](https://github.com/slidetake/slidetake/tree/main/examples) on GitHub.\n';
|
|
865
872
|
|
|
866
873
|
// src/core/text.js
|
|
867
874
|
function slugify(s) {
|
|
@@ -1637,11 +1644,74 @@
|
|
|
1637
1644
|
brandEl.hidden = !html;
|
|
1638
1645
|
applyPipState();
|
|
1639
1646
|
document.title = deck.title || "Slidetake";
|
|
1640
|
-
|
|
1641
|
-
if (palette) document.body.dataset.palette = palette;
|
|
1642
|
-
else delete document.body.dataset.palette;
|
|
1647
|
+
applyColors();
|
|
1643
1648
|
applyMode();
|
|
1644
1649
|
}
|
|
1650
|
+
var COLOR_TOKENS = {
|
|
1651
|
+
accent: "--accent",
|
|
1652
|
+
accentSoft: "--accent-teal",
|
|
1653
|
+
line: "--accent-line",
|
|
1654
|
+
ring: "--accent-ring",
|
|
1655
|
+
header: "--header-bg",
|
|
1656
|
+
headerText: "--header-ink",
|
|
1657
|
+
onAccent: "--on-accent"
|
|
1658
|
+
};
|
|
1659
|
+
function deckColors() {
|
|
1660
|
+
const a = String(deck.accent || "").trim();
|
|
1661
|
+
if (!a || !window.CSS || !CSS.supports("color", a)) return null;
|
|
1662
|
+
if (!CSS.supports("color", "oklch(from red l c h)")) return { accent: a, line: a };
|
|
1663
|
+
const at = (l) => "oklch(from " + a + " " + l + " c h)";
|
|
1664
|
+
return {
|
|
1665
|
+
dark: { accent: at(0.8), accentSoft: at(0.87), line: at(0.5) },
|
|
1666
|
+
light: { accent: at(0.45), accentSoft: at(0.4), line: at(0.75), ring: at(0.7) }
|
|
1667
|
+
};
|
|
1668
|
+
}
|
|
1669
|
+
function applyColors() {
|
|
1670
|
+
let css = "";
|
|
1671
|
+
const rule = (sel, o) => {
|
|
1672
|
+
const decl = Object.entries(o || {}).filter(([k, v]) => COLOR_TOKENS[k] && v && typeof v !== "object").map(([k, v]) => COLOR_TOKENS[k] + ":" + String(v).replace(/[;{}<>]/g, "")).join(";");
|
|
1673
|
+
if (decl) css += sel + "{" + decl + "}\n";
|
|
1674
|
+
};
|
|
1675
|
+
[EMBED && EMBED.colors, deckColors()].filter(Boolean).forEach((c) => {
|
|
1676
|
+
["dark", "light"].forEach((mode) => {
|
|
1677
|
+
const m = { ...c, ...c[mode] || {} }, dark = mode === "dark";
|
|
1678
|
+
if (m.accent && typeof m.accent === "string") {
|
|
1679
|
+
m.accentSoft = m.accentSoft || m.accent;
|
|
1680
|
+
m.line = m.line || "color-mix(in srgb, " + m.accent + (dark ? " 45%, #09090b)" : " 55%, #fff)");
|
|
1681
|
+
m.ring = m.ring || (dark ? m.accent : m.line);
|
|
1682
|
+
m.onAccent = m.onAccent || (dark ? "color-mix(in srgb, " + m.accent + " 15%, #000)" : "#fff");
|
|
1683
|
+
}
|
|
1684
|
+
rule(dark ? 'body:not([data-mode="light"])' : 'body[data-mode="light"]', m);
|
|
1685
|
+
});
|
|
1686
|
+
});
|
|
1687
|
+
let el = document.getElementById("st-colors");
|
|
1688
|
+
if (!el) {
|
|
1689
|
+
el = document.createElement("style");
|
|
1690
|
+
el.id = "st-colors";
|
|
1691
|
+
document.head.appendChild(el);
|
|
1692
|
+
}
|
|
1693
|
+
if (el.textContent !== css) el.textContent = css;
|
|
1694
|
+
document.body.classList.toggle("st-header-color", css.includes("--header-bg"));
|
|
1695
|
+
}
|
|
1696
|
+
var pixel = null;
|
|
1697
|
+
function tokenHex(name) {
|
|
1698
|
+
const probe = document.createElement("span");
|
|
1699
|
+
probe.style.color = "var(" + name + ")";
|
|
1700
|
+
document.body.appendChild(probe);
|
|
1701
|
+
const c = getComputedStyle(probe).color;
|
|
1702
|
+
probe.remove();
|
|
1703
|
+
pixel = pixel || Object.assign(document.createElement("canvas"), { width: 1, height: 1 }).getContext("2d", { willReadFrequently: true });
|
|
1704
|
+
pixel.clearRect(0, 0, 1, 1);
|
|
1705
|
+
pixel.fillStyle = "#000";
|
|
1706
|
+
pixel.fillStyle = c;
|
|
1707
|
+
pixel.fillRect(0, 0, 1, 1);
|
|
1708
|
+
return "#" + [...pixel.getImageData(0, 0, 1, 1).data.slice(0, 3)].map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
1709
|
+
}
|
|
1710
|
+
function mixHex(a, b, t) {
|
|
1711
|
+
const p = (h) => [1, 3, 5].map((i) => parseInt(h.slice(i, i + 2), 16));
|
|
1712
|
+
const x = p(a), y = p(b);
|
|
1713
|
+
return "#" + x.map((v, i) => Math.round(v * t + y[i] * (1 - t)).toString(16).padStart(2, "0")).join("");
|
|
1714
|
+
}
|
|
1645
1715
|
var urlMode = new URLSearchParams(location.search).get("mode");
|
|
1646
1716
|
function currentMode() {
|
|
1647
1717
|
if (EMBED && EMBED.themeKey && !urlMode) {
|
|
@@ -2110,7 +2180,7 @@
|
|
|
2110
2180
|
var ECHARTS_URL = "https://cdnjs.cloudflare.com/ajax/libs/echarts/5.5.0/echarts.min.js";
|
|
2111
2181
|
var ECHARTS_THEME = {
|
|
2112
2182
|
dark: {
|
|
2113
|
-
palette: ["#
|
|
2183
|
+
palette: ["#60a5fa", "#f472b6", "#a78bfa", "#fb923c", "#facc15", "#a1a1aa"],
|
|
2114
2184
|
text: "#e4e4e7",
|
|
2115
2185
|
muted: "#a1a1aa",
|
|
2116
2186
|
line: "#3f3f46",
|
|
@@ -2118,7 +2188,7 @@
|
|
|
2118
2188
|
tip: "#18181b"
|
|
2119
2189
|
},
|
|
2120
2190
|
light: {
|
|
2121
|
-
palette: ["#
|
|
2191
|
+
palette: ["#2563eb", "#db2777", "#7c3aed", "#ea580c", "#ca8a04", "#71717a"],
|
|
2122
2192
|
text: "#27272a",
|
|
2123
2193
|
muted: "#71717a",
|
|
2124
2194
|
line: "#d4d4d8",
|
|
@@ -2126,64 +2196,54 @@
|
|
|
2126
2196
|
tip: "#ffffff"
|
|
2127
2197
|
}
|
|
2128
2198
|
};
|
|
2129
|
-
function
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
}
|
|
2199
|
+
function chartTheme() {
|
|
2200
|
+
const mode = currentMode() === "light" ? "light" : "dark", accent = tokenHex(mode === "light" ? "--accent-ring" : "--accent");
|
|
2201
|
+
const name = "slidetake-" + mode + "-" + accent.slice(1);
|
|
2202
|
+
if (!chartThemes.has(name)) {
|
|
2203
|
+
registerChartTheme(name, ECHARTS_THEME[mode], accent);
|
|
2204
|
+
chartThemes.add(name);
|
|
2205
|
+
}
|
|
2206
|
+
return name;
|
|
2207
|
+
}
|
|
2208
|
+
var chartThemes = /* @__PURE__ */ new Set();
|
|
2209
|
+
function registerChartTheme(name, t, accent) {
|
|
2210
|
+
const axis = {
|
|
2211
|
+
axisLine: { lineStyle: { color: t.line } },
|
|
2212
|
+
axisTick: { lineStyle: { color: t.line } },
|
|
2213
|
+
axisLabel: { color: t.muted },
|
|
2214
|
+
splitLine: { lineStyle: { color: t.split } },
|
|
2215
|
+
nameTextStyle: { color: t.muted }
|
|
2216
|
+
};
|
|
2217
|
+
echarts.registerTheme(name, {
|
|
2218
|
+
color: [accent, ...t.palette],
|
|
2219
|
+
backgroundColor: "transparent",
|
|
2220
|
+
textStyle: { color: t.text, fontFamily: "'IBM Plex Sans', sans-serif" },
|
|
2221
|
+
title: { textStyle: { color: t.text }, subtextStyle: { color: t.muted } },
|
|
2222
|
+
legend: { textStyle: { color: t.text } },
|
|
2223
|
+
tooltip: { backgroundColor: t.tip, borderColor: t.line, textStyle: { color: t.text } },
|
|
2224
|
+
categoryAxis: axis,
|
|
2225
|
+
valueAxis: axis,
|
|
2226
|
+
logAxis: axis,
|
|
2227
|
+
timeAxis: axis,
|
|
2228
|
+
line: { symbolSize: 6, lineStyle: { width: 2.5 } }
|
|
2151
2229
|
});
|
|
2152
2230
|
}
|
|
2153
2231
|
var D2_URL = "https://esm.sh/@terrastruct/d2@0.1.33";
|
|
2154
2232
|
var d2 = null;
|
|
2155
|
-
var
|
|
2156
|
-
dark: {
|
|
2157
|
-
|
|
2158
|
-
N2: "#a1a1aa",
|
|
2159
|
-
N3: "#a1a1aa",
|
|
2160
|
-
N4: "#323238",
|
|
2161
|
-
N5: "#27272a",
|
|
2162
|
-
N6: "#18181b",
|
|
2163
|
-
N7: "#09090b",
|
|
2164
|
-
B1: "#e0b024",
|
|
2165
|
-
B2: "#907320",
|
|
2166
|
-
B3: "#68551f",
|
|
2167
|
-
B4: "#483c1d",
|
|
2168
|
-
B5: "#38301c",
|
|
2169
|
-
B6: "#2c271c"
|
|
2170
|
-
},
|
|
2171
|
-
light: {
|
|
2172
|
-
N1: "#27272a",
|
|
2173
|
-
N2: "#71717a",
|
|
2174
|
-
N3: "#71717a",
|
|
2175
|
-
N4: "#e4e4e7",
|
|
2176
|
-
N5: "#e4e4e7",
|
|
2177
|
-
N6: "#f4f4f5",
|
|
2178
|
-
N7: "#ffffff",
|
|
2179
|
-
B1: "#7a5c12",
|
|
2180
|
-
B2: "#e5cf87",
|
|
2181
|
-
B3: "#eedfaf",
|
|
2182
|
-
B4: "#f5eccf",
|
|
2183
|
-
B5: "#f8f2df",
|
|
2184
|
-
B6: "#fbf7eb"
|
|
2185
|
-
}
|
|
2233
|
+
var D2_NEUTRALS = {
|
|
2234
|
+
dark: { N1: "#e4e4e7", N2: "#a1a1aa", N3: "#a1a1aa", N4: "#323238", N5: "#27272a", N6: "#18181b", N7: "#09090b" },
|
|
2235
|
+
light: { N1: "#27272a", N2: "#71717a", N3: "#71717a", N4: "#e4e4e7", N5: "#e4e4e7", N6: "#f4f4f5", N7: "#ffffff" }
|
|
2186
2236
|
};
|
|
2237
|
+
function d2Theme() {
|
|
2238
|
+
const mode = currentMode() === "light" ? "light" : "dark", card = tokenHex("--node-bg");
|
|
2239
|
+
const tint = mode === "dark" ? tokenHex("--accent") : tokenHex("--accent-line");
|
|
2240
|
+
const steps = mode === "dark" ? [0.58, 0.38, 0.25, 0.18, 0.12] : [0.7, 0.45, 0.25, 0.15, 0.08];
|
|
2241
|
+
const t = { ...D2_NEUTRALS[mode], B1: tokenHex("--accent") };
|
|
2242
|
+
steps.forEach((x, i) => {
|
|
2243
|
+
t["B" + (i + 2)] = mixHex(tint, card, x);
|
|
2244
|
+
});
|
|
2245
|
+
return t;
|
|
2246
|
+
}
|
|
2187
2247
|
var withD2Defaults = (code) => /d2-config\s*:/.test(code) ? code : "vars: {\n d2-config: {\n layout-engine: elk\n }\n}\n" + code;
|
|
2188
2248
|
var scripts = {};
|
|
2189
2249
|
function loadScript(url) {
|
|
@@ -2243,7 +2303,7 @@
|
|
|
2243
2303
|
d2 = new mod.D2();
|
|
2244
2304
|
}
|
|
2245
2305
|
if (gen !== buildGen) return;
|
|
2246
|
-
const theme =
|
|
2306
|
+
const theme = d2Theme();
|
|
2247
2307
|
for (const code of d2s) {
|
|
2248
2308
|
const box = document.createElement("div");
|
|
2249
2309
|
box.className = "diagram d2";
|
|
@@ -2265,10 +2325,7 @@
|
|
|
2265
2325
|
try {
|
|
2266
2326
|
await loadScript(ECHARTS_URL);
|
|
2267
2327
|
if (gen !== buildGen) return;
|
|
2268
|
-
|
|
2269
|
-
registerChartThemes();
|
|
2270
|
-
echarts._slidetakeThemes = true;
|
|
2271
|
-
}
|
|
2328
|
+
const theme = chartTheme();
|
|
2272
2329
|
charts.forEach((div) => {
|
|
2273
2330
|
let opt;
|
|
2274
2331
|
try {
|
|
@@ -2277,7 +2334,7 @@
|
|
|
2277
2334
|
div.textContent = "Chart data is not valid JSON.";
|
|
2278
2335
|
return;
|
|
2279
2336
|
}
|
|
2280
|
-
echarts.init(div,
|
|
2337
|
+
echarts.init(div, theme, { renderer: "svg" }).setOption(Object.assign({ backgroundColor: "transparent", animation: !reduceMotion }, opt));
|
|
2281
2338
|
});
|
|
2282
2339
|
} catch (e) {
|
|
2283
2340
|
problems.push("charts");
|
|
@@ -3866,7 +3923,7 @@
|
|
|
3866
3923
|
const tag = document.activeElement && document.activeElement.tagName;
|
|
3867
3924
|
if (tag === "TEXTAREA" || tag === "INPUT" || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
3868
3925
|
if (help.classList.contains("open")) {
|
|
3869
|
-
if (e.key
|
|
3926
|
+
if (/^(Escape|k|K|\?)$/.test(e.key)) help.classList.remove("open");
|
|
3870
3927
|
return;
|
|
3871
3928
|
}
|
|
3872
3929
|
const k = e.key;
|