gpui-component/crates/webview/tests/input.html
Sunli b70b229370
wef: Added a new WebView component named "Wef" based on CEF. (#877)
Wef is a Rust library for embedding WebView functionality using Chromium
Embedded Framework (CEF3) with offscreen rendering support.
2025-06-17 18:57:44 +08:00

83 lines
2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Text Input</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #333;
}
label {
display: block;
margin-top: 10px;
font-weight: bold;
}
input[type="text"],
textarea {
width: 100%;
padding: 10px;
margin-top: 5px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
}
textarea {
resize: vertical;
}
button {
margin-top: 10px;
background-color: #007bff;
color: white;
border: none;
padding: 10px 15px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<h1>Text Input</h1>
<form id="textInputForm">
<label for="singleLineInput">Single Line Text:</label>
<input
type="text"
id="singleLineInput"
placeholder="Enter single line text here"
/>
<label for="multiLineInput">Multi-line Text:</label>
<textarea
id="multiLineInput"
rows="5"
placeholder="Enter multi-line text here"
></textarea>
<button type="button" onclick="submitText()">Submit</button>
</form>
<p id="output"></p>
<script>
function submitText() {
const singleLineInput =
document.getElementById("singleLineInput").value;
const multiLineInput = document.getElementById("multiLineInput").value;
const output = document.getElementById("output");
output.innerHTML = `
<strong>Single Line Text:</strong> ${singleLineInput}<br>
<strong>Multi-line Text:</strong><br>${multiLineInput.replace(
/\n/g,
"<br>"
)}
`;
}
</script>
</body>
</html>