WordPad
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.wordpad-container {
max-width: 800px;
margin: 50px auto;
background-color: #f9f9f9;
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
padding: 10px;
}
.toolbar {
display: flex;
align-items: center;
gap: 5px;
padding: 5px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.editor {
min-height: 200px;
padding: 10px;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 5px;
margin-top: 10px;
overflow: auto;
}
button {
padding: 5px;
border: none;
background-color: transparent;
cursor: pointer;
font-size: 16px;
}
.download-btn {
display: block;
margin-top: 10px;
padding: 8px 12px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
}
@media screen and (max-width: 480px) {
.wordpad-container {
margin: 20px auto;
}
}
function execCommand(command, value = null) {
document.execCommand(command, false, value);
}
function align(alignType) {
document.execCommand('justify' + alignType);
}
function downloadText() {
const editorContent = document.querySelector('.editor').innerHTML;
const element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(editorContent));
element.setAttribute('download', 'wordpad_text.txt');
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
Documentation
Step 1:- Open txt file from the folder for code
Step 2:- Copy all code
Step 3:- Open your website dashboard or blog
Step 4:- Add HTML element
Step 5:- Paste all code in your html element
Step 6:- Save file
Done you are successfully Pasted code in your website.
0 Comments