diff --git a/src/components/Scroller/Scroller.mdx b/src/components/Scroller/Scroller.mdx index 31c9de51..74b03d34 100644 --- a/src/components/Scroller/Scroller.mdx +++ b/src/components/Scroller/Scroller.mdx @@ -6,9 +6,9 @@ import * as ScrollerStories from './Scroller.stories.svelte'; # Scroller -The `Scroller` component creates a basic scrollytelling graphic with layout options. +The `Scroller` component creates a basic scrollytelling graphic with layout options -> This component is designed to handle most common layouts for scrollytelling. To make something more complex, customise [ScrollerBase](https://github.com/reuters-graphics/graphics-components/blob/main/src/components/Scroller/ScrollerBase/index.svelte), which is a Svelte 5 version of the [svelte-scroller](https://github.com/sveltejs/svelte-scroller). +This component is designed to handle most common layouts for scrollytelling. To make something more complex, customise [ScrollerBase](?path=/story/components-graphics-scrollerbase--docs), which is a Svelte 5 version of the [svelte-scroller](https://github.com/sveltejs/svelte-scroller). [Demo](?path=/story/components-graphics-scroller--demo) diff --git a/src/components/Scroller/Scroller.svelte b/src/components/Scroller/Scroller.svelte index 777cef59..c9519cfb 100644 --- a/src/components/Scroller/Scroller.svelte +++ b/src/components/Scroller/Scroller.svelte @@ -1,6 +1,6 @@ - Index {myIndex}: This is the third section.

{/snippet} -
+ ``` +> **Important❗:** Make sure the HTML element containing each foreground is a div with the class `step-foreground-container`. If you're modifying this to something else, pass the appropriate selector to the `query` prop. + To add your own styling, you can write styles in a global SCSS stylesheet: ```scss diff --git a/src/components/SvelteScroller/SvelteScroller.stories.svelte b/src/components/ScrollerBase/ScrollerBase.stories.svelte similarity index 88% rename from src/components/SvelteScroller/SvelteScroller.stories.svelte rename to src/components/ScrollerBase/ScrollerBase.stories.svelte index 30660c3f..28beac95 100644 --- a/src/components/SvelteScroller/SvelteScroller.stories.svelte +++ b/src/components/ScrollerBase/ScrollerBase.stories.svelte @@ -1,10 +1,10 @@ @@ -14,7 +14,7 @@ - Index {myIndex}: This is the third section.

{/snippet} -
+
diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/ai-foreground.svelte b/src/components/SvelteScroller/demo/components/ai2svelte/ai-foreground.svelte deleted file mode 100644 index 6af40a5d..00000000 --- a/src/components/SvelteScroller/demo/components/ai2svelte/ai-foreground.svelte +++ /dev/null @@ -1,112 +0,0 @@ - - -
- - {#if width && width >= 0} -
-
-
-
-

Likelihood of something happening

-
- -
-

0-25%

-
-
-

50-75%

-
-
-

75-100%

-
-
-

25-50%

-
-
- {/if} -
- - - - - - diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/ai-scroller-1.svelte b/src/components/SvelteScroller/demo/components/ai2svelte/ai-scroller-1.svelte deleted file mode 100644 index df60d003..00000000 --- a/src/components/SvelteScroller/demo/components/ai2svelte/ai-scroller-1.svelte +++ /dev/null @@ -1,121 +0,0 @@ - - - - -
- - {#if width && width >= 1200} -
-
-
-
- {/if} - - {#if width && width >= 930 && width < 1200} -
-
-
-
- {/if} - - {#if width && width >= 660 && width < 930} -
-
-
-
- {/if} - - {#if width && width >= 510 && width < 660} -
-
-
-
- {/if} - - {#if width && width >= 0 && width < 510} -
-
-
-
- {/if} -
- - - - - - - diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/ai-scroller-2.svelte b/src/components/SvelteScroller/demo/components/ai2svelte/ai-scroller-2.svelte deleted file mode 100644 index 18a5870f..00000000 --- a/src/components/SvelteScroller/demo/components/ai2svelte/ai-scroller-2.svelte +++ /dev/null @@ -1,310 +0,0 @@ - - - - -
- - {#if width && width >= 1200} -
-
-
-
-

This thing here is

-

particularly important

-
-
- {/if} - - {#if width && width >= 930 && width < 1200} -
-
-
-
-

This thing here is

-

particularly important

-
-
- {/if} - - {#if width && width >= 660 && width < 930} -
-
-
-
-

This thing here is

-

particularly important

-
-
- {/if} - - {#if width && width >= 510 && width < 660} -
-
-
-
-

This thing here is

-

particularly important

-
-
- {/if} - - {#if width && width >= 0 && width < 510} -
-
-
-
-

This thing here is

-

particularly important

-
-
- {/if} -
- - - - - - diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/ai-scroller-3.svelte b/src/components/SvelteScroller/demo/components/ai2svelte/ai-scroller-3.svelte deleted file mode 100644 index 33538e06..00000000 --- a/src/components/SvelteScroller/demo/components/ai2svelte/ai-scroller-3.svelte +++ /dev/null @@ -1,310 +0,0 @@ - - - - -
- - {#if width && width >= 1200} -
-
-
-
-

Something

-

happened here

-
-
- {/if} - - {#if width && width >= 930 && width < 1200} -
-
-
-
-

Something

-

happened here

-
-
- {/if} - - {#if width && width >= 660 && width < 930} -
-
-
-
-

Something

-

happened here

-
-
- {/if} - - {#if width && width >= 510 && width < 660} -
-
-
-
-

Something

-

happened here

-
-
- {/if} - - {#if width && width >= 0 && width < 510} -
-
-
-
-

Something

-

happened here

-
-
- {/if} -
- - - - - - diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/Body-issues-key-xs.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/Body-issues-key-xs.png deleted file mode 100644 index e03e5e19..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/Body-issues-key-xs.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-lg.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-lg.png deleted file mode 100644 index de1888e1..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-lg.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-md.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-md.png deleted file mode 100644 index ead091c1..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-md.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-sm.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-sm.png deleted file mode 100644 index dada63ca..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-sm.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-xl.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-xl.png deleted file mode 100644 index 55823fb4..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-xl.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-xs.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-xs.png deleted file mode 100644 index 26e44491..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-1-xs.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-lg.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-lg.png deleted file mode 100644 index 96196438..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-lg.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-md.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-md.png deleted file mode 100644 index 37450dcb..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-md.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-sm.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-sm.png deleted file mode 100644 index e2368628..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-sm.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-xl.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-xl.png deleted file mode 100644 index fa157444..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-xl.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-xs.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-xs.png deleted file mode 100644 index 0fef62ac..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-2-xs.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-lg.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-lg.png deleted file mode 100644 index 9e4f0377..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-lg.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-md.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-md.png deleted file mode 100644 index 91cfa1a1..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-md.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-sm.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-sm.png deleted file mode 100644 index 876a388d..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-sm.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-xl.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-xl.png deleted file mode 100644 index 03e47dde..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-xl.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-xs.png b/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-xs.png deleted file mode 100644 index 26223ca8..00000000 Binary files a/src/components/SvelteScroller/demo/components/ai2svelte/images/step-3-xs.png and /dev/null differ diff --git a/src/components/SvelteScroller/demo/components/basic/InteractiveForeground.svelte b/src/components/SvelteScroller/demo/components/basic/InteractiveForeground.svelte deleted file mode 100644 index 769ec63b..00000000 --- a/src/components/SvelteScroller/demo/components/basic/InteractiveForeground.svelte +++ /dev/null @@ -1,17 +0,0 @@ - - -

Interactive step

- -

The count is {count}

- - diff --git a/src/components/SvelteScroller/demo/components/basic/Step.svelte b/src/components/SvelteScroller/demo/components/basic/Step.svelte deleted file mode 100644 index d914ec8a..00000000 --- a/src/components/SvelteScroller/demo/components/basic/Step.svelte +++ /dev/null @@ -1,18 +0,0 @@ - - -
- - diff --git a/src/index.ts b/src/index.ts index 67eb9f22..93f06e4f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,7 +40,7 @@ export { default as SiteFooter } from './components/SiteFooter/SiteFooter.svelte export { default as SiteHeader } from './components/SiteHeader/SiteHeader.svelte'; export { default as SiteHeadline } from './components/SiteHeadline/SiteHeadline.svelte'; export { default as Spinner } from './components/Spinner/Spinner.svelte'; -export { default as SvelteScroller } from './components/SvelteScroller/SvelteScroller.svelte'; +export { default as ScrollerBase } from './components/ScrollerBase/ScrollerBase.svelte'; export { default as SponsorshipAd } from './components/AdSlot/SponsorshipAd.svelte'; export { default as Table } from './components/Table/Table.svelte'; export { default as Theme, themes } from './components/Theme/Theme.svelte';