-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu1.html
More file actions
221 lines (195 loc) · 5.96 KB
/
menu1.html
File metadata and controls
221 lines (195 loc) · 5.96 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<html lang="th">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>กรอกข้อมูล</title>
<style>
/* Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f6;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 20px;
padding: 30px 0;
}
.form-container {
background-color: white;
padding: 30px;
border-radius: 15px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
text-align: center;
}
h2 {
color: #333;
margin-bottom: 20px;
}
label {
display: block;
text-align: left;
margin-bottom: 6px;
font-weight: bold;
}
input[type="text"],
input[type="email"],
input[type="tel"] {
width: 100%;
padding: 10px 12px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 16px;
}
button.submit-btn {
background-color: #007bff;
color: white;
padding: 12px 20px;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
transition: all 0.3s ease;
width: 100%;
}
button.submit-btn:hover {
background-color: #0056b3;
}
/* กล่องแสดงผลข้อมูล */
.result-display {
margin-top: 30px;
background-color: #e9f7ef;
padding: 20px;
border-left: 4px solid #007bff;
border-radius: 10px;
text-align: left;
display: none;
}
.result-display h3 {
margin-top: 0;
color: #0056b3;
}
.result-display p {
margin: 5px 0;
color: #333;
}
/* Container สำหรับปุ่มแนวนอน */
.button-container {
display: flex;
gap: 15px;
justify-content: center;
align-items: center;
width: 100%;
max-width: 600px;
margin-top: auto;
padding: 20px;
box-sizing: border-box;
}
.btn {
background-color: white;
color: #333;
padding: 16px 24px;
border-radius: 12px;
font-size: 18px;
font-weight: bold;
text-decoration: none;
text-align: center;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
flex: 1;
min-width: 120px;
cursor: pointer;
display: inline-flex;
justify-content: center;
align-items: center;
}
.btn:hover {
transform: scale(1.05);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.btn:active {
transform: scale(0.98);
}
.btn.home {
background-color: #e74c3c;
color: white;
}
.btn.ai {
background-color: #2ecc71;
color: white;
}
.btn.plant {
background-color: #007bff;
color: white;
}
.btn.menu {
background-color: #ff9900;
color: white;
}
</style>
</head>
<body>
<!-- ฟอร์มกรอกข้อมูล -->
<div class="form-container">
<h2>กรอกข้อมูลของคุณ</h2>
<form id="dataForm">
<label for="name">ชื่อ:</label>
<input type="text" id="name" name="name" placeholder="กรุณากรอกชื่อ">
<label for="email">อีเมล:</label>
<input type="email" id="email" name="email" placeholder="กรุณากรอกอีเมล">
<label for="phone">เบอร์โทรศัพท์:</label>
<input type="tel" id="phone" name="phone" placeholder="กรุณากรอกเบอร์โทร">
<button type="submit" class="submit-btn">ส่งข้อมูล</button>
</form>
<!-- แสดงผลลัพธ์ -->
<div id="output" class="result-display">
<h3>ข้อมูลที่คุณกรอก:</h3>
<p><strong>ชื่อ:</strong> <span id="outputName">-</span></p>
<p><strong>อีเมล:</strong> <span id="outputEmail">-</span></p>
<p><strong>เบอร์โทรศัพท์:</strong> <span id="outputPhone">-</span></p>
</div>
</div>
<!-- ปุ่มด้านล่าง -->
<div class="button-container">
<a href="Home999.html" class="btn home">HOME</a>
<a href="Home.html" class="btn ai">AI</a>
<a href="Home555.html" class="btn plant">วิธีปลูก</a>
<a href="#" class="btn menu">MENU</a>
</div>
<script>
const form = document.getElementById('dataForm');
const output = document.getElementById('output');
const outputName = document.getElementById('outputName');
const outputEmail = document.getElementById('outputEmail');
const outputPhone = document.getElementById('outputPhone');
// ฟังก์ชันแสดงผลข้อมูล
function showResult() {
const name = document.getElementById('name').value.trim();
const email = document.getElementById('email').value.trim();
const phone = document.getElementById('phone').value.trim();
outputName.textContent = name || '-';
outputEmail.textContent = email || '-';
outputPhone.textContent = phone || '-';
// ซ่อนฟอร์ม
form.style.display = 'none';
// แสดงผลลัพธ์
output.style.display = 'block';
}
// เมื่อกดส่งข้อมูล
form.addEventListener('submit', function(event) {
event.preventDefault(); // ปิดการโหลดใหม่
showResult();
});
</script>
</body>
</html>