This project is a collection of web patterns with demos and examples. It showcases various functionalities using modern web APIs and techniques. The project is organized into different sections, each demonstrating a specific pattern or feature.
clipboard/
copy-image.html
copy-text.html
paste-files.html
paste-image.html
paste-text.html
files/
handle-files.html
open-directory.html
open-files.html
save-file.html
share-files.html
index.html
web-apps/
app-badge.html
app-shortcuts/
app-shortcuts.html
manifest.json
periodic-sync/
periodic-sync.html
sw.js
richer-install-ui.html
share-current-page.html
<img id="image-to-copy" src="https://via.placeholder.com/150" alt="Sample Image">
<button id="copy-image">Copy Image</button>
<textarea id="text-to-copy" rows="3" cols="50">Sample text to copy.</textarea>
<button id="copy-text">Copy Text</button>
<button id="paste-files">Paste Files</button>
<div id="pasted-files-container"></div>
<button id="paste-image">Paste Image</button>
<div id="pasted-image-container"></div>
<button id="paste-text">Paste Text</button>
<textarea id="pasted-text" rows="3" cols="50" placeholder="Pasted text will appear here."></textarea>
<div id="drop-zone" style="border: 2px dashed #ccc; padding: 20px;">Drag files here</div>
<button id="open-dir">Open Directory</button>
<input type="file" id="fallback" webkitdirectory hidden />
<button id="open-files">Open Files</button>
<input type="file" id="fallback" multiple hidden />
<button id="save-file">Save File</button>
<button id="share-file">Share File</button>
<button id="setBadge">Set Badge</button>
<button id="clearBadge">Clear Badge</button>
web-apps/app-shortcuts/manifest.json
.
<link rel="manifest" href="manifest.json">
<script>
if ('serviceWorker' in navigator && 'periodicSync' in ServiceWorkerRegistration.prototype) {
navigator.serviceWorker.register('sw.js').then(async (registration) => {
// Register periodic sync
});
}
</script>
<button id="installButton" style="display: none;">Install App</button>
<button id="shareButton">Share This Page</button>
To explore the web patterns, open index.html
in your browser. The main page provides links to all the demos and examples categorized into sections.
Built with ❤️ by Chris for DevFest Rift 2024.
This project is licensed under the MIT License.