Skip to content

Commit 4cf4b5b

Browse files
committed
Added form layout
1 parent 70c7442 commit 4cf4b5b

File tree

3 files changed

+89
-17
lines changed

3 files changed

+89
-17
lines changed

src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function Handwrite() {
7979
<img src={logo} alt="handwrite logo" className="Handwrite-Logo" />
8080
<Navbar />
8181
<Home />
82-
<br/>
82+
<br/><br/>
8383
<About />
8484
<hr className="divider"/>
8585
<br />

src/Home.js

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { CloudUploadOutlined } from '@material-ui/icons';
55
import Grid from '@material-ui/core/Grid';
66
import { Button } from '@material-ui/core';
77
import IconButton from '@material-ui/core/IconButton';
8+
import Switch from '@material-ui/core/Switch';
89
import { HighlightOffOutlined } from '@material-ui/icons';
910

1011
function Home(props) {
@@ -149,13 +150,13 @@ function Home(props) {
149150
<div className="spinner"></div>
150151
</div>
151152
<div className="loader" style={{ display: currentState === 6 ? "" : "none" }}>
152-
<font color = "red"> {error.current} </font>
153+
<font color="red"> {error.current} </font>
153154
</div>
154155
<div className="grid">
155156
<form onSubmit={(e) => sendImage(e)}>
156157
<Grid container direction="row" justify="space-around" alignItems="center">
157158
<div><br />
158-
<div {...getRootProps({className: 'dropzone'})} className="image-container"> <input {...getInputProps()} />
159+
<div {...getRootProps({ className: 'dropzone' })} className="image-container"> <input {...getInputProps()} />
159160
{image[0] ?
160161
<div className="input-image">
161162
<img src={image[0]} alt="Selected Form" />
@@ -174,20 +175,38 @@ function Home(props) {
174175
<HighlightOffOutlined />
175176
</IconButton></h6></center> : ""}
176177
</div>
177-
<div className="submit-button">
178-
<Button variant="outlined" href="https://github.com/cod-ed/handwrite/raw/dev/handwrite_sample.pdf">Download Sample Form</Button><br /><br />
179-
<Button type="submit" variant="outlined" disabled={loading() || currentState === 0}>
180-
CREATE FONT
181-
</Button>
182-
<br /><br />
183-
<div className="form-check">
184-
<input className="form-check-input" type="checkbox" id="researchOption" defaultChecked></input>
185-
<label className="form-check-label" htmlFor="flexCheckChecked">
186-
Opt-in for research use.
187-
</label>
188-
</div>
189-
<br /><br />
190-
<Button variant="outlined" href={font} download="font.ttf" style={{ display: Boolean(font) ? "" : "none" }}>Download your font</Button>
178+
<div className="settings-wrap">
179+
<h2>Font Settings</h2>
180+
<form>
181+
<div className="input-wrap">
182+
<label className="form-label" for="file-name">File name</label>
183+
<input className="form-input" type="text" id="file-name" placeholder="" autoComplete='off' />
184+
</div>
185+
<div className="input-wrap">
186+
<label className="form-label" for="font-family">Font family</label>
187+
<input className="form-input" type="text" id="font-family" autoComplete='off' />
188+
</div>
189+
<div className="input-wrap">
190+
<label className="form-label" for="font-style">Font style</label>
191+
<input className="form-input" type="text" id="font-style" autoComplete='off' />
192+
</div>
193+
<br />
194+
<div className="form-check">
195+
<input className="form-check-input" type="checkbox" id="researchOption" defaultChecked></input>
196+
<label className="form-check-label" htmlFor="flexCheckChecked">
197+
Opt-in for research use.
198+
</label>
199+
</div>
200+
<br /><br />
201+
<div className="submit-button">
202+
<Button variant="outlined" href="https://github.com/cod-ed/handwrite/raw/dev/handwrite_sample.pdf">Download Sample Form</Button><br /><br />
203+
<Button type="submit" variant="outlined" disabled={loading() || currentState === 0}>
204+
CREATE FONT
205+
</Button>
206+
<br /><br />
207+
<Button variant="outlined" href={font} download="font.ttf" style={{ display: Boolean(font) ? "" : "none" }}>Download your font</Button>
208+
</div>
209+
</form>
191210
</div>
192211
</Grid>
193212
</form>

src/index.css

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,59 @@ code {
159159
border-color: hsl(0, 0%, 21%);
160160
}
161161

162+
.settings-wrap{
163+
margin: 20px;
164+
background-color: #fff;
165+
width: 400px;
166+
border-radius: 5px;
167+
/* box-shadow: 0 10px 10px -5px rgba(0, 0, 0, 0.2); */
168+
}
169+
170+
.settings-wrap h2{
171+
margin-top: 10px;
172+
text-transform: uppercase;
173+
text-align: center;
174+
font-weight: 500;
175+
color: black;
176+
margin-bottom: 32px;
177+
}
178+
179+
.input-wrap{
180+
display: flex;
181+
flex-direction: column;
182+
margin: 15px 0;
183+
}
184+
185+
.form-label{
186+
font-size: 20px;
187+
margin-bottom: 3px;
188+
}
189+
190+
.form-input{
191+
border: none;
192+
background-color: #f3f9fa;;
193+
border-radius: 5px;
194+
padding: 12px;
195+
font-family: inherit;
196+
color: inherit;
197+
outline: none;
198+
border: 1px solid rgba(0, 0, 0, 0);
199+
box-shadow: 0 0 5px rgba(0, 0, 0, 0);
200+
transition: 250ms all ease-in;
201+
}
202+
203+
.form-input:hover {
204+
border: 1px solid rgba(203, 235, 242, 0.987);
205+
box-shadow: 0 0 5px rgba(203, 235, 242, 0.987);
206+
background: white;
207+
}
208+
209+
.form-input:focus {
210+
border: 1px solid rgba(173, 217, 226, 0.987);
211+
box-shadow: 0 0 5px rgba(97, 212, 238, 0.987);
212+
background: white;
213+
}
214+
162215
.divider {
163216
color: rgb(61, 61, 61);
164217
background-color: rgb(61, 61, 61);

0 commit comments

Comments
 (0)