When using AI tools like ChatGPT, Claude, or other code generators to create HTML apps for HTMLSync, follow these guidelines for best results:
Use clear, specific prompts that mention the HTMLSync requirements:
Create a single-file HTML application for [your app idea] that:
- Has all CSS and JavaScript inline (no external files except CDN libraries)
- Uses localStorage for data persistence
- Is fully self-contained in one HTML file
- Includes responsive design
.public-hidden
: You can add this class to any element to hide it from public users.no_sync_
: You can add this prefix to any localStorage key to prevent it from being synced with the server. This is useful for things like UI state i.e. theme (dark, light) e.t.c.<!DOCTYPE html>
declaration<meta name="viewport" content="width=device-width, initial-scale=1.0">
<main>
, <section>
, <article>
, etc.)<style>
tag in the <head>
section<style>
:root {
--primary-color: #3498db;
--background-color: #f8f9fa;
--text-color: #2c3e50;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background-color: var(--background-color);
color: var(--text-color);
}
</style>
<script>
tag before the closing </body>
tagAlways use localStorage for data persistence. HTMLSync automatically syncs this data across devices:
// Save data
localStorage.setItem('myapp_data', JSON.stringify(data));
// Load data
const savedData = JSON.parse(localStorage.getItem('myapp_data') || '[]');
// Clear data
localStorage.removeItem('myapp_data');