import React from "react"; import { motion, AnimatePresence } from "framer-motion"; interface AnimatedRangeInputProps { value: number; onChange: (value: number) => void; icon?: React.ReactNode; labelId: string; fillColor?: string; } const AnimatedRangeInput: React.FC = ({ value, onChange, icon, labelId, fillColor = "#ff5722", // Orange }) => { // Handle reverse direction: Top = 100, Bottom = 0 const handleChange = (e: React.ChangeEvent) => { const rawValue = Number(e.target.value); const correctedValue = 100 - rawValue; onChange(correctedValue); }; return (
{/* Left side icon */}
{icon}
{/* Slider container */}
{/* Animated Fill (based on `value`) */} {/* Value display */} {value}% {/* Hidden rotated input */}
); }; export default AnimatedRangeInput;