mirror of
https://github.com/zos-apps/template.git
synced 2026-11-04 17:32:32 +00:00
291 lines
9.1 KiB
HTML
291 lines
9.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>zOS App Template - Documentation</title>
|
|
<meta name="description" content="Template for creating zOS applications">
|
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📦</text></svg>">
|
|
<style>
|
|
:root {
|
|
--bg: #0a0a0a;
|
|
--fg: #fafafa;
|
|
--muted: #a1a1aa;
|
|
--accent: #3b82f6;
|
|
--accent-hover: #2563eb;
|
|
--border: #27272a;
|
|
--code-bg: #18181b;
|
|
}
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
background: var(--bg);
|
|
color: var(--fg);
|
|
line-height: 1.6;
|
|
min-height: 100vh;
|
|
}
|
|
.container { max-width: 800px; margin: 0 auto; padding: 2rem; }
|
|
header {
|
|
text-align: center;
|
|
padding: 4rem 0 3rem;
|
|
border-bottom: 1px solid var(--border);
|
|
margin-bottom: 3rem;
|
|
}
|
|
.icon { font-size: 4rem; margin-bottom: 1rem; }
|
|
h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
|
|
.tagline { color: var(--muted); font-size: 1.25rem; }
|
|
.badges { margin-top: 1.5rem; display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
|
|
.badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 0.25rem 0.75rem;
|
|
background: var(--code-bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 9999px;
|
|
font-size: 0.875rem;
|
|
color: var(--muted);
|
|
}
|
|
h2 {
|
|
font-size: 1.5rem;
|
|
margin: 2.5rem 0 1rem;
|
|
padding-bottom: 0.5rem;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
h3 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; color: var(--accent); }
|
|
p { margin-bottom: 1rem; color: var(--muted); }
|
|
pre {
|
|
background: var(--code-bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 0.5rem;
|
|
padding: 1rem;
|
|
overflow-x: auto;
|
|
margin: 1rem 0;
|
|
}
|
|
code {
|
|
font-family: 'SF Mono', Monaco, monospace;
|
|
font-size: 0.875rem;
|
|
}
|
|
:not(pre) > code {
|
|
background: var(--code-bg);
|
|
padding: 0.2rem 0.4rem;
|
|
border-radius: 0.25rem;
|
|
}
|
|
ul, ol { margin: 1rem 0; padding-left: 1.5rem; color: var(--muted); }
|
|
li { margin: 0.5rem 0; }
|
|
a { color: var(--accent); text-decoration: none; }
|
|
a:hover { text-decoration: underline; }
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin: 1rem 0;
|
|
}
|
|
th, td {
|
|
text-align: left;
|
|
padding: 0.75rem;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
th { color: var(--fg); font-weight: 600; }
|
|
td { color: var(--muted); }
|
|
.cta {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
padding: 0.75rem 1.5rem;
|
|
background: var(--accent);
|
|
color: white;
|
|
border-radius: 0.5rem;
|
|
font-weight: 500;
|
|
margin: 1rem 0.5rem 1rem 0;
|
|
transition: background 0.2s;
|
|
}
|
|
.cta:hover { background: var(--accent-hover); text-decoration: none; }
|
|
.cta.secondary { background: transparent; border: 1px solid var(--border); color: var(--fg); }
|
|
.cta.secondary:hover { background: var(--code-bg); }
|
|
.step {
|
|
display: flex;
|
|
gap: 1rem;
|
|
margin: 1.5rem 0;
|
|
padding: 1rem;
|
|
background: var(--code-bg);
|
|
border-radius: 0.5rem;
|
|
}
|
|
.step-num {
|
|
flex-shrink: 0;
|
|
width: 2rem;
|
|
height: 2rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--accent);
|
|
color: white;
|
|
border-radius: 50%;
|
|
font-weight: 600;
|
|
}
|
|
.step-content { flex: 1; }
|
|
.step-title { font-weight: 600; color: var(--fg); margin-bottom: 0.5rem; }
|
|
footer {
|
|
margin-top: 4rem;
|
|
padding-top: 2rem;
|
|
border-top: 1px solid var(--border);
|
|
text-align: center;
|
|
color: var(--muted);
|
|
font-size: 0.875rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<div class="icon">📦</div>
|
|
<h1>zOS App Template</h1>
|
|
<p class="tagline">Build beautiful desktop apps for zOS</p>
|
|
<div class="badges">
|
|
<span class="badge">React</span>
|
|
<span class="badge">TypeScript</span>
|
|
<span class="badge">Tailwind CSS</span>
|
|
</div>
|
|
<div style="margin-top: 2rem;">
|
|
<a href="https://github.com/zos-apps/template/generate" class="cta">Use This Template</a>
|
|
<a href="https://github.com/zos-apps/template" class="cta secondary">View Source</a>
|
|
</div>
|
|
</header>
|
|
|
|
<h2>Quick Start</h2>
|
|
|
|
<div class="step">
|
|
<div class="step-num">1</div>
|
|
<div class="step-content">
|
|
<div class="step-title">Create Your App</div>
|
|
<p>Click "Use this template" or clone via CLI:</p>
|
|
<pre><code>gh repo create my-app --template zos-apps/template --public --clone
|
|
cd my-app</code></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="step">
|
|
<div class="step-num">2</div>
|
|
<div class="step-content">
|
|
<div class="step-title">Configure Your App</div>
|
|
<p>Edit <code>package.json</code> with your app details:</p>
|
|
<pre><code>{
|
|
"name": "@zos-apps/my-app",
|
|
"zos": {
|
|
"id": "com.yourname.myapp",
|
|
"name": "My App",
|
|
"icon": "🚀",
|
|
"category": "utilities"
|
|
}
|
|
}</code></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="step">
|
|
<div class="step-num">3</div>
|
|
<div class="step-content">
|
|
<div class="step-title">Build Your App</div>
|
|
<p>Edit <code>src/index.tsx</code> with your React component:</p>
|
|
<pre><code>const MyApp: React.FC<AppProps> = ({ className }) => {
|
|
return (
|
|
<div className={className}>
|
|
Hello, zOS!
|
|
</div>
|
|
);
|
|
};</code></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="step">
|
|
<div class="step-num">4</div>
|
|
<div class="step-content">
|
|
<div class="step-title">Deploy</div>
|
|
<p>Push to GitHub and your docs auto-deploy:</p>
|
|
<pre><code>git add .
|
|
git commit -m "feat: my awesome app"
|
|
git push</code></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<h2>Configuration</h2>
|
|
|
|
<h3>package.json zos Field</h3>
|
|
<table>
|
|
<tr><th>Property</th><th>Type</th><th>Description</th></tr>
|
|
<tr><td><code>id</code></td><td>string</td><td>Unique app ID (e.g., com.yourname.myapp)</td></tr>
|
|
<tr><td><code>name</code></td><td>string</td><td>Display name</td></tr>
|
|
<tr><td><code>icon</code></td><td>string</td><td>Emoji or URL</td></tr>
|
|
<tr><td><code>category</code></td><td>string</td><td>productivity, utilities, entertainment, developer, system</td></tr>
|
|
<tr><td><code>permissions</code></td><td>string[]</td><td>Required permissions</td></tr>
|
|
<tr><td><code>shortcut</code></td><td>string</td><td>Keyboard shortcut (e.g., Cmd+M)</td></tr>
|
|
<tr><td><code>installable</code></td><td>boolean</td><td>Can be installed via App Store</td></tr>
|
|
</table>
|
|
|
|
<h3>Permissions</h3>
|
|
<table>
|
|
<tr><th>Permission</th><th>Description</th></tr>
|
|
<tr><td><code>filesystem</code></td><td>Read/write files</td></tr>
|
|
<tr><td><code>shell</code></td><td>Execute commands</td></tr>
|
|
<tr><td><code>storage</code></td><td>Local storage access</td></tr>
|
|
<tr><td><code>network</code></td><td>HTTP requests</td></tr>
|
|
<tr><td><code>system</code></td><td>System settings</td></tr>
|
|
</table>
|
|
|
|
<h2>AppProps Interface</h2>
|
|
<pre><code>interface AppProps {
|
|
className?: string; // CSS class for styling
|
|
config?: AppConfig; // App configuration
|
|
onClose?: () => void; // Called when app closes
|
|
onFocus?: () => void; // Called when app gains focus
|
|
}</code></pre>
|
|
|
|
<h2>Examples</h2>
|
|
|
|
<h3>Simple App</h3>
|
|
<pre><code>const SimpleApp: React.FC<AppProps> = ({ className }) => (
|
|
<div className={className}>Hello World</div>
|
|
);</code></pre>
|
|
|
|
<h3>With State</h3>
|
|
<pre><code>const StatefulApp: React.FC<AppProps> = ({ className }) => {
|
|
const [count, setCount] = useState(0);
|
|
|
|
return (
|
|
<div className={className}>
|
|
<p>Count: {count}</p>
|
|
<button onClick={() => setCount(c => c + 1)}>+</button>
|
|
</div>
|
|
);
|
|
};</code></pre>
|
|
|
|
<h3>With Config</h3>
|
|
<pre><code>interface MyConfig { theme: 'light' | 'dark'; }
|
|
|
|
const ThemedApp: React.FC<AppProps & { config?: MyConfig }> = ({
|
|
className, config
|
|
}) => (
|
|
<div className={`${className} ${config?.theme === 'dark' ? 'bg-black' : 'bg-white'}`}>
|
|
Themed App
|
|
</div>
|
|
);</code></pre>
|
|
|
|
<h2>Publishing</h2>
|
|
<ol>
|
|
<li>Tag a release: <code>git tag v1.0.0 && git push origin v1.0.0</code></li>
|
|
<li>Users install via: <code>npm install github:zos-apps/my-app</code></li>
|
|
<li>Or via the zOS App Store!</li>
|
|
</ol>
|
|
|
|
<h2>Links</h2>
|
|
<ul>
|
|
<li><a href="https://github.com/zos-apps">All zOS Apps</a></li>
|
|
<li><a href="https://zos-apps.github.io/app-store">App Store</a></li>
|
|
<li><a href="https://github.com/zos-apps/template/issues">Report Issues</a></li>
|
|
</ul>
|
|
|
|
<footer>
|
|
<p>MIT © <a href="https://hanzo.ai">Hanzo AI</a></p>
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
</code></pre>
|