|
42 | 42 | }); |
43 | 43 | </script> |
44 | 44 | <script> |
45 | | - window.addEventListener("message", (event) => { |
46 | | - if (event.data.type === "resize" && event.data.height) { |
47 | | - const iframe = document.getElementById("chat-iframe"); |
48 | | - iframe.style.height = event.data.height + "px"; |
| 45 | + function toggleChatbox() { |
| 46 | + const box = document.getElementById("chatbox"); |
| 47 | + box.style.display = box.style.display === "none" ? "flex" : "none"; |
49 | 48 | } |
50 | | - }); |
51 | | -</script> |
52 | | - <script> |
53 | | - function toggleChatbox() { |
54 | | - const box = document.getElementById("chatbox"); |
55 | | - box.style.display = box.style.display === "none" ? "flex" : "none"; |
56 | | - } |
57 | | -</script> |
| 49 | + </script> |
58 | 50 |
|
59 | 51 | <style> |
60 | 52 | link[rel="icon"] { |
|
112 | 104 | display: inline-block; |
113 | 105 | } |
114 | 106 | #chat-launcher { |
115 | | - position: fixed; |
116 | | - bottom: 20px; |
117 | | - right: 20px; |
118 | | - background: #001f3f; /* dark navy */ |
119 | | - color: white; |
120 | | - padding: 12px 16px; |
121 | | - border-radius: 30px; |
122 | | - cursor: pointer; |
123 | | - z-index: 1000; |
124 | | - font-family: sans-serif; |
125 | | - box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4); /* soft blue glow */ |
126 | | - transition: background 0.3s; |
127 | | -} |
128 | | - |
129 | | -#chat-launcher:hover { |
130 | | - background: #003366; |
131 | | -} |
132 | | - |
133 | | -#chatbox { |
134 | | - position: fixed; |
135 | | - bottom: 80px; |
136 | | - right: 20px; |
137 | | - width: 360px; |
138 | | - height: 500px; |
139 | | - border: none; |
140 | | - background: white; |
141 | | - display: none; |
142 | | - flex-direction: column; |
143 | | - z-index: 1001; |
144 | | - box-shadow: 0 8px 20px rgba(0,0,0,0.25); |
145 | | - border-radius: 12px; |
146 | | - overflow: hidden; |
147 | | -} |
148 | | - |
149 | | -#chatbox-header { |
150 | | - background: #001f3f; |
151 | | - color: white; |
152 | | - padding: 10px 15px; |
153 | | - font-weight: bold; |
154 | | - display: flex; |
155 | | - justify-content: space-between; |
156 | | - align-items: center; |
157 | | - font-family: sans-serif; |
158 | | -} |
159 | | -#chat-launcher:hover { |
160 | | - background: #003366; |
161 | | - box-shadow: 0 0 12px rgba(0, 102, 255, 0.6); |
162 | | -} |
| 107 | + position: fixed; |
| 108 | + bottom: 20px; |
| 109 | + right: 20px; |
| 110 | + background: #001f3f; |
| 111 | + color: white; |
| 112 | + padding: 12px 16px; |
| 113 | + border-radius: 30px; |
| 114 | + cursor: pointer; |
| 115 | + z-index: 1000; |
| 116 | + font-family: sans-serif; |
| 117 | + box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4); |
| 118 | + transition: background 0.3s; |
| 119 | + } |
| 120 | + #chat-launcher:hover { |
| 121 | + background: #003366; |
| 122 | + } |
163 | 123 | #chatbox { |
164 | | - transition: transform 0.3s ease, opacity 0.3s ease; |
165 | | -} |
166 | | -#chatbox iframe { |
167 | | - height: calc(100% - 48px); |
168 | | -} |
169 | | - |
| 124 | + position: fixed; |
| 125 | + bottom: 80px; |
| 126 | + right: 20px; |
| 127 | + width: 360px; |
| 128 | + height: 500px; |
| 129 | + display: none; |
| 130 | + flex-direction: column; |
| 131 | + background: white; |
| 132 | + border-radius: 12px; |
| 133 | + box-shadow: 0 8px 20px rgba(0,0,0,0.25); |
| 134 | + overflow: hidden; |
| 135 | + z-index: 1001; |
| 136 | + } |
| 137 | + #chatbox-header { |
| 138 | + background: #001f3f; |
| 139 | + color: white; |
| 140 | + padding: 10px 15px; |
| 141 | + font-weight: bold; |
| 142 | + display: flex; |
| 143 | + justify-content: space-between; |
| 144 | + align-items: center; |
| 145 | + font-family: sans-serif; |
| 146 | + } |
| 147 | + #chatbox iframe { |
| 148 | + height: calc(100% - 48px); |
| 149 | + width: 100%; |
| 150 | + border: none; |
| 151 | + } |
170 | 152 |
|
171 | 153 | </style> |
172 | 154 | </head> |
@@ -229,22 +211,14 @@ <h1>Hariprashad Ravikumar</h1> |
229 | 211 |
|
230 | 212 | </main> |
231 | 213 |
|
232 | | -<!-- Floating Chat Button --> |
233 | 214 | <div id="chat-launcher" onclick="toggleChatbox()">Chat with my AI HariBot</div> |
234 | | - |
235 | | -<!-- Chat iframe box (hidden by default) --> |
236 | | -<div id="chatbox"> |
237 | | - <div id="chatbox-header"> |
238 | | - <span>HariBot AI 🤖</span> |
239 | | - <button onclick="toggleChatbox()">✕</button> |
| 215 | + <div id="chatbox"> |
| 216 | + <div id="chatbox-header"> |
| 217 | + <span>HariBot AI 🤖</span> |
| 218 | + <button onclick="toggleChatbox()">×</button> |
| 219 | + </div> |
| 220 | + <iframe id="chat-iframe" src="https://hari-chatbot.onrender.com" title="HariBot Assistant"></iframe> |
240 | 221 | </div> |
241 | | - <iframe id="chat-iframe" |
242 | | - src="https://hari-chatbot.onrender.com" |
243 | | - frameborder="0" |
244 | | - title="HariBot Assistant" |
245 | | - style="width: 100%; border: none;"></iframe> |
246 | | - |
247 | | -</div> |
248 | 222 |
|
249 | 223 | <footer> |
250 | 224 | <p>© 2025 Hariprashad Ravikumar. All rights reserved.</p> |
|
0 commit comments