Word Pad
Word Pad
body {
font-family: Arial, sans-serif;
background-color: #f9f9f9;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
background-color: #ffffff;
}
h1 {
text-align: center;
color: #4CAF50;
}
.toolbar {
display: flex;
justify-content: center;
margin-bottom: 10px;
}
.toolbar button {
padding: 5px 10px;
margin: 0 5px;
border: none;
cursor: pointer;
background-color: #f2f2f2;
border-radius: 4px;
}
.editor {
border: 1px solid #ccc;
padding: 10px;
min-height: 300px;
}
.download-button {
display: block;
margin: 20px auto;
padding: 10px 20px;
border: none;
cursor: pointer;
background-color: #4CAF50;
color: #ffffff;
border-radius: 4px;
}
.download-button:hover {
background-color: #45a049;
}
function formatText(command) {
document.execCommand(command, false, null);
}
function downloadFile() {
const editorContent = document.getElementById('editor').innerText;
const fileName = 'word_pad_document.txt';
const blob = new Blob([editorContent], { type: 'text/plain' });
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = fileName;
link.click();
}
0 Comments