-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsignup.html
More file actions
162 lines (141 loc) · 6.88 KB
/
signup.html
File metadata and controls
162 lines (141 loc) · 6.88 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Thailand Flood Safety Map</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Header -->
<header class="bg-white text-dark pt-3">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<!-- Left image -->
<div class="d-none d-md-block">
<img src="download.png" alt="Thailand flah" class="img-fluid" style="max-height: 50px;">
</div>
<!-- Title -->
<h1 class="text-center flex-grow-1">Thailand Flood Safety Map</h1>
<!-- Right image -->
<div class="d-none d-md-block">
<img src="download.png" alt="Thailand flah" class="img-fluid" style="max-height: 50px;">
</div>
</div>
</div>
<nav class="navbar navbar-expand-lg navbar-light bg-light mt-3 custom-navbar">
<div class="container">
<div class="d-flex w-100 justify-content-between">
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav mx-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">7 Day Flood Forecast</a>
</li>
<li class="nav-item">
<a class="nav-link" href="long_term_index.html">Long Term Annual Prediction</a>
</li>
</ul>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
</nav>
</header>
<!-- Main Content -->
<div class="container mt-5">
<h1 class="text-center">Thank You for Signing Up!</h1>
<p class="text-center">We have received your signup request. Please check your email for further instructions.</p>
<!-- Add a link to the home page -->
<div class="text-center">
<a href="index.html" class="btn btn-primary">Return Home</a>
</div>
</div>
<!-- Chatbot Overlay -->
<div class="chatbot-overlay" id="chatbot-overlay">
<div class="modal-header" style="background-color: gray; color: #ffffff;">
<h5 class="modal-title" id="botModalLabel"><span style="font-weight: bold;">SPAB</span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="toggleChatbot()"></button>
</div>
<div class="modal-body">
<div id="chatbox">
<div id="chat-content"></div>
<div id="input-container" class="d-flex mt-3">
<input type="text" id="user-input" class="form-control" placeholder="Type your message...">
<button class="btn btn-danger ml-2" style="height: 40px; background-color: gray; color: #ffffff;" onclick="sendMessage()">Send</button>
</div>
<br>
</div>
</div>
</div>
<button class="chatbot-toggle" onclick="toggleChatbot()">💬</button>
<!-- Footer -->
<footer class="bg-dark text-white py-3 mt-4">
<div class="container text-center">
<p>© 2024 SPAB</p>
</div>
</footer>
<!-- Include Bootstrap JavaScript and dependencies -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<!-- Add JavaScript code to handle the link click -->
<script>
document.querySelector('.btn-primary').addEventListener('click', function() {
window.location.href = 'home.html';
});
</script>d
<script>
async function sendMessage() {
const userInput = document.getElementById('user-input').value;
const chatContent = document.getElementById('chat-content');
// Add user's message to the chat
const userMessageDiv = document.createElement('div');
userMessageDiv.textContent = userInput;
chatContent.appendChild(userMessageDiv);
// Style "You: " part separately
const youSpan = document.createElement('span');
youSpan.textContent = 'You: ';
youSpan.style.fontWeight = 'bold'; // Apply bold font weight
userMessageDiv.insertBefore(youSpan, userMessageDiv.firstChild); // Insert "You: " at the beginning of userMessageDiv
// Send user's message to the server
const response = await fetch('http://127.0.0.1:5000/send_to_bot', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ message: userInput })
});
const responseData = await response.json();
// Add bot's response to the chat
const botMessageDiv = document.createElement('div');
const botResponse = responseData.answer;
// Creating elements and applying styles
const steveSpan = document.createElement('span');
steveSpan.textContent = 'Steve: ';
steveSpan.style.fontWeight = 'bold'; // Make "Steve" bold
const responseSpan = document.createElement('span');
responseSpan.textContent = botResponse;
// Add both spans to the div
botMessageDiv.appendChild(steveSpan);
botMessageDiv.appendChild(responseSpan);
// Add botMessageDiv to chatContent (assuming chatContent is your chat area)
chatContent.appendChild(botMessageDiv);
// Scroll to the bottom of the chat content
chatContent.scrollTop = chatContent.scrollHeight;
// Clear the input field
document.getElementById('user-input').value = '';
}
function toggleChatbot() {
var chatbot = document.getElementById('chatbot-overlay');
if (chatbot.style.display === 'none' || chatbot.style.display === '') {
chatbot.style.display = 'block';
} else {
chatbot.style.display = 'none';
}
}
</script>
</body>
</html>