-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommunity.html
More file actions
334 lines (282 loc) · 10.3 KB
/
community.html
File metadata and controls
334 lines (282 loc) · 10.3 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="navbar">
<div class="logo">
<img src="logo.jpg">
<h5>SURAKSHA</h5>
</div>
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="community.html" class="active">community</a></li>
<li><a href="finance.html">finance</a></li>
<li><a href="alert.html">suraksha</a></li>
<li><a href="House.html">House</a></li>
</ul>
</div>
<header>
<h1>Community Events And Expert's Corner</h1>
</header>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #081b29;
}
header {
background-color: #081b29;;
color: white;
text-align: center;
padding: 20px 0;
position: relative;
}
/* Chatbox styling */
#chatBox {
display: none;
position: fixed;
top: 220px;
right: 10px;
width: 300px;
height: 410px;
background-color: white;
border: 2px solid #28a745;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
z-index: 9999;
}
#chatBox input[type="text"] {
margin-left:30px;
margin-top:10px;
}
#chatBoxHeader {
background-color: #28a745;
color: white;
padding: 10px;
text-align: center;
border-bottom: 2px solid #28a745;
}
#chatMessages {
padding: 10px;
overflow-y: auto;
height: 300px;
}
#chatInputContainer {
padding: 10px;
border-top: 1px solid #ddd;
}
#chatInput {
width: 80%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
#sendButton {
padding: 10px;
background-color: #28a745;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
/* Orange Button for Chat */
#chatButton {
background: black;
color: white;
padding: 10px 15px;
border: none;
border-radius: 5px;
cursor: pointer;
position: relative;
top: 20px;
left: 20px;
z-index: 1000;
}
#chatButton:hover {
background-color: black;
}
.container {
max-width: 1200px;
margin: 20px auto;
padding: 20px;
background-color: white;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.event, .opinion {
border: 1px solid #ddd;
border-radius: 5px;
padding: 15px;
margin: 10px 0;
background-color: #f9f9f9;
cursor: pointer;
}
.event h3, .opinion h3 {
margin: 0 0 10px;
color: #333;
}
.event p, .opinion p {
margin: 5px 0;
color: #555;
}
.button {
background-color: #28a745;
color: white;
padding: 10px 15px;
border: none;
border-radius: 5px;
cursor: pointer;
margin: 10px 0;
}
#chatButton{
width:200px;
height:50px;
margin-bottom:30px;
text-align:center;
}
.button:hover {
background-color: #218838;
}
</style>
</head>
<body>
<!-- Chatbox HTML -->
<div id="chatBox">
<div id="chatBoxHeader">Chat</div>
<div id="chatMessages"></div>
<div id="chatInputContainer">
<input type="text" id="chatInput" placeholder="Type a message..." />
<button id="sendButton" onclick="sendMessage()">Send</button>
</div>
</div>
<!-- Orange Chat Button on Top Left -->
<button id="chatButton" onclick="toggleChat()">Chat with Someone</button>
<div class="container" id="eventContainer"></div>
<!-- Experts' Corner Section -->
<div class="container" id="expertsCorner">
<h2>Experts' Corner</h2>
<div class="opinion">
<h3>Dr. Emily Green</h3>
<p>“Climate change is accelerating, and the impacts on agriculture and health cannot be underestimated.”</p>
</div>
<div class="opinion">
<h3>Dr. Alan Moore</h3>
<p>“Sustainable farming practices are critical to ensuring food security for future generations.”</p>
</div>
<div class="opinion">
<h3>Prof. Michael Lee</h3>
<p>“We must prepare for the consequences of extreme weather patterns affecting our ecosystems.”</p>
</div>
</div>
<script>
// Event data
const events = [
{
title: "How to use the App?",
place: "Community Center, Main Hall",
time: "October 15, 2024, 10:00 AM - 4:00 PM",
speaker: "Dr. Jane Smith, Health Expert",
description: "Learn how to navigate the app effectively.",
},
{
title: "Town Hall Meeting",
place: "Town Hall, Conference Room A",
time: "October 20, 2024, 6:00 PM - 8:00 PM",
speaker: "Mayor John Doe",
description: "Discuss community issues with local government.",
},
{
title: "Environmental Awareness Workshop",
place: "Green Park, Community Pavilion",
time: "October 25, 2024, 2:00 PM - 5:00 PM",
speaker: "Mr. Robert Green, Environmental Activist",
description: "Workshops on sustainable practices.",
},
{
title: "Community Health Fair",
place: "Online (Zoom)",
time: "October 30, 2024, 3:00 PM - 4:00 PM",
speaker: "Tech Support Team",
description: "Get health tips and resources.",
}
];
// Display events on page load
function displayEvents() {
const container = document.getElementById('eventContainer');
events.forEach((event, index) => {
const eventDiv = document.createElement('div');
eventDiv.className = 'event';
eventDiv.onclick = () => {
displayEventDetails(index);
};
eventDiv.innerHTML = `
<h3>${event.title}</h3>
<p><strong>Place:</strong> ${event.place}</p>
<p><strong>Time:</strong> ${event.time}</p>
<p><strong>Speaker:</strong> ${event.speaker}</p>
`;
container.appendChild(eventDiv);
});
}
// Display individual event details
function displayEventDetails(index) {
const event = events[index];
const container = document.body;
container.innerHTML = `
<header>
<h1>${event.title}</h1>
</header>
<div class="container">
<p><strong>Place:</strong> ${event.place}</p>
<p><strong>Time:</strong> ${event.time}</p>
<p><strong>Speaker:</strong> ${event.speaker}</p>
<p><strong>Description:</strong> ${event.description}</p>
<button class="button" onclick="registerForEvent()">Register</button>
<button class="button" onclick="setReminder()">Set Reminder</button>
<button class="button" onclick="goBack()">Back to Events</button>
</div>
`;
}
function registerForEvent() {
alert("You have registered for this event!");
}
function setReminder() {
alert("A reminder has been set for this event!");
}
function goBack() {
location.reload();
}
// Toggle chatbox visibility
function toggleChat() {
const chatBox = document.getElementById('chatBox');
chatBox.style.display = chatBox.style.display === 'none' ? 'block' : 'none';
}
// Simulate a conversation between Person A and Person B
let isPersonA = true;
function sendMessage() {
const chatInput = document.getElementById('chatInput');
const chatMessages = document.getElementById('chatMessages');
if (chatInput.value.trim() === '') return;
// Display message from current person
const message = document.createElement('div');
message.textContent = isPersonA ? `Person A: ${chatInput.value}` : `Person B: ${chatInput.value}`;
chatMessages.appendChild(message);
// Clear input
chatInput.value = '';
// Scroll chat to bottom
chatMessages.scrollTop = chatMessages.scrollHeight;
// Switch between Person A and Person B
isPersonA = !isPersonA;
}
// Initialize the page
window.onload = () => {
displayEvents();
};
</script>
</body>
</html>