From f05a472585b2506da21aed71f0252b2d4c04a221 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Mon, 5 Feb 2024 04:15:02 +0530 Subject: React Slides * Adds useState * State * useEffect * Side Effects --- src/.html | 11 ++ src/config.ts | 52 ++++++ src/global.d.ts | 6 + src/lib/components/code.svelte | 22 +++ src/lib/components/fit.svelte | 13 ++ src/lib/components/index.ts | 25 +++ src/lib/components/markdown.svelte | 13 ++ src/lib/components/media.svelte | 22 +++ src/lib/components/notes.svelte | 3 + src/lib/components/presentation.svelte | 77 ++++++++ src/lib/components/slide.svelte | 48 +++++ src/lib/components/stack.svelte | 3 + src/lib/components/step.svelte | 53 ++++++ src/lib/components/stretch.svelte | 13 ++ src/lib/components/vertical.svelte | 3 + src/lib/languages/index.ts | 6 + src/lib/languages/svelte.ts | 50 +++++ src/lib/languages/types.ts | 3 + src/lib/motion/index.ts | 4 + src/lib/motion/signal.ts | 61 +++++++ src/lib/motion/types.ts | 2 + src/lib/motion/utils.ts | 10 + src/lib/styles/code.css | 56 ++++++ src/lib/styles/tailwind.css | 3 + src/lib/styles/theme.css | 127 +++++++++++++ src/lib/types/highlight.js/index.d.ts | 323 +++++++++++++++++++++++++++++++++ src/main.ts | 8 + src/slides.svelte | 276 ++++++++++++++++++++++++++++ src/vite-env.d.ts | 2 + 29 files changed, 1295 insertions(+) create mode 100644 src/.html create mode 100644 src/config.ts create mode 100644 src/global.d.ts create mode 100644 src/lib/components/code.svelte create mode 100644 src/lib/components/fit.svelte create mode 100644 src/lib/components/index.ts create mode 100644 src/lib/components/markdown.svelte create mode 100644 src/lib/components/media.svelte create mode 100644 src/lib/components/notes.svelte create mode 100644 src/lib/components/presentation.svelte create mode 100644 src/lib/components/slide.svelte create mode 100644 src/lib/components/stack.svelte create mode 100644 src/lib/components/step.svelte create mode 100644 src/lib/components/stretch.svelte create mode 100644 src/lib/components/vertical.svelte create mode 100644 src/lib/languages/index.ts create mode 100644 src/lib/languages/svelte.ts create mode 100644 src/lib/languages/types.ts create mode 100644 src/lib/motion/index.ts create mode 100644 src/lib/motion/signal.ts create mode 100644 src/lib/motion/types.ts create mode 100644 src/lib/motion/utils.ts create mode 100644 src/lib/styles/code.css create mode 100644 src/lib/styles/tailwind.css create mode 100644 src/lib/styles/theme.css create mode 100644 src/lib/types/highlight.js/index.d.ts create mode 100644 src/main.ts create mode 100644 src/slides.svelte create mode 100644 src/vite-env.d.ts (limited to 'src') diff --git a/src/.html b/src/.html new file mode 100644 index 0000000..5a60528 --- /dev/null +++ b/src/.html @@ -0,0 +1,11 @@ + + +
+ + +
+
+
+
+
diff --git a/src/lib/components/fit.svelte b/src/lib/components/fit.svelte
new file mode 100644
index 0000000..8772061
--- /dev/null
+++ b/src/lib/components/fit.svelte
@@ -0,0 +1,13 @@
+
+
+
+
React Builtin Hooks
+React Builtin Hooks
+What is a State?
+useState()
+Side Effects
+useEffect
+
+ {`
+ useEffect(() => {
+ document.title = "Hey There, I'm from useEffect"
+ })
+ `}
+
+ useEffect
+
+ {`
+ useEffect(() => {
+ document.title = "Hey There, I'm from useEffect"
+ }) ← No Arguments means this will be called each time
+ this component re-renders
+ `}
+
+ useEffect
+
+ {`
+ useEffect(() => {
+ document.title = "Hey There, I'm from useEffect"
+ }, []) ← An empty array as an argument will run the
+ effect once the component is mounted
+ `}
+
+ useEffect
+
+ {`
+ useEffect(() => {
+ document.title = "Hey There, I'm from useEffect"
+ }, [prop1]) ← We can pass value
+ `}
+
+ useEffect
+
+ {`
+ useEffect(() => {
+ document.title = "Hey There, I'm from useEffect"
+ }, [prop1, state1]) ← Actually we can pass multiple-values
+ `}
+
+ useEffect
+
+ {`
+ useEffect(() => {
+ document.title = "Hey There, I'm from useEffect"
+ }, [prop1, state1]) ← This is called dependency list
+ `}
+
+ useEffect
+
+ {`
+ useEffect(() => {
+ document.title = "Hey There, I'm from useEffect"
+ }, [prop1, state1]) ← Effect will run whenever any
+ of the values on dependency list changes
+ `}
+
+ useEffect
+
+ {`
+ useEffect(() => {
+ document.title = "Hey There, I'm from useEffect";
+
+ return () => {
+ // Clean Up function 🧹
+ }
+ }, [prop1, state1]);
+ `}
+
+