Example output
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Writing Assistant</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f9;
color: #333;
}
.container {
width: 80%;
margin: 0 auto;
padding: 20px;
}
h1 {
text-align: center;
color: #4a90e2;
}
.text-input, .suggestions {
width: 100%;
margin: 20px 0;
}
.text-input textarea, .suggestions textarea {
width: 100%;
height: 150px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
box-sizing: border-box;
}
.button-container {
text-align: center;
}
.button-container button {
padding: 10px 20px;
font-size: 16px;
color: #fff;
background-color: #4a90e2;
border: none;
border-radius: 5px;
cursor: pointer;
}
.button-container button:hover {
background-color: #357abd;
}
.suggestion-list {
margin: 20px 0;
}
.suggestion {
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
margin-bottom: 10px;
background-color: #fff;
}
</style>
</head>
<body>
<div class="container">
<h1>AI Writing Assistant</h1>
<div class="text-input">
<h2>Input Text</h2>
<textarea id="inputText" placeholder="Type or paste your text here..."></textarea>
</div>
<div class="button-container">
<button onclick="generateSuggestions()">Get Suggestions</button>
</div>
<div class="suggestions">
<h2>Suggestions</h2>
<textarea id="suggestedText" placeholder="Your improved text will appear here..." readonly></textarea>
<div class="suggestion-list" id="suggestionList"></div>
</div>
</div>
<script>
// Function to simulate AI suggestions - to be replaced with actual AI implementation
function generateSuggestions() {
const inputText = document.getElementById('inputText').value;
const suggestedText = document.getElementById('suggestedText');
const suggestionList = document.getElementById('suggestionList');
// Clear previous suggestions
suggestionList.innerHTML = '';
if (inputText.trim() === '') {
suggestedText.value = '';
return;
}
// Placeholder for AI-generated text (replace with real AI output)
const enhancedText = inputText; // Here, you would call your AI model to get the enhanced text
suggestedText.value = enhancedText;
// Placeholder for suggestions (replace with real AI suggestions)
const suggestions = [
'Suggestion 1: Consider using a more formal tone.',
'Suggestion 2: Add more details to improve clarity.',
'Suggestion 3: Use shorter sentences for better readability.'
];
suggestions.forEach((suggestion) => {
const div = document.createElement('div');
div.className = 'suggestion';
div.textContent = suggestion;
suggestionList.appendChild(div);
});
}
</script>
</body>
</html>