From c3a272bf7bcf52821fd2d8a549109ab072b60aa2 Mon Sep 17 00:00:00 2001 From: Jon McClure Date: Mon, 22 Aug 2022 15:43:35 +0100 Subject: [PATCH] fixes for beforeAfter --- src/components/BeforeAfter/BeforeAfter.svelte | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/BeforeAfter/BeforeAfter.svelte b/src/components/BeforeAfter/BeforeAfter.svelte index 44454e81..c257cab8 100644 --- a/src/components/BeforeAfter/BeforeAfter.svelte +++ b/src/components/BeforeAfter/BeforeAfter.svelte @@ -39,7 +39,7 @@ /** Drag handle colour */ export let handleColour = 'white'; /** Drag handle opacity */ - export let handleInactiveOpacity = 0.4; + export let handleInactiveOpacity = 0.6; /** Margin at the edge of the image to stop dragging */ export let handleMargin = 20; /** Percentage of the component width the handle will travel ona key press */ @@ -100,16 +100,16 @@ const move = (e) => { if (sliding && imgOffset) { const el = e.touches ? e.touches[0] : e; - const figureOffset = figure - ? parseInt(window.getComputedStyle(figure).marginLeft.slice(0, -2)) - : 0; + const figureOffset = figure ? + parseInt(window.getComputedStyle(figure).marginLeft.slice(0, -2)) : + 0; let x = el.pageX - figureOffset - imgOffset.left; x = - x < handleMargin - ? handleMargin - : x > w - handleMargin - ? w - handleMargin - : x; + x < handleMargin ? + handleMargin : + x > w - handleMargin ? + w - handleMargin : + x; offset = x / w; } }; @@ -241,6 +241,7 @@ top: 0; left: 0; z-index: 20; + margin: 0; &.after { z-index: 21; } @@ -258,7 +259,6 @@ :global { p { font-family: var(--theme-font-family-note, $font-family-display); - color: var(--theme-colour-text-primary); font-size: 1rem; line-height: 1.2rem; &:last-child {