Agente de negocios en HTML
- samuel gaitan
- 16 abr
- 1 Min. de lectura
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Agente de IA - Negocios</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
background-color: #e0f7fa; /* azul agua */
}
.container { display: flex; justify-content: space-between; }
.column { width: 48%; }
iframe { width: 100%; height: 300px; border: 1px solid #ccc; }
#historial { max-height: 100px; overflow-y: auto; border: 1px solid #ccc; padding: 5px; }
</style>
</head>
<body>
<h1>Agente de IA sobre Negocios</h1>
<div class="container">
<div class="column">
<h2>Escritos de IA</h2>
<p id="textoIA">Generando contenido...</p>
<button onclick="generarTexto()">Generar Texto</button>
</div>
<div class="column">
<h2>Chatbot</h2>
<textarea id="chat" rows="6" cols="30" readonly></textarea>
<input type="text" id="entrada" placeholder="Escribe aquí...">
<button onclick="enviarMensaje()">Enviar</button>
</div>
</div>
<h2>Buscador</h2>
<input type="text" id="busqueda" placeholder="Buscar negocios...">
<button onclick="buscar()">Buscar</button>
<h3>Historial de Búsqueda</h3>
<div id="historial"></div>
<div class="container">
<div class="column">
<h3>Google Scholar</h3>
<iframe id="scholar"></iframe>
</div>
<div class="column">
<h3>YouTube</h3>
<iframe id="youtube"></iframe>
</div>
</div>
<script>
function generarTexto() {
document.getElementById("textoIA").innerText = "Los negocios de servicios contables y financieros son clave para la economía moderna...";
}
function enviarMensaje() {
let entrada = document.getElementById("entrada").value;
let chat = document.getElementById("chat");
chat.value += "\nUsuario: " + entrada;
chat.value += "\nChatbot: Interesante punto, ¿puedes profundizar?";
document.getElementById("entrada").value = "";
}
function buscar() {
let termino = document.getElementById("busqueda").value;
document.getElementById("scholar").src = "https://scholar.google.com/scholar?q=" + encodeURIComponent(termino);
document.getElementById("youtube").src = "https://www.youtube.com/results?search_query=" + encodeURIComponent(termino);
let historial = document.getElementById("historial");
historial.innerHTML += `<p>${termino}</p>`; // <-- Corrección aquí también
}
</script>
</body>
</html>




Comentarios