Hi there, I am seeking assistance with my GUI code. I want the input value to be displayed as text on the screen, or even better, to look like a chatroom so that I can integrate a simple chatbot later on. My main goal is to have the texts show up in the blue section or the "text display" section. If someone could help me with this, I would greatly appreciate it. Thank you.
const { app, BrowserWindow, ipcMain } = require("electron");
let win = null;
const createWindow = () => {
win = new BrowserWindow({
width: 1280,
height: 720,
resizable: false,
webPreferences: {
nodeIntegration: true,
},
});
win.loadFile("index.html");
};
app.whenReady().then(createWindow);
body {
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
height: 100vh;
font-family: Arial, Helvetica, sans-serif;
background-color: white ;
}
input {
margin-bottom: -40px;
width: 738px;
height: 40px;
border: none;
background-color: rgba(0, 0, 0, 0.76);
color: white;
font-size: 18px;
}
button {
width: 155px;
height: 42px;
border: none;
background-color: #000000;
color: white;
font-size: 18px;
cursor: pointer;
}
buttonSettings {
width: 263px;
height: 100px;
background-color: #ff0000;
color:white;
margin: 0 auto;
padding: 20px;
display: inline-block;
line-height: 100px;
text-align: center;
font-size: 26px;
cursor: pointer;
}
textDisplay {
width:930px;
height: 588px;
background-color: steelblue;
color: white;
margin: 0 auto;
padding: 20px;
font-size: 18px;
display: inline-block;
overflow-y: scroll;
}
buttonMicrophone {
width: 200px;
height: 1px;
border: none;
padding: 18px;
background-color: #000000;
color: white;
font-size: 18px;
cursor: pointer;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport", content="width=device-width, initial-scale=1.0">
<title>Ali face</title>
<link rel="stylesheet" href="style.css">
<script defer src="render.js"></script>
</head>
<body>
<div class="form-group" style="float:right; position: absolute;bottom:0; right:0;">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<input type="text" placeholder="say anything" id="myInput">
<buttonMicrophone id="speech" onclick="speechToText()">mic</buttonMicrophone>
<button id="send" onclick="getInputValue();">Send</button>
<script>
function getInputValue(){
//Selecting the input element and get its value
var inputVal = document.getElementById("myInput").value;
// Displaying the value
<h1>(inputVal);</h1>
}
</script>
</div>
</div>
<div class="form-group" style="float:left; position: absolute;top:0; left:0;">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<buttonSettings>Settings</buttonSettings>
</div>
</div>
<div class="from-group" style="float:right; position: absolute;top:0; right:0;">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<textDisplay></textDisplay>
</div>
</div>
</body>
</html>