From 351061dc617bb4f16188addf05ed91954e91f8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Wed, 7 Sep 2022 22:47:00 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Rework=20About=20page=20Process=20s?= =?UTF-8?q?ection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/animations/transitions.ts | 25 +++++ src/components/molecules/ProcessStep.svelte | 79 +++++++------ src/routes/about/+page.svelte | 66 +++++------ src/style/molecules/_process-step.scss | 116 ++++++-------------- src/style/pages/_about.scss | 54 ++++----- 5 files changed, 148 insertions(+), 192 deletions(-) create mode 100644 src/animations/transitions.ts diff --git a/src/animations/transitions.ts b/src/animations/transitions.ts new file mode 100644 index 0000000..350c4e4 --- /dev/null +++ b/src/animations/transitions.ts @@ -0,0 +1,25 @@ +import { animate } from 'motion' +import { quartOut } from './easings' + +export const scaleFade = (node: HTMLElement, { + delay = 0, + duration = 1, + scale = [0.7, 1], + opacity = [1, 0], + x = null, +}) => { + return { + css: () => { + animate(node, { + scale, + opacity, + x, + z: 0, + }, { + easing: quartOut, + duration, + delay, + }) + } + } +} \ No newline at end of file diff --git a/src/components/molecules/ProcessStep.svelte b/src/components/molecules/ProcessStep.svelte index c18a362..9652a3e 100644 --- a/src/components/molecules/ProcessStep.svelte +++ b/src/components/molecules/ProcessStep.svelte @@ -3,53 +3,60 @@ -
-
- {#if image || video} -
- {#if image} - {image.title} - {:else if video} - - {/if} -
+{#if visible} +
+ {#if image || video} +
+ {#if image} + {image.title} + {:else if video} + {/if} - -
-

{title}

-
- {@html text} -
-
- -
-
\ No newline at end of file + {/if} + +
+ {@html text} +
+
+{/if} \ No newline at end of file diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index 9455f0c..3e089c5 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -3,10 +3,10 @@