<section class="live-chat my-3"> <div class="chat-container"> <div class="chat-header"> Chat with Plant Specialist </div> <div class="chat-box" id="chat-box"> <div class="bot-message">Hi! I'm your Plant Specialist. How can I help you today?</div> </div> <div class="chat-input"> <input type="text" id="user-input" placeholder="Ask me about your plant..." /> <button onclick="sendMessage()">Send</button> </div> </div> </section>
function generateBotReply(msg) { msg = msg.toLowerCase(); if (msg.includes("water")) return "Most plants need watering once a week. Check if the topsoil is dry!"; if (msg.includes("sunlight")) return "Place your plant near a window with indirect sunlight."; if (msg.includes("brown leaves")) return "Brown leaves can be due to overwatering or low humidity."; if (msg.includes("fertilizer")) return "Use a balanced fertilizer once a month during the growing season."; if (msg.includes("repot")) return "Repot when roots grow out of the drainage holes or every 1-2 years."; if (msg.includes("hello")) return "hello when roots grow out of the drainage holes or every 1-2 years."; return "That's interesting! Could you please give me more details about your plant issue?"; }