From 030c188ab32e2dee648c5a647cd3d942f12bf004 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 07:48:44 +0000 Subject: [PATCH] Improve slider appearance Make slider endpoints symmetric and colored. --- src/components/BalancedTernaryGame.tsx | 4 ++-- src/components/TernaryNumberGame.tsx | 4 ++-- src/components/ui/range-slider.tsx | 29 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 src/components/ui/range-slider.tsx diff --git a/src/components/BalancedTernaryGame.tsx b/src/components/BalancedTernaryGame.tsx index 4ec6baf..ac9083e 100644 --- a/src/components/BalancedTernaryGame.tsx +++ b/src/components/BalancedTernaryGame.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; -import { Slider } from '@/components/ui/slider'; +import { RangeSlider } from '@/components/ui/range-slider'; import { Label } from '@/components/ui/label'; import { Plus, Minus } from 'lucide-react'; import SocialShare from '@/components/SocialShare'; @@ -194,7 +194,7 @@ const BalancedTernaryGame: React.FC = ({ showSocialSha
- { // Snap to multiples of 10 if close enough diff --git a/src/components/TernaryNumberGame.tsx b/src/components/TernaryNumberGame.tsx index 190a5c0..be2e4c5 100644 --- a/src/components/TernaryNumberGame.tsx +++ b/src/components/TernaryNumberGame.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; -import { Slider } from '@/components/ui/slider'; +import { RangeSlider } from '@/components/ui/range-slider'; import { Label } from '@/components/ui/label'; import SocialShare from '@/components/SocialShare'; @@ -145,7 +145,7 @@ const TernaryNumberGame: React.FC = ({ showSocialShare =
- { // Snap to multiples of 10 if close enough diff --git a/src/components/ui/range-slider.tsx b/src/components/ui/range-slider.tsx new file mode 100644 index 0000000..e1e3dcb --- /dev/null +++ b/src/components/ui/range-slider.tsx @@ -0,0 +1,29 @@ +import * as React from "react" +import * as SliderPrimitive from "@radix-ui/react-slider" + +import { cn } from "@/lib/utils" + +const RangeSlider = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + + + {/* First thumb (left/min) - Blue */} + + {/* Second thumb (right/max) - Red */} + + +)) +RangeSlider.displayName = SliderPrimitive.Root.displayName + +export { RangeSlider } \ No newline at end of file