diff --git a/site/content/examples/7guis-circles/App.svelte b/site/content/OLD.examples/7guis-circles/App.svelte similarity index 100% rename from site/content/examples/7guis-circles/App.svelte rename to site/content/OLD.examples/7guis-circles/App.svelte diff --git a/site/content/examples/7guis-counter/App.svelte b/site/content/OLD.examples/7guis-counter/App.svelte similarity index 100% rename from site/content/examples/7guis-counter/App.svelte rename to site/content/OLD.examples/7guis-counter/App.svelte diff --git a/site/content/examples/7guis-crud/App.svelte b/site/content/OLD.examples/7guis-crud/App.svelte similarity index 100% rename from site/content/examples/7guis-crud/App.svelte rename to site/content/OLD.examples/7guis-crud/App.svelte diff --git a/site/content/examples/7guis-flight-booker/App.svelte b/site/content/OLD.examples/7guis-flight-booker/App.svelte similarity index 100% rename from site/content/examples/7guis-flight-booker/App.svelte rename to site/content/OLD.examples/7guis-flight-booker/App.svelte diff --git a/site/content/examples/7guis-temperature/App.svelte b/site/content/OLD.examples/7guis-temperature/App.svelte similarity index 100% rename from site/content/examples/7guis-temperature/App.svelte rename to site/content/OLD.examples/7guis-temperature/App.svelte diff --git a/site/content/examples/7guis-timer/App.svelte b/site/content/OLD.examples/7guis-timer/App.svelte similarity index 100% rename from site/content/examples/7guis-timer/App.svelte rename to site/content/OLD.examples/7guis-timer/App.svelte diff --git a/site/content/examples/await-block/App.svelte b/site/content/OLD.examples/await-block/App.svelte similarity index 100% rename from site/content/examples/await-block/App.svelte rename to site/content/OLD.examples/await-block/App.svelte diff --git a/site/content/examples/bar-chart/App.svelte b/site/content/OLD.examples/bar-chart/App.svelte similarity index 100% rename from site/content/examples/bar-chart/App.svelte rename to site/content/OLD.examples/bar-chart/App.svelte diff --git a/site/content/examples/binding-input-checkbox-group/App.svelte b/site/content/OLD.examples/binding-input-checkbox-group/App.svelte similarity index 100% rename from site/content/examples/binding-input-checkbox-group/App.svelte rename to site/content/OLD.examples/binding-input-checkbox-group/App.svelte diff --git a/site/content/examples/binding-input-checkbox/App.svelte b/site/content/OLD.examples/binding-input-checkbox/App.svelte similarity index 100% rename from site/content/examples/binding-input-checkbox/App.svelte rename to site/content/OLD.examples/binding-input-checkbox/App.svelte diff --git a/site/content/examples/binding-input-numeric/App.svelte b/site/content/OLD.examples/binding-input-numeric/App.svelte similarity index 100% rename from site/content/examples/binding-input-numeric/App.svelte rename to site/content/OLD.examples/binding-input-numeric/App.svelte diff --git a/site/content/examples/binding-input-radio/App.svelte b/site/content/OLD.examples/binding-input-radio/App.svelte similarity index 100% rename from site/content/examples/binding-input-radio/App.svelte rename to site/content/OLD.examples/binding-input-radio/App.svelte diff --git a/site/content/examples/binding-input-text/App.svelte b/site/content/OLD.examples/binding-input-text/App.svelte similarity index 100% rename from site/content/examples/binding-input-text/App.svelte rename to site/content/OLD.examples/binding-input-text/App.svelte diff --git a/site/content/examples/binding-media-elements/App.svelte b/site/content/OLD.examples/binding-media-elements/App.svelte similarity index 100% rename from site/content/examples/binding-media-elements/App.svelte rename to site/content/OLD.examples/binding-media-elements/App.svelte diff --git a/site/content/examples/binding-textarea/App.svelte b/site/content/OLD.examples/binding-textarea/App.svelte similarity index 100% rename from site/content/examples/binding-textarea/App.svelte rename to site/content/OLD.examples/binding-textarea/App.svelte diff --git a/site/content/examples/each-blocks/App.svelte b/site/content/OLD.examples/each-blocks/App.svelte similarity index 100% rename from site/content/examples/each-blocks/App.svelte rename to site/content/OLD.examples/each-blocks/App.svelte diff --git a/site/content/examples/hacker-news/App.svelte b/site/content/OLD.examples/hacker-news/App.svelte similarity index 100% rename from site/content/examples/hacker-news/App.svelte rename to site/content/OLD.examples/hacker-news/App.svelte diff --git a/site/content/examples/hacker-news/Comment.svelte b/site/content/OLD.examples/hacker-news/Comment.svelte similarity index 100% rename from site/content/examples/hacker-news/Comment.svelte rename to site/content/OLD.examples/hacker-news/Comment.svelte diff --git a/site/content/examples/hacker-news/Item.svelte b/site/content/OLD.examples/hacker-news/Item.svelte similarity index 100% rename from site/content/examples/hacker-news/Item.svelte rename to site/content/OLD.examples/hacker-news/Item.svelte diff --git a/site/content/examples/hacker-news/List.svelte b/site/content/OLD.examples/hacker-news/List.svelte similarity index 100% rename from site/content/examples/hacker-news/List.svelte rename to site/content/OLD.examples/hacker-news/List.svelte diff --git a/site/content/examples/hacker-news/Summary.svelte b/site/content/OLD.examples/hacker-news/Summary.svelte similarity index 100% rename from site/content/examples/hacker-news/Summary.svelte rename to site/content/OLD.examples/hacker-news/Summary.svelte diff --git a/site/content/examples/hello-world/App.svelte b/site/content/OLD.examples/hello-world/App.svelte similarity index 100% rename from site/content/examples/hello-world/App.svelte rename to site/content/OLD.examples/hello-world/App.svelte diff --git a/site/content/examples/homepage-demo-hello-world/App.svelte b/site/content/OLD.examples/homepage-demo-hello-world/App.svelte similarity index 100% rename from site/content/examples/homepage-demo-hello-world/App.svelte rename to site/content/OLD.examples/homepage-demo-hello-world/App.svelte diff --git a/site/content/examples/homepage-demo-reactivity/App.svelte b/site/content/OLD.examples/homepage-demo-reactivity/App.svelte similarity index 100% rename from site/content/examples/homepage-demo-reactivity/App.svelte rename to site/content/OLD.examples/homepage-demo-reactivity/App.svelte diff --git a/site/content/examples/homepage-demo-scoped-styles/App.svelte b/site/content/OLD.examples/homepage-demo-scoped-styles/App.svelte similarity index 100% rename from site/content/examples/homepage-demo-scoped-styles/App.svelte rename to site/content/OLD.examples/homepage-demo-scoped-styles/App.svelte diff --git a/site/content/examples/homepage-demo-scoped-styles/Foo.svelte b/site/content/OLD.examples/homepage-demo-scoped-styles/Foo.svelte similarity index 100% rename from site/content/examples/homepage-demo-scoped-styles/Foo.svelte rename to site/content/OLD.examples/homepage-demo-scoped-styles/Foo.svelte diff --git a/site/content/examples/homepage-demo-transitions/App.svelte b/site/content/OLD.examples/homepage-demo-transitions/App.svelte similarity index 100% rename from site/content/examples/homepage-demo-transitions/App.svelte rename to site/content/OLD.examples/homepage-demo-transitions/App.svelte diff --git a/site/content/examples/homepage-demo-transitions/custom-transitions.js b/site/content/OLD.examples/homepage-demo-transitions/custom-transitions.js similarity index 100% rename from site/content/examples/homepage-demo-transitions/custom-transitions.js rename to site/content/OLD.examples/homepage-demo-transitions/custom-transitions.js diff --git a/site/content/examples/homepage-demo-transitions/shape.js b/site/content/OLD.examples/homepage-demo-transitions/shape.js similarity index 100% rename from site/content/examples/homepage-demo-transitions/shape.js rename to site/content/OLD.examples/homepage-demo-transitions/shape.js diff --git a/site/content/examples/if-blocks/App.svelte b/site/content/OLD.examples/if-blocks/App.svelte similarity index 100% rename from site/content/examples/if-blocks/App.svelte rename to site/content/OLD.examples/if-blocks/App.svelte diff --git a/site/content/examples/immutable/App.svelte b/site/content/OLD.examples/immutable/App.svelte similarity index 100% rename from site/content/examples/immutable/App.svelte rename to site/content/OLD.examples/immutable/App.svelte diff --git a/site/content/examples/immutable/ImmutableTodo.svelte b/site/content/OLD.examples/immutable/ImmutableTodo.svelte similarity index 100% rename from site/content/examples/immutable/ImmutableTodo.svelte rename to site/content/OLD.examples/immutable/ImmutableTodo.svelte diff --git a/site/content/examples/immutable/MutableTodo.svelte b/site/content/OLD.examples/immutable/MutableTodo.svelte similarity index 100% rename from site/content/examples/immutable/MutableTodo.svelte rename to site/content/OLD.examples/immutable/MutableTodo.svelte diff --git a/site/content/examples/immutable/flash.js b/site/content/OLD.examples/immutable/flash.js similarity index 100% rename from site/content/examples/immutable/flash.js rename to site/content/OLD.examples/immutable/flash.js diff --git a/site/content/examples/line-chart/App.svelte b/site/content/OLD.examples/line-chart/App.svelte similarity index 100% rename from site/content/examples/line-chart/App.svelte rename to site/content/OLD.examples/line-chart/App.svelte diff --git a/site/content/examples/line-chart/data.js b/site/content/OLD.examples/line-chart/data.js similarity index 100% rename from site/content/examples/line-chart/data.js rename to site/content/OLD.examples/line-chart/data.js diff --git a/site/content/examples/manifest.json b/site/content/OLD.examples/manifest.json similarity index 100% rename from site/content/examples/manifest.json rename to site/content/OLD.examples/manifest.json diff --git a/site/content/examples/modal-with-slot/App.svelte b/site/content/OLD.examples/modal-with-slot/App.svelte similarity index 100% rename from site/content/examples/modal-with-slot/App.svelte rename to site/content/OLD.examples/modal-with-slot/App.svelte diff --git a/site/content/examples/modal-with-slot/Modal.svelte b/site/content/OLD.examples/modal-with-slot/Modal.svelte similarity index 100% rename from site/content/examples/modal-with-slot/Modal.svelte rename to site/content/OLD.examples/modal-with-slot/Modal.svelte diff --git a/site/content/examples/motion-spring/App.svelte b/site/content/OLD.examples/motion-spring/App.svelte similarity index 100% rename from site/content/examples/motion-spring/App.svelte rename to site/content/OLD.examples/motion-spring/App.svelte diff --git a/site/content/examples/nested-components/App.svelte b/site/content/OLD.examples/nested-components/App.svelte similarity index 100% rename from site/content/examples/nested-components/App.svelte rename to site/content/OLD.examples/nested-components/App.svelte diff --git a/site/content/examples/nested-components/Nested.svelte b/site/content/OLD.examples/nested-components/Nested.svelte similarity index 100% rename from site/content/examples/nested-components/Nested.svelte rename to site/content/OLD.examples/nested-components/Nested.svelte diff --git a/site/content/examples/parallax/App.svelte b/site/content/OLD.examples/parallax/App.svelte similarity index 100% rename from site/content/examples/parallax/App.svelte rename to site/content/OLD.examples/parallax/App.svelte diff --git a/site/content/examples/scatterplot/App.svelte b/site/content/OLD.examples/scatterplot/App.svelte similarity index 100% rename from site/content/examples/scatterplot/App.svelte rename to site/content/OLD.examples/scatterplot/App.svelte diff --git a/site/content/examples/scatterplot/Scatterplot.svelte b/site/content/OLD.examples/scatterplot/Scatterplot.svelte similarity index 100% rename from site/content/examples/scatterplot/Scatterplot.svelte rename to site/content/OLD.examples/scatterplot/Scatterplot.svelte diff --git a/site/content/examples/scatterplot/data.js b/site/content/OLD.examples/scatterplot/data.js similarity index 100% rename from site/content/examples/scatterplot/data.js rename to site/content/OLD.examples/scatterplot/data.js diff --git a/site/content/examples/scoped-styles/App.svelte b/site/content/OLD.examples/scoped-styles/App.svelte similarity index 100% rename from site/content/examples/scoped-styles/App.svelte rename to site/content/OLD.examples/scoped-styles/App.svelte diff --git a/site/content/examples/self-references/App.svelte b/site/content/OLD.examples/self-references/App.svelte similarity index 100% rename from site/content/examples/self-references/App.svelte rename to site/content/OLD.examples/self-references/App.svelte diff --git a/site/content/examples/svg-clock/App.svelte b/site/content/OLD.examples/svg-clock/App.svelte similarity index 100% rename from site/content/examples/svg-clock/App.svelte rename to site/content/OLD.examples/svg-clock/App.svelte diff --git a/site/content/examples/transitions-custom/App.svelte b/site/content/OLD.examples/transitions-custom/App.svelte similarity index 100% rename from site/content/examples/transitions-custom/App.svelte rename to site/content/OLD.examples/transitions-custom/App.svelte diff --git a/site/content/examples/transitions-fade/App.svelte b/site/content/OLD.examples/transitions-fade/App.svelte similarity index 100% rename from site/content/examples/transitions-fade/App.svelte rename to site/content/OLD.examples/transitions-fade/App.svelte diff --git a/site/content/examples/transitions-fly/App.svelte b/site/content/OLD.examples/transitions-fly/App.svelte similarity index 100% rename from site/content/examples/transitions-fly/App.svelte rename to site/content/OLD.examples/transitions-fly/App.svelte diff --git a/site/content/examples/transitions-in-out/App.svelte b/site/content/OLD.examples/transitions-in-out/App.svelte similarity index 100% rename from site/content/examples/transitions-in-out/App.svelte rename to site/content/OLD.examples/transitions-in-out/App.svelte diff --git a/site/content/examples/00-introduction/00-adding-data/App.svelte b/site/content/examples/00-introduction/00-adding-data/App.svelte new file mode 100644 index 0000000000..2ab60ba0ac --- /dev/null +++ b/site/content/examples/00-introduction/00-adding-data/App.svelte @@ -0,0 +1,5 @@ + + +
This is a paragraph.
\ No newline at end of file diff --git a/site/content/examples/00-introduction/02-styling/meta.json b/site/content/examples/00-introduction/02-styling/meta.json new file mode 100644 index 0000000000..dcdf2bff01 --- /dev/null +++ b/site/content/examples/00-introduction/02-styling/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Styling" +} \ No newline at end of file diff --git a/site/content/examples/00-introduction/03-nested-components/App.svelte b/site/content/examples/00-introduction/03-nested-components/App.svelte new file mode 100644 index 0000000000..9ba76665bf --- /dev/null +++ b/site/content/examples/00-introduction/03-nested-components/App.svelte @@ -0,0 +1,14 @@ + + + + +This is a paragraph.
+This is another paragraph.
\ No newline at end of file diff --git a/site/content/examples/00-introduction/03-nested-components/meta.json b/site/content/examples/00-introduction/03-nested-components/meta.json new file mode 100644 index 0000000000..5848360a40 --- /dev/null +++ b/site/content/examples/00-introduction/03-nested-components/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Nested components" +} \ No newline at end of file diff --git a/site/content/examples/00-introduction/04-html-tags/App.svelte b/site/content/examples/00-introduction/04-html-tags/App.svelte new file mode 100644 index 0000000000..527e9a4830 --- /dev/null +++ b/site/content/examples/00-introduction/04-html-tags/App.svelte @@ -0,0 +1,5 @@ + + +{@html string}
\ No newline at end of file diff --git a/site/content/examples/00-introduction/04-html-tags/meta.json b/site/content/examples/00-introduction/04-html-tags/meta.json new file mode 100644 index 0000000000..01af59ac84 --- /dev/null +++ b/site/content/examples/00-introduction/04-html-tags/meta.json @@ -0,0 +1,3 @@ +{ + "title": "HTML tags" +} \ No newline at end of file diff --git a/site/content/examples/00-introduction/meta.json b/site/content/examples/00-introduction/meta.json new file mode 100644 index 0000000000..5c8f7bc10b --- /dev/null +++ b/site/content/examples/00-introduction/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Introduction" +} \ No newline at end of file diff --git a/site/content/examples/01-reactivity/00-reactive-assignments/App.svelte b/site/content/examples/01-reactivity/00-reactive-assignments/App.svelte new file mode 100644 index 0000000000..bc50d74cfc --- /dev/null +++ b/site/content/examples/01-reactivity/00-reactive-assignments/App.svelte @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/site/content/examples/01-reactivity/00-reactive-assignments/meta.json b/site/content/examples/01-reactivity/00-reactive-assignments/meta.json new file mode 100644 index 0000000000..ab1554aae4 --- /dev/null +++ b/site/content/examples/01-reactivity/00-reactive-assignments/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Assignments" +} \ No newline at end of file diff --git a/site/content/examples/01-reactivity/01-reactive-declarations/App.svelte b/site/content/examples/01-reactivity/01-reactive-declarations/App.svelte new file mode 100644 index 0000000000..a9fc207851 --- /dev/null +++ b/site/content/examples/01-reactivity/01-reactive-declarations/App.svelte @@ -0,0 +1,14 @@ + + + + +{count} doubled is {doubled}
\ No newline at end of file diff --git a/site/content/examples/01-reactivity/01-reactive-declarations/meta.json b/site/content/examples/01-reactivity/01-reactive-declarations/meta.json new file mode 100644 index 0000000000..d90a3844a9 --- /dev/null +++ b/site/content/examples/01-reactivity/01-reactive-declarations/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Declarations" +} \ No newline at end of file diff --git a/site/content/examples/01-reactivity/02-reactive-statements/App.svelte b/site/content/examples/01-reactivity/02-reactive-statements/App.svelte new file mode 100644 index 0000000000..f757be6f51 --- /dev/null +++ b/site/content/examples/01-reactivity/02-reactive-statements/App.svelte @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/site/content/examples/01-reactivity/02-reactive-statements/meta.json b/site/content/examples/01-reactivity/02-reactive-statements/meta.json new file mode 100644 index 0000000000..b4fe04850a --- /dev/null +++ b/site/content/examples/01-reactivity/02-reactive-statements/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Statements" +} \ No newline at end of file diff --git a/site/content/examples/01-reactivity/meta.json b/site/content/examples/01-reactivity/meta.json new file mode 100644 index 0000000000..c908815e04 --- /dev/null +++ b/site/content/examples/01-reactivity/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Reactivity" +} \ No newline at end of file diff --git a/site/content/examples/02-props/00-declaring-props/App.svelte b/site/content/examples/02-props/00-declaring-props/App.svelte new file mode 100644 index 0000000000..79d7e6b789 --- /dev/null +++ b/site/content/examples/02-props/00-declaring-props/App.svelte @@ -0,0 +1,5 @@ + + +The answer is {answer}
\ No newline at end of file diff --git a/site/content/examples/02-props/00-declaring-props/meta.json b/site/content/examples/02-props/00-declaring-props/meta.json new file mode 100644 index 0000000000..485c2708bd --- /dev/null +++ b/site/content/examples/02-props/00-declaring-props/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Declaring props" +} \ No newline at end of file diff --git a/site/content/examples/02-props/01-default-values/App.svelte b/site/content/examples/02-props/01-default-values/App.svelte new file mode 100644 index 0000000000..f9d63b30d6 --- /dev/null +++ b/site/content/examples/02-props/01-default-values/App.svelte @@ -0,0 +1,6 @@ + + +The answer is {answer}
\ No newline at end of file diff --git a/site/content/examples/02-props/01-default-values/meta.json b/site/content/examples/02-props/01-default-values/meta.json new file mode 100644 index 0000000000..f690d64349 --- /dev/null +++ b/site/content/examples/02-props/01-default-values/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Default values" +} \ No newline at end of file diff --git a/site/content/examples/02-props/02-spread-props/App.svelte b/site/content/examples/02-props/02-spread-props/App.svelte new file mode 100644 index 0000000000..f40d3b89c8 --- /dev/null +++ b/site/content/examples/02-props/02-spread-props/App.svelte @@ -0,0 +1,12 @@ + + +
+ The {name}
package is {speed} fast.
+ Download version {version} from npm
+ and learn more here
+
{x} is greater than 10
+{:else if 5 > x} +{x} is less than 5
+{:else} +{x} is between 5 and 10
+{/if} \ No newline at end of file diff --git a/site/content/examples/03-logic/02-else-if-blocks/meta.json b/site/content/examples/03-logic/02-else-if-blocks/meta.json new file mode 100644 index 0000000000..c778d9f48b --- /dev/null +++ b/site/content/examples/03-logic/02-else-if-blocks/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Else-if blocks" +} \ No newline at end of file diff --git a/site/content/examples/03-logic/03-each-blocks/App.svelte b/site/content/examples/03-logic/03-each-blocks/App.svelte new file mode 100644 index 0000000000..6ea5097be2 --- /dev/null +++ b/site/content/examples/03-logic/03-each-blocks/App.svelte @@ -0,0 +1,17 @@ + + +{valueAtStart} / {value}
\ No newline at end of file diff --git a/site/content/examples/03-logic/04-keyed-each-blocks/meta.json b/site/content/examples/03-logic/04-keyed-each-blocks/meta.json new file mode 100644 index 0000000000..faee8bff8d --- /dev/null +++ b/site/content/examples/03-logic/04-keyed-each-blocks/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Keyed each blocks" +} \ No newline at end of file diff --git a/site/content/examples/03-logic/05-await-blocks/App.svelte b/site/content/examples/03-logic/05-await-blocks/App.svelte new file mode 100644 index 0000000000..8c8036c0f1 --- /dev/null +++ b/site/content/examples/03-logic/05-await-blocks/App.svelte @@ -0,0 +1,30 @@ + + + + +{#await promise} +...waiting
+{:then number} +The number is {number}
+{:catch error} +{error.message}
+{/await} \ No newline at end of file diff --git a/site/content/examples/03-logic/05-await-blocks/meta.json b/site/content/examples/03-logic/05-await-blocks/meta.json new file mode 100644 index 0000000000..c7a809f5ed --- /dev/null +++ b/site/content/examples/03-logic/05-await-blocks/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Await blocks" +} \ No newline at end of file diff --git a/site/content/examples/03-logic/meta.json b/site/content/examples/03-logic/meta.json new file mode 100644 index 0000000000..3ecf1ccee2 --- /dev/null +++ b/site/content/examples/03-logic/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Logic" +} \ No newline at end of file diff --git a/site/content/examples/04-events/00-dom-events/App.svelte b/site/content/examples/04-events/00-dom-events/App.svelte new file mode 100644 index 0000000000..f26112f06c --- /dev/null +++ b/site/content/examples/04-events/00-dom-events/App.svelte @@ -0,0 +1,16 @@ + + + + +{a} + {b} = {a + b}
\ No newline at end of file diff --git a/site/content/examples/05-bindings/01-numeric-inputs/meta.json b/site/content/examples/05-bindings/01-numeric-inputs/meta.json new file mode 100644 index 0000000000..72f8579704 --- /dev/null +++ b/site/content/examples/05-bindings/01-numeric-inputs/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Numeric inputs" +} \ No newline at end of file diff --git a/site/content/examples/05-bindings/02-checkbox-inputs/App.svelte b/site/content/examples/05-bindings/02-checkbox-inputs/App.svelte new file mode 100644 index 0000000000..b82d31e783 --- /dev/null +++ b/site/content/examples/05-bindings/02-checkbox-inputs/App.svelte @@ -0,0 +1,18 @@ + + + + +{#if yes} +Thank you. We will bombard your inbox and sell your personal details.
+{:else} +You must opt in to continue. If you're not paying, you're the product.
+{/if} + + \ No newline at end of file diff --git a/site/content/examples/05-bindings/02-checkbox-inputs/meta.json b/site/content/examples/05-bindings/02-checkbox-inputs/meta.json new file mode 100644 index 0000000000..723312a3d9 --- /dev/null +++ b/site/content/examples/05-bindings/02-checkbox-inputs/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Checkbox inputs" +} \ No newline at end of file diff --git a/site/content/examples/05-bindings/03-group-inputs/App.svelte b/site/content/examples/05-bindings/03-group-inputs/App.svelte new file mode 100644 index 0000000000..a46c61c7e7 --- /dev/null +++ b/site/content/examples/05-bindings/03-group-inputs/App.svelte @@ -0,0 +1,52 @@ + + +Please select at least one flavour
+{:else if flavours.length > scoops} +Can't order more flavours than scoops!
+{:else} ++ You ordered {scoops} {scoops === 1 ? 'scoop' : 'scoops'} + of {join(flavours)} +
+{/if} diff --git a/site/content/examples/05-bindings/03-group-inputs/meta.json b/site/content/examples/05-bindings/03-group-inputs/meta.json new file mode 100644 index 0000000000..2203d6e6fa --- /dev/null +++ b/site/content/examples/05-bindings/03-group-inputs/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Group inputs" +} \ No newline at end of file diff --git a/site/content/examples/05-bindings/04-textarea-inputs/App.svelte b/site/content/examples/05-bindings/04-textarea-inputs/App.svelte new file mode 100644 index 0000000000..be338bf47f --- /dev/null +++ b/site/content/examples/05-bindings/04-textarea-inputs/App.svelte @@ -0,0 +1,12 @@ + + + + + + +{@html marked(value)} \ No newline at end of file diff --git a/site/content/examples/05-bindings/04-textarea-inputs/meta.json b/site/content/examples/05-bindings/04-textarea-inputs/meta.json new file mode 100644 index 0000000000..01adf6b5cf --- /dev/null +++ b/site/content/examples/05-bindings/04-textarea-inputs/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Textarea inputs" +} \ No newline at end of file diff --git a/site/content/examples/05-bindings/05-select-bindings/App.svelte b/site/content/examples/05-bindings/05-select-bindings/App.svelte new file mode 100644 index 0000000000..3f1e7fa7e1 --- /dev/null +++ b/site/content/examples/05-bindings/05-select-bindings/App.svelte @@ -0,0 +1,39 @@ + + + + +selected question {selected ? selected.id : '[waiting...]'}
\ No newline at end of file diff --git a/site/content/examples/05-bindings/05-select-bindings/meta.json b/site/content/examples/05-bindings/05-select-bindings/meta.json new file mode 100644 index 0000000000..fe170eb0fc --- /dev/null +++ b/site/content/examples/05-bindings/05-select-bindings/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Select bindings" +} \ No newline at end of file diff --git a/site/content/examples/05-bindings/06-multiple-select-bindings/App.svelte b/site/content/examples/05-bindings/06-multiple-select-bindings/App.svelte new file mode 100644 index 0000000000..d808850158 --- /dev/null +++ b/site/content/examples/05-bindings/06-multiple-select-bindings/App.svelte @@ -0,0 +1,53 @@ + + +Please select at least one flavour
+{:else if flavours.length > scoops} +Can't order more flavours than scoops!
+{:else} ++ You ordered {scoops} {scoops === 1 ? 'scoop' : 'scoops'} + of {join(flavours)} +
+{/if} diff --git a/site/content/examples/05-bindings/06-multiple-select-bindings/meta.json b/site/content/examples/05-bindings/06-multiple-select-bindings/meta.json new file mode 100644 index 0000000000..abf7635407 --- /dev/null +++ b/site/content/examples/05-bindings/06-multiple-select-bindings/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Select multiple" +} \ No newline at end of file diff --git a/site/content/examples/05-bindings/07-each-block-bindings/App.svelte b/site/content/examples/05-bindings/07-each-block-bindings/App.svelte new file mode 100644 index 0000000000..92bdc7754f --- /dev/null +++ b/site/content/examples/05-bindings/07-each-block-bindings/App.svelte @@ -0,0 +1,39 @@ + + +From Blender Open Projects. CC-BY
+ +size: {w}px x {h}px
+ +loading...
+ {/each} ++ The page has been open for + {seconds} {seconds === 1 ? 'second' : 'seconds'} +
\ No newline at end of file diff --git a/site/content/examples/06-lifecycle/01-ondestroy/meta.json b/site/content/examples/06-lifecycle/01-ondestroy/meta.json new file mode 100644 index 0000000000..d87febd1a5 --- /dev/null +++ b/site/content/examples/06-lifecycle/01-ondestroy/meta.json @@ -0,0 +1,3 @@ +{ + "title": "onDestroy" +} \ No newline at end of file diff --git a/site/content/examples/06-lifecycle/01-ondestroy/utils.js b/site/content/examples/06-lifecycle/01-ondestroy/utils.js new file mode 100644 index 0000000000..0f75f29e2a --- /dev/null +++ b/site/content/examples/06-lifecycle/01-ondestroy/utils.js @@ -0,0 +1,9 @@ +import { onDestroy } from 'svelte'; + +export function onInterval(callback, milliseconds) { + const interval = setInterval(callback, milliseconds); + + onDestroy(() => { + clearInterval(interval); + }); +} \ No newline at end of file diff --git a/site/content/examples/06-lifecycle/02-update/App.svelte b/site/content/examples/06-lifecycle/02-update/App.svelte new file mode 100644 index 0000000000..373b6dcb6a --- /dev/null +++ b/site/content/examples/06-lifecycle/02-update/App.svelte @@ -0,0 +1,106 @@ + + + + ++ This page has been open for + {$elapsed} {$elapsed === 1 ? 'second' : 'seconds'} +
\ No newline at end of file diff --git a/site/content/examples/07-stores/03-derived-stores/meta.json b/site/content/examples/07-stores/03-derived-stores/meta.json new file mode 100644 index 0000000000..23105b0bfa --- /dev/null +++ b/site/content/examples/07-stores/03-derived-stores/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Derived stores" +} \ No newline at end of file diff --git a/site/content/examples/07-stores/03-derived-stores/stores.js b/site/content/examples/07-stores/03-derived-stores/stores.js new file mode 100644 index 0000000000..2f3af1247a --- /dev/null +++ b/site/content/examples/07-stores/03-derived-stores/stores.js @@ -0,0 +1,18 @@ +import { readable, derive } from 'svelte/store'; + +export const time = readable(function start(set) { + const interval = setInterval(() => { + set(new Date()); + }, 1000); + + return function stop() { + clearInterval(interval); + }; +}, new Date()); + +const start = new Date(); + +export const elapsed = derive( + time, + $time => Math.round(($time - start) / 1000) +); \ No newline at end of file diff --git a/site/content/examples/07-stores/04-custom-stores/App.svelte b/site/content/examples/07-stores/04-custom-stores/App.svelte new file mode 100644 index 0000000000..a320cc052f --- /dev/null +++ b/site/content/examples/07-stores/04-custom-stores/App.svelte @@ -0,0 +1,9 @@ + + ++ Fades in and out +
+{/if} \ No newline at end of file diff --git a/site/content/examples/09-transitions/00-transition/meta.json b/site/content/examples/09-transitions/00-transition/meta.json new file mode 100644 index 0000000000..e07975554f --- /dev/null +++ b/site/content/examples/09-transitions/00-transition/meta.json @@ -0,0 +1,3 @@ +{ + "title": "The transition directive" +} \ No newline at end of file diff --git a/site/content/examples/09-transitions/01-adding-parameters-to-transitions/App.svelte b/site/content/examples/09-transitions/01-adding-parameters-to-transitions/App.svelte new file mode 100644 index 0000000000..01047f5e37 --- /dev/null +++ b/site/content/examples/09-transitions/01-adding-parameters-to-transitions/App.svelte @@ -0,0 +1,15 @@ + + + + +{#if visible} ++ Flies in and out +
+{/if} \ No newline at end of file diff --git a/site/content/examples/09-transitions/01-adding-parameters-to-transitions/meta.json b/site/content/examples/09-transitions/01-adding-parameters-to-transitions/meta.json new file mode 100644 index 0000000000..517bc54c3c --- /dev/null +++ b/site/content/examples/09-transitions/01-adding-parameters-to-transitions/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Adding parameters" +} \ No newline at end of file diff --git a/site/content/examples/09-transitions/02-in-and-out/App.svelte b/site/content/examples/09-transitions/02-in-and-out/App.svelte new file mode 100644 index 0000000000..36d36664e6 --- /dev/null +++ b/site/content/examples/09-transitions/02-in-and-out/App.svelte @@ -0,0 +1,15 @@ + + + + +{#if visible} ++ Flies in, fades out +
+{/if} \ No newline at end of file diff --git a/site/content/examples/09-transitions/02-in-and-out/meta.json b/site/content/examples/09-transitions/02-in-and-out/meta.json new file mode 100644 index 0000000000..627f409fa4 --- /dev/null +++ b/site/content/examples/09-transitions/02-in-and-out/meta.json @@ -0,0 +1,3 @@ +{ + "title": "In and out" +} \ No newline at end of file diff --git a/site/content/examples/09-transitions/03-custom-css-transitions/App.svelte b/site/content/examples/09-transitions/03-custom-css-transitions/App.svelte new file mode 100644 index 0000000000..6e8dfcaf08 --- /dev/null +++ b/site/content/examples/09-transitions/03-custom-css-transitions/App.svelte @@ -0,0 +1,49 @@ + + + + + + +{#if visible} ++ The quick brown fox jumps over the lazy dog +
+{/if} \ No newline at end of file diff --git a/site/content/examples/09-transitions/04-custom-js-transitions/meta.json b/site/content/examples/09-transitions/04-custom-js-transitions/meta.json new file mode 100644 index 0000000000..1ec11d90f9 --- /dev/null +++ b/site/content/examples/09-transitions/04-custom-js-transitions/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Custom JS transitions" +} \ No newline at end of file diff --git a/site/content/examples/09-transitions/05-transition-events/App.svelte b/site/content/examples/09-transitions/05-transition-events/App.svelte new file mode 100644 index 0000000000..da79897365 --- /dev/null +++ b/site/content/examples/09-transitions/05-transition-events/App.svelte @@ -0,0 +1,25 @@ + + +status: {status}
+ + + +{#if visible} ++ Flies in and out +
+{/if} \ No newline at end of file diff --git a/site/content/examples/09-transitions/05-transition-events/meta.json b/site/content/examples/09-transitions/05-transition-events/meta.json new file mode 100644 index 0000000000..b46e28feed --- /dev/null +++ b/site/content/examples/09-transitions/05-transition-events/meta.json @@ -0,0 +1,3 @@ +{ + "title": "Transition events" +} \ No newline at end of file diff --git a/site/content/examples/09-transitions/06-deferred-transitions/App.svelte b/site/content/examples/09-transitions/06-deferred-transitions/App.svelte new file mode 100644 index 0000000000..c46096c204 --- /dev/null +++ b/site/content/examples/09-transitions/06-deferred-transitions/App.svelte @@ -0,0 +1,146 @@ + + + + +This is a box. It can contain anything.
+This is a box. It can contain anything.
+I am being hovered upon.
+ {:else} +Hover over me!
+ {/if} +I am being hovered upon.
+ {:else} +Hover over me!
+ {/if} +I am being hovered upon.
+ {:else} +Hover over me!
+ {/if} +{keyCode}
+ {:else} +Focus this window and press any key
+ {/if} +{composer} / performed by {performer}
+ + +{composer} / performed by {performer}
+ + +