Skip to content

Commit 77282ae

Browse files
committed
Starter code for forms demo in HTML
1 parent 81a8433 commit 77282ae

File tree

6 files changed

+129
-0
lines changed

6 files changed

+129
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,4 @@ days/050-responder/.idea/encodings.xml
167167
days/097-100-docker/.idea/encodings.xml
168168
days/097-100-docker/.idea/webResources.xml
169169
yahoo_clone.iml
170+
signup.iml

days/005-008-html5/demos/signup/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
form input, form select {
3+
4+
display: block;
5+
width: 100%;
6+
height: calc(1.5em + .75rem + 2px);
7+
padding: .375rem .75rem;
8+
font-size: 1rem;
9+
font-weight: 400;
10+
line-height: 1.5;
11+
color: #495057;
12+
background-color: #fff;
13+
background-clip: padding-box;
14+
border: 1px solid #ced4da;
15+
border-radius: .25rem;
16+
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
17+
18+
}
19+
20+
form input::placeholder {
21+
color: #6c757d;
22+
opacity: 1;
23+
}
24+
25+
button {
26+
display: inline-block;
27+
font-weight: 400;
28+
color: #212529;
29+
text-align: center;
30+
vertical-align: middle;
31+
-webkit-user-select: none;
32+
-moz-user-select: none;
33+
-ms-user-select: none;
34+
user-select: none;
35+
background-color: transparent;
36+
border: 1px solid transparent;
37+
border-top-color: transparent;
38+
border-right-color: transparent;
39+
border-bottom-color: transparent;
40+
border-left-color: transparent;
41+
padding: .375rem .75rem;
42+
font-size: 1rem;
43+
line-height: 1.5;
44+
border-radius: .25rem;
45+
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
46+
}
47+
48+
49+
button {
50+
51+
color: #fff;
52+
background-color: #28a745;
53+
border-color: #28a745;
54+
55+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
$(document).ready(function () {
2+
3+
$("form").submit(function (e) {
4+
e.preventDefault()
5+
6+
const $inputs = $('form :input');
7+
8+
let values = {}
9+
$inputs.each(function () {
10+
if (this.name) {
11+
values[this.name] = $(this).val();
12+
}
13+
})
14+
15+
alert(JSON.stringify(values, null, 2))
16+
17+
return false
18+
})
19+
})
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
form {
3+
margin-left: auto;
4+
margin-right: auto;
5+
max-width: 350px;
6+
background-color: white;
7+
padding: 20px;
8+
padding-right: 30px;
9+
border-radius: 10px;
10+
}
11+
12+
form > * {
13+
margin: 10px;
14+
}
15+
16+
form > div {
17+
text-align: right;
18+
margin-right: -10px;
19+
}
20+
21+
body {
22+
background-color: #84cbff;
23+
}
24+
25+
h1 {
26+
color: white;
27+
text-align: center;
28+
margin-top: 50px;
29+
margin-bottom: 50px;
30+
font-size: 64px;
31+
font-weight: lighter;
32+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Sign up for FoxRem</title>
6+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
7+
<link rel="stylesheet" href="extras/form.css">
8+
<link rel="stylesheet" href="extras/site.css">
9+
10+
</head>
11+
<body>
12+
13+
<!-- sign up form here ... -->
14+
15+
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
16+
<script src="extras/form_hook.js"></script>
17+
</body>
18+
</html>

0 commit comments

Comments
 (0)