-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
76 lines (74 loc) · 2.7 KB
/
index.html
File metadata and controls
76 lines (74 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>정보 입력</title>
<style>
body, html {
margin: 0;
padding: 0;
background: url('./image/first.png') no-repeat center top;
background-size: 100vw; /* 배경 이미지가 컨테이너를 꽉 채우도록 설정 */
height: 150vw; /* 배경 이미지의 높이에 맞춤 */
width: 100vw; /* 배경 이미지의 너비에 맞춤 */
min-height: 100%;
overflow: auto;
}
.form-container {
display: flex;
justify-content: center;
align-items: center;
height: 90vw; /* 뷰포트 높이의 100% */
width: 88vw;
}
#userInfoForm {
display: flex;
/* 폼 내 요소들을 수평으로 배치 */
}
.input-field {
margin: 0 9vw; /* 좌우 마진으로 입력 필드 간 간격 조정 */
}
.input-field input {
width: 7vw; /* 입력 필드의 너비를 150px로 설정 */
padding: 5px; /* 내부 여백을 5px로 설정 */
font-size: 14px; /* 글자 크기를 14px로 설정 */
border: none; /* 테두리 제거 */
background: transparent; /* 배경 투명 */
}
#userInfoForm button {
margin-top: 4vw; /* 버튼의 상단 마진을 20px로 설정 */
font-size: 25px; /* 버튼 내 텍스트의 크기를 더 크게 설정합니다. */
color: blue;
background-color: white;
border-color: white;
}
</style>
</head>
<body>
<div class="form-container">
<form id="userInfoForm">
<div class="input-field">
<label for="name"></label>
<input type="text" id="name" name="name" required>
</div>
<div class="input-field">
<label for="studentId"></label>
<input type="text" id="studentId" name="studentId" required>
</div>
<button type="submit">다음</button>
</form>
</div>
<script>
document.getElementById('userInfoForm').onsubmit = function(event) {
event.preventDefault(); // 폼 기본 제출 동작을 방지
const name = document.getElementById('name').value;
const studentId = document.getElementById('studentId').value;
// 입력받은 정보를 로컬 스토리지에 저장
localStorage.setItem('name', name);
localStorage.setItem('studentId', studentId);
// 다음 페이지로 이동
window.location.href = 'mainPage.html';
}
</script>
</body>
</html>