-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHome2.html
More file actions
172 lines (151 loc) · 5.06 KB
/
Home2.html
File metadata and controls
172 lines (151 loc) · 5.06 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
<!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: space-between;
gap: 20px;
padding: 30px 0;
}
.vertical-buttons,
.horizontal-buttons {
display: flex;
flex-direction: column;
gap: 60px;
align-items: center;
}
.btn {
width: 180px;
padding: 14px 20px;
font-size: 16px;
font-weight: bold;
color: white;
text-align: center;
border-radius: 12px;
border: none;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.btn:hover {
transform: scale(1.05);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.btn:active {
transform: scale(0.98);
}
.btn.durian { background-color: #FFA500; }
.btn.mangosteen { background-color: #800080; }
.btn.tetedd2 { background-color: #008000; }
.btn.home { background-color: #e74c3c; }
.btn.ai { background-color: #2ecc71; }
.btn.plant { background-color: #007bff; }
.btn.menu { background-color: #ff9900; }
/* กล่องแสดงรูปภาพ */
.image-container {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1000;
text-align: center;
}
.image-container img {
max-width: 80vw;
max-height: 80vh;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.hidden {
display: none !important;
}
/* พื้นหลังเมื่อแสดงรูป */
.overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.6);
z-index: 999;
display: none;
}
.close-button {
position: absolute;
top: 10px;
right: 10px;
background-color: transparent;
border: none;
font-size: 24px;
color: white;
cursor: pointer;
z-index: 1001;
}
</style>
</head>
<body>
<!-- กล่องปุ่มแนวตั้ง -->
<div class="vertical-buttons" id="verticalButtons">
<a href="#" class="btn durian" onclick="showImage('16.png')">เงาะ</a>
<a href="#" class="btn mangosteen" onclick="showImage('17.png')">ทุเรียน</a>
<a href="#" class="btn tetedd2" onclick="showImage('18.png')">มังคุด</a>
</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="menu.html" class="btn menu">MENU</a>
</div>
<!-- Overlay และรูปภาพ -->
<div class="overlay" id="overlay" onclick="hideImage()"></div>
<div class="image-container hidden" id="imageContainer">
<img src="" alt="Plant Image" id="plantImage">
<button class="close-button" onclick="hideImage()">❌</button>
</div>
<script>
// ฟังก์ชันแสดงรูปภาพ และซ่อนปุ่ม
function showImage(imageUrl) {
const imageContainer = document.getElementById('imageContainer');
const overlay = document.getElementById('overlay');
const verticalButtons = document.getElementById('verticalButtons');
const horizontalButtons = document.querySelector('.horizontal-buttons');
// แสดงรูปภาพ
document.getElementById('plantImage').src = imageUrl;
imageContainer.classList.remove('hidden');
overlay.style.display = 'block';
// ซ่อนปุ่มทั้งหมด
verticalButtons.style.display = 'none';
horizontalButtons.style.display = 'none';
}
// ฟังก์ชันปิดรูปภาพ และแสดงปุ่มใหม่
function hideImage() {
const imageContainer = document.getElementById('imageContainer');
const overlay = document.getElementById('overlay');
const verticalButtons = document.getElementById('verticalButtons');
const horizontalButtons = document.querySelector('.horizontal-buttons');
// ซ่อนรูปภาพ
imageContainer.classList.add('hidden');
overlay.style.display = 'none';
// แสดงปุ่มอีกครั้ง
verticalButtons.style.display = 'flex';
horizontalButtons.style.display = 'flex';
}
</script>
</body>
</html>