commit from backup
This commit is contained in:
@@ -0,0 +1,65 @@
|
|||||||
|
import { DOMParser } from "jsr:@b-fuze/deno-dom";
|
||||||
|
import { wrapFetch } from "jsr:@jd1378/another-cookiejar@^5.0.7";
|
||||||
|
import * as cli from "jsr:@std/cli";
|
||||||
|
|
||||||
|
const flags = cli.parseArgs(Deno.args, {
|
||||||
|
string: ["email", "password", "search"],
|
||||||
|
});
|
||||||
|
const fetch = wrapFetch();
|
||||||
|
|
||||||
|
const email = flags.email || Deno.env.get("CBTW_EMAIL") ||
|
||||||
|
prompt("Please enter your email:") || "";
|
||||||
|
const password = flags.password || Deno.env.get("CBTW_PASSWORD") ||
|
||||||
|
cli.promptSecret("Please enter your password:") || "";
|
||||||
|
|
||||||
|
export async function mitarbeiterangebote() {
|
||||||
|
await fetch(
|
||||||
|
"https://cbtw.mitarbeiterangebote.de/login",
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
body: new URLSearchParams({
|
||||||
|
"loginData[email]": email,
|
||||||
|
"loginData[password]": password,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
await fetch("https://cbtw.mitarbeiterangebote.de/", {
|
||||||
|
method: "POST",
|
||||||
|
body: new URLSearchParams({
|
||||||
|
"platformData[disclaimerNewsletter]": "0",
|
||||||
|
"disclaimerAccept": "1",
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
const res = await fetch("https://cbtw.mitarbeiterangebote.de/overview/23");
|
||||||
|
const html = await res.text();
|
||||||
|
const document = new DOMParser().parseFromString(html, "text/html");
|
||||||
|
|
||||||
|
return Array.from(document.querySelectorAll(".cbg3-offer-list-item--content"))
|
||||||
|
.map(
|
||||||
|
(element) => {
|
||||||
|
const title = element.querySelector("a[title]")
|
||||||
|
?.getAttribute("title")?.replace("Zum Angebot: ", "") || "";
|
||||||
|
const description = element.querySelector(
|
||||||
|
"p.cbg3-list-item--copy",
|
||||||
|
)?.textContent?.trim().substring(0, 50) + "..." || "";
|
||||||
|
const discount = element.querySelector(
|
||||||
|
"div.cbg3-list-item--discount p",
|
||||||
|
)?.textContent?.trim() || "";
|
||||||
|
|
||||||
|
return { title, description, discount };
|
||||||
|
},
|
||||||
|
).filter((offer, index, self) =>
|
||||||
|
index === self.findIndex((o) => o.title === offer.title)
|
||||||
|
).sort((a, b) => a.title.localeCompare(b.title));
|
||||||
|
}
|
||||||
|
|
||||||
|
const offers = await mitarbeiterangebote();
|
||||||
|
if (flags.search) {
|
||||||
|
const filtered = offers.filter((offer) =>
|
||||||
|
offer.title.toLowerCase().includes(flags.search!.toLowerCase())
|
||||||
|
);
|
||||||
|
console.table(filtered);
|
||||||
|
} else {
|
||||||
|
console.table(offers);
|
||||||
|
}
|
||||||
Generated
+95
-1
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"version": "5",
|
"version": "5",
|
||||||
"specifiers": {
|
"specifiers": {
|
||||||
"npm:@slidev/cli@^52.1.0": "52.1.0_typescript@5.9.2_vite@7.0.6__jiti@2.5.1__yaml@2.8.0__picomatch@4.0.3_vue@3.5.18__typescript@5.9.2_markdown-it@14.1.0_shiki@3.9.1_jiti@2.5.1_yaml@2.8.0",
|
"npm:@slidev/cli@^52.1.0": "52.1.0_typescript@5.9.2_vite@7.0.6__jiti@2.5.1__yaml@2.8.0__picomatch@4.0.3_vue@3.5.18__typescript@5.9.2_markdown-it@14.1.0_shiki@3.9.1_jiti@2.5.1_yaml@2.8.0_playwright-chromium@1.54.2",
|
||||||
"npm:@slidev/theme-default@latest": "0.25.0",
|
"npm:@slidev/theme-default@latest": "0.25.0",
|
||||||
"npm:@slidev/theme-seriph@latest": "0.25.0",
|
"npm:@slidev/theme-seriph@latest": "0.25.0",
|
||||||
|
"npm:playwright-chromium@^1.54.2": "1.54.2",
|
||||||
"npm:vue@^3.5.18": "3.5.18_typescript@5.9.2"
|
"npm:vue@^3.5.18": "3.5.18_typescript@5.9.2"
|
||||||
},
|
},
|
||||||
"npm": {
|
"npm": {
|
||||||
@@ -831,6 +832,86 @@
|
|||||||
],
|
],
|
||||||
"bin": true
|
"bin": true
|
||||||
},
|
},
|
||||||
|
"@slidev/cli@52.1.0_typescript@5.9.2_vite@7.0.6__jiti@2.5.1__yaml@2.8.0__picomatch@4.0.3_vue@3.5.18__typescript@5.9.2_markdown-it@14.1.0_shiki@3.9.1_jiti@2.5.1_yaml@2.8.0_playwright-chromium@1.54.2": {
|
||||||
|
"integrity": "sha512-aN15gXhUWc9UC6CBXUbaWIeOYE0mvU4DuOjp0EuBroqD8jpSDKjQKquv0kIEs0JsIymgOpfbOP9Ha1xuZN0Eew==",
|
||||||
|
"dependencies": [
|
||||||
|
"@antfu/ni",
|
||||||
|
"@antfu/utils@9.2.0",
|
||||||
|
"@iconify-json/carbon",
|
||||||
|
"@iconify-json/ph",
|
||||||
|
"@iconify-json/svg-spinners",
|
||||||
|
"@lillallol/outline-pdf",
|
||||||
|
"@shikijs/markdown-it",
|
||||||
|
"@shikijs/twoslash",
|
||||||
|
"@shikijs/vitepress-twoslash",
|
||||||
|
"@slidev/client",
|
||||||
|
"@slidev/parser",
|
||||||
|
"@slidev/types@52.1.0_vite@7.0.6__jiti@2.5.1__yaml@2.8.0__picomatch@4.0.3_vue@3.5.18__typescript@5.9.2_typescript@5.9.2_jiti@2.5.1_yaml@2.8.0",
|
||||||
|
"@unocss/extractor-mdc",
|
||||||
|
"@unocss/reset",
|
||||||
|
"@vitejs/plugin-vue",
|
||||||
|
"@vitejs/plugin-vue-jsx",
|
||||||
|
"ansis",
|
||||||
|
"chokidar@4.0.3",
|
||||||
|
"cli-progress",
|
||||||
|
"connect",
|
||||||
|
"debug@4.4.1",
|
||||||
|
"fast-deep-equal",
|
||||||
|
"fast-glob",
|
||||||
|
"get-port-please",
|
||||||
|
"global-directory",
|
||||||
|
"htmlparser2",
|
||||||
|
"is-installed-globally",
|
||||||
|
"jiti",
|
||||||
|
"katex",
|
||||||
|
"local-pkg",
|
||||||
|
"lz-string",
|
||||||
|
"magic-string",
|
||||||
|
"magic-string-stack",
|
||||||
|
"markdown-it",
|
||||||
|
"markdown-it-footnote",
|
||||||
|
"markdown-it-mdc",
|
||||||
|
"mlly",
|
||||||
|
"monaco-editor",
|
||||||
|
"open",
|
||||||
|
"pdf-lib",
|
||||||
|
"picomatch@4.0.3",
|
||||||
|
"plantuml-encoder",
|
||||||
|
"playwright-chromium",
|
||||||
|
"postcss-nested",
|
||||||
|
"pptxgenjs",
|
||||||
|
"prompts",
|
||||||
|
"public-ip",
|
||||||
|
"resolve-from",
|
||||||
|
"resolve-global",
|
||||||
|
"semver@7.7.2",
|
||||||
|
"shiki",
|
||||||
|
"shiki-magic-move",
|
||||||
|
"sirv",
|
||||||
|
"source-map-js",
|
||||||
|
"typescript",
|
||||||
|
"unhead",
|
||||||
|
"unocss",
|
||||||
|
"unplugin-icons",
|
||||||
|
"unplugin-vue-components",
|
||||||
|
"unplugin-vue-markdown",
|
||||||
|
"untun",
|
||||||
|
"uqr",
|
||||||
|
"vite",
|
||||||
|
"vite-plugin-inspect",
|
||||||
|
"vite-plugin-remote-assets",
|
||||||
|
"vite-plugin-static-copy",
|
||||||
|
"vite-plugin-vue-server-ref",
|
||||||
|
"vitefu",
|
||||||
|
"vue",
|
||||||
|
"yaml",
|
||||||
|
"yargs"
|
||||||
|
],
|
||||||
|
"optionalPeers": [
|
||||||
|
"playwright-chromium"
|
||||||
|
],
|
||||||
|
"bin": true
|
||||||
|
},
|
||||||
"@slidev/client@52.1.0_typescript@5.9.2_vue@3.5.18__typescript@5.9.2_shiki@3.9.1_vite@7.0.6__jiti@2.5.1__yaml@2.8.0__picomatch@4.0.3_jiti@2.5.1_yaml@2.8.0": {
|
"@slidev/client@52.1.0_typescript@5.9.2_vue@3.5.18__typescript@5.9.2_shiki@3.9.1_vite@7.0.6__jiti@2.5.1__yaml@2.8.0__picomatch@4.0.3_jiti@2.5.1_yaml@2.8.0": {
|
||||||
"integrity": "sha512-L2NLU4U4v+DTNSeqCY2uOmdokof0g4bcClTWlUjTiTuGl5uYetuIx2Wx+ZQyUnw+x1q1llfcBIbb3a5y+6IhHA==",
|
"integrity": "sha512-L2NLU4U4v+DTNSeqCY2uOmdokof0g4bcClTWlUjTiTuGl5uYetuIx2Wx+ZQyUnw+x1q1llfcBIbb3a5y+6IhHA==",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
@@ -3284,6 +3365,18 @@
|
|||||||
"plantuml-encoder@1.4.0": {
|
"plantuml-encoder@1.4.0": {
|
||||||
"integrity": "sha512-sxMwpDw/ySY1WB2CE3+IdMuEcWibJ72DDOsXLkSmEaSzwEUaYBT6DWgOfBiHGCux4q433X6+OEFWjlVqp7gL6g=="
|
"integrity": "sha512-sxMwpDw/ySY1WB2CE3+IdMuEcWibJ72DDOsXLkSmEaSzwEUaYBT6DWgOfBiHGCux4q433X6+OEFWjlVqp7gL6g=="
|
||||||
},
|
},
|
||||||
|
"playwright-chromium@1.54.2": {
|
||||||
|
"integrity": "sha512-8ytI6xNjB//5zWSZUvOvn+N9xkXw6GXiDuBePOejcDiyUmzl5R5rvAU7MTl6h633sS3JVmlCS10EhYCt4Crzsg==",
|
||||||
|
"dependencies": [
|
||||||
|
"playwright-core"
|
||||||
|
],
|
||||||
|
"scripts": true,
|
||||||
|
"bin": true
|
||||||
|
},
|
||||||
|
"playwright-core@1.54.2": {
|
||||||
|
"integrity": "sha512-n5r4HFbMmWsB4twG7tJLDN9gmBUeSPcsBZiWSE4DnYz9mJMAFqr2ID7+eGC9kpEnxExJ1epttwR59LEWCk8mtA==",
|
||||||
|
"bin": true
|
||||||
|
},
|
||||||
"points-on-curve@0.2.0": {
|
"points-on-curve@0.2.0": {
|
||||||
"integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A=="
|
"integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A=="
|
||||||
},
|
},
|
||||||
@@ -4138,6 +4231,7 @@
|
|||||||
"npm:@slidev/cli@^52.1.0",
|
"npm:@slidev/cli@^52.1.0",
|
||||||
"npm:@slidev/theme-default@latest",
|
"npm:@slidev/theme-default@latest",
|
||||||
"npm:@slidev/theme-seriph@latest",
|
"npm:@slidev/theme-seriph@latest",
|
||||||
|
"npm:playwright-chromium@^1.54.2",
|
||||||
"npm:vue@^3.5.18"
|
"npm:vue@^3.5.18"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps({
|
||||||
|
class: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
layoutClass: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="slidev-layout">
|
||||||
|
<div class="col-header mb-6" :class="props.layoutClass">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
<div class="two-columns w-full h-full grid grid-rows-2 gap-x-10" :class="props.layoutClass">
|
||||||
|
<div id="top" class="grid grid-cols-2">
|
||||||
|
<div class="col-top-left" :class="props.class">
|
||||||
|
<slot name="topleft" />
|
||||||
|
</div>
|
||||||
|
<div class="col-top-right" :class="props.class">
|
||||||
|
<slot name="topright" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="bottom" class="grid grid-cols-2 -mt-5">
|
||||||
|
<div class="col-bottom-left" :class="props.class">
|
||||||
|
<slot name="bottomleft" />
|
||||||
|
</div>
|
||||||
|
<div class="col-bottom-right" :class="props.class">
|
||||||
|
<slot name="bottomright" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -12,5 +12,8 @@
|
|||||||
"@slidev/theme-default": "latest",
|
"@slidev/theme-default": "latest",
|
||||||
"@slidev/theme-seriph": "latest",
|
"@slidev/theme-seriph": "latest",
|
||||||
"vue": "^3.5.18"
|
"vue": "^3.5.18"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"playwright-chromium": "^1.54.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+97
-571
@@ -5,12 +5,14 @@ theme: seriph
|
|||||||
# like them? see https://unsplash.com/collections/94734566/slidev
|
# like them? see https://unsplash.com/collections/94734566/slidev
|
||||||
background: https://cover.sli.dev
|
background: https://cover.sli.dev
|
||||||
# some information about your slides (markdown enabled)
|
# some information about your slides (markdown enabled)
|
||||||
title: Welcome to Slidev
|
title: Deno
|
||||||
info: |
|
info: |
|
||||||
## Slidev Starter Template
|
## Deno
|
||||||
Presentation slides for developers.
|
Deno is the open-source JavaScript runtime for the modern web.
|
||||||
|
|
||||||
Learn more at [Sli.dev](https://sli.dev)
|
Built on web standards with zero-config TypeScript, unmatched security, and a complete built-in toolchain.
|
||||||
|
|
||||||
|
Learn more at [Deno](https://deno.com)
|
||||||
# apply unocss classes to the current slide
|
# apply unocss classes to the current slide
|
||||||
class: text-center
|
class: text-center
|
||||||
# https://sli.dev/features/drawing
|
# https://sli.dev/features/drawing
|
||||||
@@ -28,19 +30,15 @@ seoMeta:
|
|||||||
# ogImage: https://cover.sli.dev
|
# ogImage: https://cover.sli.dev
|
||||||
---
|
---
|
||||||
|
|
||||||
# Welcome to Slidev
|
# Deno
|
||||||
|
|
||||||
Presentation slides for developers
|
Uncomplicate JavaScript
|
||||||
|
|
||||||
<div @click="$slidev.nav.next" class="mt-12 py-1" hover:bg="white op-10">
|
|
||||||
Press Space for next page <carbon:arrow-right />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="abs-br m-6 text-xl">
|
<div class="abs-br m-6 text-xl">
|
||||||
<button @click="$slidev.nav.openInEditor()" title="Open in Editor" class="slidev-icon-btn">
|
<button @click="$slidev.nav.openInEditor()" title="Open in Editor" class="slidev-icon-btn">
|
||||||
<carbon:edit />
|
<carbon:edit />
|
||||||
</button>
|
</button>
|
||||||
<a href="https://github.com/slidevjs/slidev" target="_blank" class="slidev-icon-btn">
|
<a href="https://github.com/zyf722/exploring-social-engineering-slides" target="_blank" class="slidev-icon-btn">
|
||||||
<carbon:logo-github />
|
<carbon:logo-github />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,592 +48,120 @@ The last comment block of each slide will be treated as slide notes. It will be
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
---
|
---
|
||||||
transition: fade-out
|
layout: center
|
||||||
|
class: "text-center"
|
||||||
---
|
---
|
||||||
|
# What is Deno?
|
||||||
# What is Slidev?
|
|
||||||
|
|
||||||
Slidev is a slides maker and presenter designed for developers, consist of the following features
|
|
||||||
|
|
||||||
- 📝 **Text-based** - focus on the content with Markdown, and then style them later
|
|
||||||
- 🎨 **Themable** - themes can be shared and re-used as npm packages
|
|
||||||
- 🧑💻 **Developer Friendly** - code highlighting, live coding with autocompletion
|
|
||||||
- 🤹 **Interactive** - embed Vue components to enhance your expressions
|
|
||||||
- 🎥 **Recording** - built-in recording and camera view
|
|
||||||
- 📤 **Portable** - export to PDF, PPTX, PNGs, or even a hostable SPA
|
|
||||||
- 🛠 **Hackable** - virtually anything that's possible on a webpage is possible in Slidev
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
Read more about [Why Slidev?](https://sli.dev/guide/why)
|
|
||||||
|
|
||||||
<!--
|
|
||||||
You can have `style` tag in markdown to override the style for the current page.
|
|
||||||
Learn more: https://sli.dev/features/slide-scope-style
|
|
||||||
-->
|
|
||||||
|
|
||||||
<style>
|
|
||||||
h1 {
|
|
||||||
background-color: #2B90B6;
|
|
||||||
background-image: linear-gradient(45deg, #4EC5D4 10%, #146b8c 20%);
|
|
||||||
background-size: 100%;
|
|
||||||
-webkit-background-clip: text;
|
|
||||||
-moz-background-clip: text;
|
|
||||||
-webkit-text-fill-color: transparent;
|
|
||||||
-moz-text-fill-color: transparent;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Here is another comment.
|
|
||||||
-->
|
|
||||||
|
|
||||||
---
|
|
||||||
transition: slide-up
|
|
||||||
level: 2
|
|
||||||
---
|
|
||||||
|
|
||||||
# Navigation
|
|
||||||
|
|
||||||
Hover on the bottom-left corner to see the navigation's controls panel, [learn more](https://sli.dev/guide/ui#navigation-bar)
|
|
||||||
|
|
||||||
## Keyboard Shortcuts
|
|
||||||
|
|
||||||
| | |
|
|
||||||
| --------------------------------------------------- | --------------------------- |
|
|
||||||
| <kbd>right</kbd> / <kbd>space</kbd> | next animation or slide |
|
|
||||||
| <kbd>left</kbd> / <kbd>shift</kbd><kbd>space</kbd> | previous animation or slide |
|
|
||||||
| <kbd>up</kbd> | previous slide |
|
|
||||||
| <kbd>down</kbd> | next slide |
|
|
||||||
|
|
||||||
<!-- https://sli.dev/guide/animations.html#click-animation -->
|
|
||||||
<img
|
|
||||||
v-click
|
|
||||||
class="absolute -bottom-9 -left-7 w-80 opacity-50"
|
|
||||||
src="https://sli.dev/assets/arrow-bottom-left.svg"
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
<p v-after class="absolute bottom-23 left-45 opacity-30 transform -rotate-10">Here!</p>
|
|
||||||
|
|
||||||
---
|
|
||||||
layout: two-cols
|
|
||||||
layoutClass: gap-16
|
|
||||||
---
|
|
||||||
|
|
||||||
# Table of contents
|
|
||||||
|
|
||||||
You can use the `Toc` component to generate a table of contents for your slides:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<Toc minDepth="1" maxDepth="1" />
|
|
||||||
```
|
|
||||||
|
|
||||||
The title will be inferred from your slide content, or you can override it with `title` and `level` in your frontmatter.
|
|
||||||
|
|
||||||
::right::
|
|
||||||
|
|
||||||
<Toc text-sm minDepth="1" maxDepth="2" />
|
|
||||||
|
|
||||||
---
|
|
||||||
layout: image-right
|
|
||||||
image: https://cover.sli.dev
|
|
||||||
---
|
|
||||||
|
|
||||||
# Code
|
|
||||||
|
|
||||||
Use code snippets and get the highlighting directly, and even types hover!
|
|
||||||
|
|
||||||
```ts [filename-example.ts] {all|4|6|6-7|9|all} twoslash
|
|
||||||
// TwoSlash enables TypeScript hover information
|
|
||||||
// and errors in markdown code blocks
|
|
||||||
// More at https://shiki.style/packages/twoslash
|
|
||||||
import { computed, ref } from 'vue'
|
|
||||||
|
|
||||||
const count = ref(0)
|
|
||||||
const doubled = computed(() => count.value * 2)
|
|
||||||
|
|
||||||
doubled.value = 2
|
|
||||||
```
|
|
||||||
|
|
||||||
<arrow v-click="[4, 5]" x1="350" y1="310" x2="195" y2="342" color="#953" width="2" arrowSize="1" />
|
|
||||||
|
|
||||||
<!-- This allow you to embed external code blocks -->
|
|
||||||
<<< @/snippets/external.ts#snippet
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
|
|
||||||
[Learn more](https://sli.dev/features/line-highlighting)
|
|
||||||
|
|
||||||
<!-- Inline style -->
|
|
||||||
<style>
|
|
||||||
.footnotes-sep {
|
|
||||||
@apply mt-5 opacity-10;
|
|
||||||
}
|
|
||||||
.footnotes {
|
|
||||||
@apply text-sm opacity-75;
|
|
||||||
}
|
|
||||||
.footnote-backref {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Notes can also sync with clicks
|
|
||||||
|
|
||||||
[click] This will be highlighted after the first click
|
|
||||||
|
|
||||||
[click] Highlighted with `count = ref(0)`
|
|
||||||
|
|
||||||
[click:3] Last click (skip two clicks)
|
|
||||||
-->
|
|
||||||
|
|
||||||
---
|
|
||||||
level: 2
|
|
||||||
---
|
|
||||||
|
|
||||||
# Shiki Magic Move
|
|
||||||
|
|
||||||
Powered by [shiki-magic-move](https://shiki-magic-move.netlify.app/), Slidev supports animations across multiple code snippets.
|
|
||||||
|
|
||||||
Add multiple code blocks and wrap them with <code>````md magic-move</code> (four backticks) to enable the magic move. For example:
|
|
||||||
|
|
||||||
````md magic-move {lines: true}
|
|
||||||
```ts {*|2|*}
|
|
||||||
// step 1
|
|
||||||
const author = reactive({
|
|
||||||
name: 'John Doe',
|
|
||||||
books: [
|
|
||||||
'Vue 2 - Advanced Guide',
|
|
||||||
'Vue 3 - Basic Guide',
|
|
||||||
'Vue 4 - The Mystery'
|
|
||||||
]
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
```ts {*|1-2|3-4|3-4,8}
|
|
||||||
// step 2
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
author: {
|
|
||||||
name: 'John Doe',
|
|
||||||
books: [
|
|
||||||
'Vue 2 - Advanced Guide',
|
|
||||||
'Vue 3 - Basic Guide',
|
|
||||||
'Vue 4 - The Mystery'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```ts
|
|
||||||
// step 3
|
|
||||||
export default {
|
|
||||||
data: () => ({
|
|
||||||
author: {
|
|
||||||
name: 'John Doe',
|
|
||||||
books: [
|
|
||||||
'Vue 2 - Advanced Guide',
|
|
||||||
'Vue 3 - Basic Guide',
|
|
||||||
'Vue 4 - The Mystery'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Non-code blocks are ignored.
|
|
||||||
|
|
||||||
```vue
|
|
||||||
<!-- step 4 -->
|
|
||||||
<script setup>
|
|
||||||
const author = {
|
|
||||||
name: 'John Doe',
|
|
||||||
books: [
|
|
||||||
'Vue 2 - Advanced Guide',
|
|
||||||
'Vue 3 - Basic Guide',
|
|
||||||
'Vue 4 - The Mystery'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
```
|
|
||||||
````
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Components
|
|
||||||
|
|
||||||
<div grid="~ cols-2 gap-4">
|
|
||||||
<div>
|
|
||||||
|
|
||||||
You can use Vue components directly inside your slides.
|
|
||||||
|
|
||||||
We have provided a few built-in components like `<Tweet/>` and `<Youtube/>` that you can use directly. And adding your custom components is also super easy.
|
|
||||||
|
|
||||||
```html
|
|
||||||
<Counter :count="10" />
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- ./components/Counter.vue -->
|
|
||||||
<Counter :count="10" m="t-4" />
|
|
||||||
|
|
||||||
Check out [the guides](https://sli.dev/builtin/components.html) for more.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
|
|
||||||
```html
|
|
||||||
<Tweet id="1390115482657726468" />
|
|
||||||
```
|
|
||||||
|
|
||||||
<Tweet id="1390115482657726468" scale="0.65" />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Presenter note with **bold**, *italic*, and ~~striked~~ text.
|
|
||||||
|
|
||||||
Also, HTML elements are valid:
|
|
||||||
<div class="flex w-full">
|
|
||||||
<span style="flex-grow: 1;">Left content</span>
|
|
||||||
<span>Right content</span>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
|
|
||||||
---
|
|
||||||
class: px-20
|
|
||||||
---
|
|
||||||
|
|
||||||
# Themes
|
|
||||||
|
|
||||||
Slidev comes with powerful theming support. Themes can provide styles, layouts, components, or even configurations for tools. Switching between themes by just **one edit** in your frontmatter:
|
|
||||||
|
|
||||||
<div grid="~ cols-2 gap-2" m="t-2">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
theme: default
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
theme: seriph
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
<img border="rounded" src="https://github.com/slidevjs/themes/blob/main/screenshots/theme-default/01.png?raw=true" alt="">
|
|
||||||
|
|
||||||
<img border="rounded" src="https://github.com/slidevjs/themes/blob/main/screenshots/theme-seriph/01.png?raw=true" alt="">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Read more about [How to use a theme](https://sli.dev/guide/theme-addon#use-theme) and
|
|
||||||
check out the [Awesome Themes Gallery](https://sli.dev/resources/theme-gallery).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Clicks Animations
|
|
||||||
|
|
||||||
You can add `v-click` to elements to add a click animation.
|
|
||||||
|
|
||||||
<div v-click>
|
|
||||||
|
|
||||||
This shows up when you click the slide:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<div v-click>This shows up when you click the slide.</div>
|
|
||||||
```
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<v-click>
|
<v-click>
|
||||||
|
Deno is the open-source JavaScript runtime for the modern web.
|
||||||
The <span v-mark.red="3"><code>v-mark</code> directive</span>
|
Built on web standards with zero-config TypeScript, unmatched security, and a complete built-in toolchain.
|
||||||
also allows you to add
|
|
||||||
<span v-mark.circle.orange="4">inline marks</span>
|
|
||||||
, powered by [Rough Notation](https://roughnotation.com/):
|
|
||||||
|
|
||||||
```html
|
|
||||||
<span v-mark.underline.orange>inline markers</span>
|
|
||||||
```
|
|
||||||
|
|
||||||
</v-click>
|
</v-click>
|
||||||
|
|
||||||
<div mt-20 v-click>
|
---
|
||||||
|
layout: 2x2-grid-header
|
||||||
[Learn more](https://sli.dev/guide/animations#click-animation)
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Motions
|
# Features
|
||||||
|
|
||||||
Motion animations are powered by [@vueuse/motion](https://motion.vueuse.org/), triggered by `v-motion` directive.
|
::topleft::
|
||||||
|
**TypeScript** - native support for ts, tsx, jsx
|
||||||
|
|
||||||
```html
|
::topright::
|
||||||
<div
|
- **web standards** - Deno prioritizes web standard APIs, maximizing code reuse between browser and server
|
||||||
v-motion
|
|
||||||
:initial="{ x: -80 }"
|
|
||||||
:enter="{ x: 0 }"
|
|
||||||
:click-3="{ x: 80 }"
|
|
||||||
:leave="{ x: 1000 }"
|
|
||||||
>
|
|
||||||
Slidev
|
|
||||||
</div>
|
|
||||||
```
|
|
||||||
|
|
||||||
<div class="w-60 relative">
|
::bottomleft::
|
||||||
<div class="relative w-40 h-40">
|
- **Code linter** - build in code linter
|
||||||
<img
|
|
||||||
v-motion
|
|
||||||
:initial="{ x: 800, y: -100, scale: 1.5, rotate: -50 }"
|
|
||||||
:enter="final"
|
|
||||||
class="absolute inset-0"
|
|
||||||
src="https://sli.dev/logo-square.png"
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
v-motion
|
|
||||||
:initial="{ y: 500, x: -100, scale: 2 }"
|
|
||||||
:enter="final"
|
|
||||||
class="absolute inset-0"
|
|
||||||
src="https://sli.dev/logo-circle.png"
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
v-motion
|
|
||||||
:initial="{ x: 600, y: 400, scale: 2, rotate: 100 }"
|
|
||||||
:enter="final"
|
|
||||||
class="absolute inset-0"
|
|
||||||
src="https://sli.dev/logo-triangle.png"
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="text-5xl absolute top-14 left-40 text-[#2B90B6] -z-1"
|
|
||||||
v-motion
|
|
||||||
:initial="{ x: -80, opacity: 0}"
|
|
||||||
:enter="{ x: 0, opacity: 1, transition: { delay: 2000, duration: 1000 } }">
|
|
||||||
Slidev
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- vue script setup scripts can be directly used in markdown, and will only affects current page -->
|
|
||||||
<script setup lang="ts">
|
|
||||||
const final = {
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
rotate: 0,
|
|
||||||
scale: 1,
|
|
||||||
transition: {
|
|
||||||
type: 'spring',
|
|
||||||
damping: 10,
|
|
||||||
stiffness: 20,
|
|
||||||
mass: 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-motion
|
|
||||||
:initial="{ x:35, y: 30, opacity: 0}"
|
|
||||||
:enter="{ y: 0, opacity: 1, transition: { delay: 3500 } }">
|
|
||||||
|
|
||||||
[Learn more](https://sli.dev/guide/animations.html#motion)
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# LaTeX
|
|
||||||
|
|
||||||
LaTeX is supported out-of-box. Powered by [KaTeX](https://katex.org/).
|
|
||||||
|
|
||||||
<div h-3 />
|
|
||||||
|
|
||||||
Inline $\sqrt{3x-1}+(1+x)^2$
|
|
||||||
|
|
||||||
Block
|
|
||||||
$$ {1|3|all}
|
|
||||||
\begin{aligned}
|
|
||||||
\nabla \cdot \vec{E} &= \frac{\rho}{\varepsilon_0} \\
|
|
||||||
\nabla \cdot \vec{B} &= 0 \\
|
|
||||||
\nabla \times \vec{E} &= -\frac{\partial\vec{B}}{\partial t} \\
|
|
||||||
\nabla \times \vec{B} &= \mu_0\vec{J} + \mu_0\varepsilon_0\frac{\partial\vec{E}}{\partial t}
|
|
||||||
\end{aligned}
|
|
||||||
$$
|
|
||||||
|
|
||||||
[Learn more](https://sli.dev/features/latex)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Diagrams
|
|
||||||
|
|
||||||
You can create diagrams / graphs from textual descriptions, directly in your Markdown.
|
|
||||||
|
|
||||||
<div class="grid grid-cols-4 gap-5 pt-4 -mb-6">
|
|
||||||
|
|
||||||
```mermaid {scale: 0.5, alt: 'A simple sequence diagram'}
|
|
||||||
sequenceDiagram
|
|
||||||
Alice->John: Hello John, how are you?
|
|
||||||
Note over Alice,John: A typical interaction
|
|
||||||
```
|
|
||||||
|
|
||||||
```mermaid {theme: 'neutral', scale: 0.8}
|
|
||||||
graph TD
|
|
||||||
B[Text] --> C{Decision}
|
|
||||||
C -->|One| D[Result 1]
|
|
||||||
C -->|Two| E[Result 2]
|
|
||||||
```
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
mindmap
|
|
||||||
root((mindmap))
|
|
||||||
Origins
|
|
||||||
Long history
|
|
||||||
::icon(fa fa-book)
|
|
||||||
Popularisation
|
|
||||||
British popular psychology author Tony Buzan
|
|
||||||
Research
|
|
||||||
On effectiveness<br/>and features
|
|
||||||
On Automatic creation
|
|
||||||
Uses
|
|
||||||
Creative techniques
|
|
||||||
Strategic planning
|
|
||||||
Argument mapping
|
|
||||||
Tools
|
|
||||||
Pen and paper
|
|
||||||
Mermaid
|
|
||||||
```
|
|
||||||
|
|
||||||
```plantuml {scale: 0.7}
|
|
||||||
@startuml
|
|
||||||
|
|
||||||
package "Some Group" {
|
|
||||||
HTTP - [First Component]
|
|
||||||
[Another Component]
|
|
||||||
}
|
|
||||||
|
|
||||||
node "Other Groups" {
|
|
||||||
FTP - [Second Component]
|
|
||||||
[First Component] --> FTP
|
|
||||||
}
|
|
||||||
|
|
||||||
cloud {
|
|
||||||
[Example 1]
|
|
||||||
}
|
|
||||||
|
|
||||||
database "MySql" {
|
|
||||||
folder "This is my folder" {
|
|
||||||
[Folder 3]
|
|
||||||
}
|
|
||||||
frame "Foo" {
|
|
||||||
[Frame 4]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Another Component] --> [Example 1]
|
|
||||||
[Example 1] --> [Folder 3]
|
|
||||||
[Folder 3] --> [Frame 4]
|
|
||||||
|
|
||||||
@enduml
|
|
||||||
```
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Learn more: [Mermaid Diagrams](https://sli.dev/features/mermaid) and [PlantUML Diagrams](https://sli.dev/features/plantuml)
|
|
||||||
|
|
||||||
---
|
|
||||||
foo: bar
|
|
||||||
dragPos:
|
|
||||||
square: 691,32,167,_,-16
|
|
||||||
---
|
|
||||||
|
|
||||||
# Draggable Elements
|
|
||||||
|
|
||||||
Double-click on the draggable elements to edit their positions.
|
|
||||||
|
|
||||||
|
::bottomright::
|
||||||
|
- **Code formatter** - based on dprint. Beautifies JS, TS, JSON, and Markdown
|
||||||
|
- **Test runner** - test runner and assertion libraries as a part of the runtime and standard library
|
||||||
|
- **Standalone executables** - create standalone executables. It even supports cross-compiling
|
||||||
|
- **Secure by default** - Deno has no file, network, or environment access unless explicitly enabled
|
||||||
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
###### Directive Usage
|
Read more about [Deno](https://docs.deno.com/runtime/)
|
||||||
|
|
||||||
```md
|
|
||||||
<img v-drag="'square'" src="https://sli.dev/logo.png">
|
|
||||||
```
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
###### Component Usage
|
|
||||||
|
|
||||||
```md
|
|
||||||
<v-drag text-3xl>
|
|
||||||
<div class="i-carbon:arrow-up" />
|
|
||||||
Use the `v-drag` component to have a draggable container!
|
|
||||||
</v-drag>
|
|
||||||
```
|
|
||||||
|
|
||||||
<v-drag pos="663,206,261,_,-15">
|
|
||||||
<div text-center text-3xl border border-main rounded>
|
|
||||||
Double-click me!
|
|
||||||
</div>
|
|
||||||
</v-drag>
|
|
||||||
|
|
||||||
<img v-drag="'square'" src="https://sli.dev/logo.png">
|
|
||||||
|
|
||||||
###### Draggable Arrow
|
|
||||||
|
|
||||||
```md
|
|
||||||
<v-drag-arrow two-way />
|
|
||||||
```
|
|
||||||
|
|
||||||
<v-drag-arrow pos="67,452,253,46" two-way op70 />
|
|
||||||
|
|
||||||
---
|
|
||||||
src: ./pages/imported-slides.md
|
|
||||||
hide: false
|
|
||||||
---
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Monaco Editor
|
# Install Deno
|
||||||
|
|
||||||
Slidev provides built-in Monaco Editor support.
|
## macOS / Linux
|
||||||
|
|
||||||
Add `{monaco}` to the code block to turn it into an editor:
|
```bash
|
||||||
|
curl -fsSL https://deno.land/install.sh | sh
|
||||||
```ts {monaco}
|
|
||||||
import { ref } from 'vue'
|
|
||||||
import { emptyArray } from './external'
|
|
||||||
|
|
||||||
const arr = ref(emptyArray(10))
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Use `{monaco-run}` to create an editor that can execute the code directly in the slide:
|
## Windows
|
||||||
|
|
||||||
```ts {monaco-run}
|
```bash
|
||||||
import { version } from 'vue'
|
irm https://deno.land/install.ps1 | iex
|
||||||
import { emptyArray, sayHello } from './external'
|
|
||||||
|
|
||||||
sayHello()
|
|
||||||
console.log(`vue ${version}`)
|
|
||||||
console.log(emptyArray<number>(10).reduce(fib => [...fib, fib.at(-1)! + fib.at(-2)!], [1, 1]))
|
|
||||||
```
|
```
|
||||||
|
---
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
|
||||||
|
| Base | Docker Tag |
|
||||||
|
|--------------|--------------------------------|
|
||||||
|
| Alpine Linux | denoland/deno:alpine |
|
||||||
|
| Debian | denoland/deno:debian (default) |
|
||||||
|
| Distroless | denoland/deno:distroless |
|
||||||
|
| Ubuntu | denoland/deno:ubuntu |
|
||||||
|
| Binary only | denoland/deno:bin |
|
||||||
|
|
||||||
---
|
---
|
||||||
layout: center
|
layout: center
|
||||||
class: text-center
|
class: "text-center"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Learn More
|
# Deno Toolchain
|
||||||
|
|
||||||
[Documentation](https://sli.dev) · [GitHub](https://github.com/slidevjs/slidev) · [Showcases](https://sli.dev/resources/showcases)
|
---
|
||||||
|
|
||||||
|
Creating an empty project similiar to `npm init`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
deno init my-deno-project
|
||||||
|
```
|
||||||
|
|
||||||
|
Creates three default files
|
||||||
|
|
||||||
|
```md {0|1|2|3}
|
||||||
|
main.ts
|
||||||
|
main_test.ts
|
||||||
|
deno.json
|
||||||
|
```
|
||||||
|
|
||||||
|
<!--
|
||||||
|
deno.json is central to customizing your deno development environment
|
||||||
|
|
||||||
|
- Import maps
|
||||||
|
- Scripts
|
||||||
|
- Formatter settings
|
||||||
|
- Linter rules
|
||||||
|
- TypeScript compiler options
|
||||||
|
-->
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Running a project
|
||||||
|
|
||||||
|
`deno run main.ts`
|
||||||
|
|
||||||
|
## Using npm modules
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import express from "npm:express";
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
|
||||||
|
app.get("/", function (req, res) {
|
||||||
|
res.send("Hello World");
|
||||||
|
});
|
||||||
|
|
||||||
|
app.listen(3000);
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
<PoweredBySlidev mt-10 />
|
|
||||||
|
|||||||
Reference in New Issue
Block a user