@@ -6,6 +6,13 @@ import { SequenceType } from "../types/sequence";
66import { generateSequence } from "../utils/sequenceCalculations" ;
77import Button from "./Button" ;
88import Card from "./Card" ;
9+ import {
10+ TbMathFunction ,
11+ TbNumbers ,
12+ TbListNumbers ,
13+ TbCopy ,
14+ TbArrowLeft ,
15+ } from "react-icons/tb" ;
916
1017interface GenerateSequenceProps {
1118 sequenceType : SequenceType ;
@@ -62,21 +69,26 @@ export default function GenerateSequence({
6269 } ;
6370
6471 const inputClasses =
65- "w-full px-4 py-3 rounded-lg bg-white/5 border border-white/10 text-white placeholder-white/30 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary/50 transition-all" ;
72+ "w-full px-10 py-3 rounded-xl bg-white/5 border border-white/10 text-white placeholder-white/30 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary/50 transition-all hover:bg-white/10 " ;
6673
6774 return (
6875 < div className = "mx-auto w-full max-w-2xl space-y-8" >
69- < div className = "mb-8 flex items-center justify-between" >
70- < Button onClick = { goBack } variant = "secondary" className = "px-4!" >
71- ← Back
76+ < div className = "flex items-center justify-between" >
77+ < Button
78+ onClick = { goBack }
79+ variant = "secondary"
80+ size = "sm"
81+ icon = { < TbArrowLeft /> }
82+ >
83+ Back
7284 </ Button >
7385 < motion . h2
7486 className = "text-center text-2xl font-bold md:text-3xl"
7587 initial = { { opacity : 0 , y : - 10 } }
7688 animate = { { opacity : 1 , y : 0 } }
7789 >
7890 Generate{ " " }
79- < span className = { `text-seq-${ sequenceType } ` } >
91+ < span className = { `text-seq-${ sequenceType } text-glow ` } >
8092 { sequenceType . charAt ( 0 ) . toUpperCase ( ) + sequenceType . slice ( 1 ) }
8193 </ span > { " " }
8294 Sequence
@@ -87,53 +99,65 @@ export default function GenerateSequence({
8799 < form onSubmit = { handleSubmit } className = "space-y-6" >
88100 < div className = "grid grid-cols-1 gap-6 md:grid-cols-2" >
89101 < div className = "space-y-2" >
90- < label className = "block text-sm font-medium text-white/80" >
102+ < label className = "ml-1 block text-sm font-medium text-white/80" >
91103 Initial Term
92104 </ label >
93- < input
94- type = { sequenceType === "alphabet" ? "text" : "number" }
95- value = { initialTerm }
96- onChange = { ( e ) => setInitialTerm ( e . target . value ) }
97- required
98- placeholder = { sequenceType === "alphabet" ? "e.g., A" : "e.g., 1" }
99- className = { inputClasses }
100- />
105+ < div className = "relative" >
106+ < TbMathFunction className = "absolute top-1/2 left-3 -translate-y-1/2 text-lg text-white/40" />
107+ < input
108+ type = { sequenceType === "alphabet" ? "text" : "number" }
109+ value = { initialTerm }
110+ onChange = { ( e ) => setInitialTerm ( e . target . value ) }
111+ required
112+ placeholder = {
113+ sequenceType === "alphabet" ? "e.g., A" : "e.g., 1"
114+ }
115+ className = { inputClasses }
116+ />
117+ </ div >
101118 </ div >
102119
103120 < div className = "space-y-2" >
104- < label className = "block text-sm font-medium text-white/80" >
121+ < label className = "ml-1 block text-sm font-medium text-white/80" >
105122 { getLabel ( ) }
106123 </ label >
107- < input
108- type = "number"
109- value = { commonDifferenceOrRatio }
110- onChange = { ( e ) => setCommonDifferenceOrRatio ( e . target . value ) }
111- required
112- placeholder = "e.g., 2"
113- className = { inputClasses }
114- />
124+ < div className = "relative" >
125+ < TbNumbers className = "absolute top-1/2 left-3 -translate-y-1/2 text-lg text-white/40" />
126+ < input
127+ type = "number"
128+ value = { commonDifferenceOrRatio }
129+ onChange = { ( e ) => setCommonDifferenceOrRatio ( e . target . value ) }
130+ required
131+ placeholder = "e.g., 2"
132+ className = { inputClasses }
133+ />
134+ </ div >
115135 </ div >
116136
117137 < div className = "space-y-2 md:col-span-2" >
118- < label className = "block text-sm font-medium text-white/80" >
138+ < label className = "ml-1 block text-sm font-medium text-white/80" >
119139 Number of Terms
120140 </ label >
121- < input
122- type = "number"
123- value = { numberOfTerms }
124- onChange = { ( e ) => setNumberOfTerms ( e . target . value ) }
125- required
126- placeholder = "e.g., 5"
127- className = { inputClasses }
128- />
141+ < div className = "relative" >
142+ < TbListNumbers className = "absolute top-1/2 left-3 -translate-y-1/2 text-lg text-white/40" />
143+ < input
144+ type = "number"
145+ value = { numberOfTerms }
146+ onChange = { ( e ) => setNumberOfTerms ( e . target . value ) }
147+ required
148+ placeholder = "e.g., 5"
149+ className = { inputClasses }
150+ />
151+ </ div >
129152 </ div >
130153 </ div >
131154
132155 < Button
133156 type = "submit"
134157 variant = { sequenceType }
135158 fullWidth
136- className = "text-lg"
159+ size = "lg"
160+ className = "shadow-xl"
137161 >
138162 Generate Sequence
139163 </ Button >
@@ -144,26 +168,31 @@ export default function GenerateSequence({
144168 initial = { { opacity : 0 , y : 20 } }
145169 animate = { { opacity : 1 , y : 0 } }
146170 >
147- < Card className = "space-y-4 border-white/5 bg-black/20" >
148- < div className = "mb-4 flex items-center justify-between" >
171+ < Card
172+ className = "space-y-6 border-white/10 bg-black/40 backdrop-blur-md"
173+ hoverEffect
174+ >
175+ < div className = "flex items-center justify-between border-b border-white/10 pb-4" >
149176 < h3 className = "text-xl font-bold text-white/90" > Results</ h3 >
150177 < Button
151178 onClick = { handleCopy }
152179 variant = "secondary"
153- className = "px-3 py-1 text-xs"
180+ size = "sm"
181+ icon = { < TbCopy /> }
154182 >
155183 Copy
156184 </ Button >
157185 </ div >
158186
159- < div className = "flex flex-wrap justify-center gap-2 " >
187+ < div className = "flex flex-wrap justify-center gap-3 " >
160188 { generatedSequence . map ( ( value , index ) => (
161189 < motion . div
162190 key = { index }
163191 initial = { { opacity : 0 , scale : 0 } }
164192 animate = { { opacity : 1 , scale : 1 } }
165- transition = { { delay : index * 0.05 } }
166- className = { `bg-seq-${ sequenceType } bg-opacity-20 border border-seq-${ sequenceType } /30 min-w-12 rounded-lg px-4 py-2 text-center font-mono text-lg font-bold` }
193+ transition = { { delay : index * 0.05 , type : "spring" } }
194+ whileHover = { { scale : 1.1 , translateY : - 2 } }
195+ className = { `bg-seq-${ sequenceType } /20 border border-seq-${ sequenceType } /30 min-w-[60px] rounded-xl px-4 py-3 text-center font-mono text-xl font-bold shadow-lg backdrop-blur-sm` }
167196 >
168197 { value }
169198 </ motion . div >
0 commit comments