From 60a9fb8c6a9f6e6c2ce3d29de13cca7aae1eac7b Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Sat, 11 Jan 2025 12:40:23 -0800 Subject: [PATCH] Added bias term to fix slider text slightly --- .../sub-block/components/slider-input.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/w/components/blocks/components/workflow-block/sub-block/components/slider-input.tsx b/app/w/components/blocks/components/workflow-block/sub-block/components/slider-input.tsx index 170e72962b..b747bd30da 100644 --- a/app/w/components/blocks/components/workflow-block/sub-block/components/slider-input.tsx +++ b/app/w/components/blocks/components/workflow-block/sub-block/components/slider-input.tsx @@ -30,13 +30,11 @@ export function SliderInput({ left: `clamp(0%, ${ ((sliderValue - min) / (max - min)) * 100 }%, 100%)`, - transform: `translateX(-${ - ((sliderValue - min) / (max - min)) * 100 === 0 - ? 0 - : ((sliderValue - min) / (max - min)) * 100 === 100 - ? 100 - : 50 - }%)`, + transform: `translateX(-${(() => { + const percentage = ((sliderValue - min) / (max - min)) * 100 + const bias = -25 * Math.sin((percentage * Math.PI) / 50) + return percentage === 0 ? 0 : percentage === 100 ? 100 : 50 + bias + })()}%)`, top: '24px', }} >