@@ -83,6 +83,14 @@ export default function Textform(props) {
8383 const color = [ 'red' , 'blue' , 'yellow' , 'orange' , 'green' , 'black' , 'pink' , 'salmon' , 'teal' , 'gold' , 'greenyellow' ] ;
8484 document . getElementById ( 'Messagearea' ) . style . color = color [ number ] ;
8585 }
86+
87+ //Change font size
88+ const changFontSize = ( number ) => {
89+ const fontsize = [ 100 , 200 , 300 , 400 , 500 , 600 , 700 , 800 , 900 ] ;
90+ document . getElementById ( "Messagearea" ) . style . fontWeight = fontsize [ number ]
91+
92+ }
93+
8694 //
8795 const handleOnChangeData = ( event ) => {
8896 setText ( event . target . value )
@@ -91,7 +99,7 @@ export default function Textform(props) {
9199 < >
92100 < div className = 'contaner' >
93101 < div className = "form-group text-light" >
94- < label htmlFor = "exampleFormControlTextarea1" > < h4 > { props . heading } </ h4 > </ label >
102+ < label htmlFor = "exampleFormControlTextarea1" className = 'mt-5 mb-2' > < h2 > { props . heading } </ h2 > </ label >
95103 < textarea className = "form-control" id = "Messagearea" value = { text } onChange = { handleOnChangeData } rows = "12" > </ textarea >
96104 </ div >
97105
@@ -105,16 +113,18 @@ export default function Textform(props) {
105113 < button className = "btn btn-primary btn-block my-4 text-uppercase mx-3" onClick = { handleTitleCasingEvent } > TitleCase</ button >
106114 < button className = "btn btn-primary btn-block my-4 text-uppercase mx-3" onClick = { handleReverseCasingEvent } > Reversecase</ button >
107115 < button className = "btn btn-primary btn-block my-4 text-uppercase mx-3" onClick = { handleCopyEvent } > Click to Copy</ button >
108- < button className = "btn btn-primary mx-1" type = "button" onClick = { ( ) => changeColor ( Math . floor ( Math . random ( ) * 5 ) ) } > Change Color</ button >
116+ < button className = "btn btn-primary mx-3 my-4" onClick = { ( ) => changeColor ( Math . floor ( Math . random ( ) * 5 ) ) } > Change Color</ button >
117+ < button className = "btn btn-primary mx-1" onClick = { ( ) => changFontSize ( Math . floor ( Math . random ( ) * 9 ) ) } > Change Font size</ button >
118+
109119
110120 </ div >
111121
112122 < div className = "container text-light my-3" >
113123 < h1 className = 'text-danger' > Your Text Summery </ h1 >
114124 < p >
115- { text . split ( " " ) . length } Words and { text . length } Characters < br />
125+ < span className = 'text-danger' > { text . split ( " " ) . length } </ span > Words and < span className = 'text-danger' > { text . length } </ span > Characters < br />
116126 < span className = 'text-danger' > { 0.008 * text . split ( " " ) . length } </ span > Minutes Time to Read this by Words < br />
117- < span className = 'text-danger' > { 0.002 * text . length } Minutes time to read by characters. </ span >
127+ < span className = 'text-danger' > { 0.002 * text . length } </ span > Minutes time to read by characters.
118128 </ p >
119129 < h2 > Preview</ h2 >
120130 < p >
0 commit comments