Creating a full-featured text editor with a 10GB capacity is not feasible directly in a browser environment due to inherent resource and performance constraints, but I can provide you with a simple web-based text editor that allows basic editing, copying, sharing via a URL hash, and storing text in localStorage.
Here's a minimalist example with:
An editable textarea.
Copy to clipboard button.
Shareable URL via encoding the text in the URL hash (#).
Loading text from the URL hash on page load.
Simple styling with HTML/CSS.
Note: Copying and sharing 10GB of text is unrealistic in a URL or browser storage. URLs typically have a length limit (~2000 characters in many browsers), and localStorage is limited to around 5-10MB per domain in most browsers. 10GB is impractical on the client side in a browser.
Simple HTML/CSS/JS Text Editor with sharing via # hash
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Simple Text Editor with Share</title>
<style>
body, html {
margin: 0;
height: 100%;
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
}
textarea {
flex: 1;
width: 100%;
padding: 10px;
box-sizing: border-box;
font-size: 16px;
font-family: monospace;
resize: none;
}
#buttons {
background: #eee;
padding: 8px;
display: flex;
gap: 10px;
}
button {
padding: 8px 16px;
font-size: 16px;
cursor: pointer;
}
#share-link {
flex: 1;
font-size: 14px;
padding: 8px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<textarea id="editor" placeholder="Start typing here..."></textarea>
<div id="buttons">
<button id="copy-btn">Copy Text</button>
<button id="share-btn">Generate Share URL</button>
<input type="text" id="share-link" readonly />
</div>
<script>
const editor = document.getElementById('editor');
const copyBtn = document.getElementById('copy-btn');
const shareBtn = document.getElementById('share-btn');
const shareLink = document.getElementById('share-link');
// Helper: encode text to base64 to store in URL
function encodeText(text) {
return btoa(unescape(encodeURIComponent(text)));
}
// Helper: decode base64 back to text
function decodeText(encoded) {
try {
return decodeURIComponent(escape(atob(encoded)));
} catch(e) {
return '';
}
}
// Load from URL hash on page load
function loadFromHash() {
if(location.hash.startsWith('#/')) {
const encoded = location.hash.substring(2);
const text = decodeText(encoded);
editor.value = text;
}
}
// Generate share URL with encoded text in hash
function generateShareURL() {
const text = editor.value;
// Check length limit - simple limit for demo: ~1800 chars max
const maxLen = 1800;
if(text.length > maxLen) {
alert(`Text too long to share via URL (max ~${maxLen} chars). Please shorten.`);
return;
}
const encoded = encodeText(text);
const url = `${location.origin}${location.pathname}#/${encoded}`;
shareLink.value = url;
shareLink.select();
}
copyBtn.addEventListener('click', () => {
navigator.clipboard.writeText(editor.value).then(() => {
alert('Text copied to clipboard');
}).catch(() => {
alert('Failed to copy text');
});
});
shareBtn.addEventListener('click', generateShareURL);
// On page load
loadFromHash();
// Optional: update localStorage (not asked but useful)
/*
window.addEventListener('beforeunload', () => {
localStorage.setItem('savedText', editor.value);
});
*/
</script>
</body>
</html>
How to use
Type or paste text into the textarea.
Click "Copy Text" to copy the entire text to the clipboard.
Click "Generate Share URL" to create a URL in the box that you can copy and share.
Opening the generated URL loads the text into the editor by decoding the URL hash.
Limitations:
The sharing URL length is limited (~2000 chars max URL length), so you can't share large texts via the URL.
Browser storage like localStorage is much smaller than 10GB.
Handling 10GB text is not feasible in the browser and not possible using this simple approach.
If you want a more powerful editor locally, consider desktop applications like VS Code or Electron-based apps.
If you want me to help build features like saving/loading files or chunked local storage, let me know!