Files
wehub-resource-sync 91e75e620b
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:19 +08:00

263 lines
6.3 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Folder Example</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #333;
padding: 20px;
min-height: 100vh;
}
.container {
max-width: 900px;
margin: 0 auto;
background: white;
border-radius: 16px;
padding: 40px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
h1 {
font-size: 2.5em;
margin-bottom: 20px;
color: #667eea;
text-align: center;
}
h2 {
font-size: 1.8em;
margin: 30px 0 15px;
color: #764ba2;
}
h3 {
font-size: 1.2em;
margin-bottom: 8px;
color: #333;
}
p {
line-height: 1.6;
margin-bottom: 15px;
font-size: 1.1em;
}
code {
background: #f5f5f5;
padding: 2px 6px;
border-radius: 4px;
font-family: 'Monaco', 'Courier New', monospace;
font-size: 0.9em;
color: #e83e8c;
}
.info-box {
background: #f8f9fa;
border-left: 4px solid #667eea;
padding: 20px;
margin: 25px 0;
border-radius: 8px;
}
.info-box ul {
margin-left: 20px;
margin-top: 10px;
}
.info-box li {
margin: 8px 0;
line-height: 1.6;
}
.features {
margin: 30px 0;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin-top: 20px;
}
.feature-card {
background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
border: 2px solid #667eea30;
border-radius: 12px;
padding: 20px;
text-align: center;
transition:
transform 0.3s ease,
box-shadow 0.3s ease;
}
.feature-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}
.feature-card .icon {
font-size: 3em;
display: block;
margin-bottom: 10px;
}
.feature-card h3 {
margin-bottom: 10px;
color: #667eea;
}
.feature-card p {
font-size: 0.95em;
color: #666;
margin: 0;
}
.demo-section {
background: #fff5f5;
border: 2px solid #764ba2;
border-radius: 12px;
padding: 30px;
margin-top: 30px;
text-align: center;
}
.demo-button {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
padding: 15px 40px;
font-size: 1.1em;
border-radius: 8px;
cursor: pointer;
font-weight: 600;
transition:
transform 0.2s ease,
box-shadow 0.2s ease;
margin-top: 15px;
}
.demo-button:hover {
transform: scale(1.05);
box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}
.demo-button:active {
transform: scale(0.98);
}
.result {
display: none;
margin-top: 20px;
padding: 15px;
background: #d4edda;
border: 1px solid #c3e6cb;
border-radius: 8px;
color: #155724;
font-weight: 600;
font-size: 1.1em;
}
@media (max-width: 768px) {
.container {
padding: 20px;
}
h1 {
font-size: 2em;
}
h2 {
font-size: 1.5em;
}
.feature-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="container">
<h1>🗂️ Folder Serving Example</h1>
<p>
This page is served from a folder using the <code>folder=</code> parameter in
<code>launch_window()</code>.
</p>
<div class="info-box">
<h2>How it works:</h2>
<ul>
<li>
The <code>web/</code> folder contains this <code>index.html</code> and a
<code>style.css</code> file
</li>
<li>The folder path is passed to <code>env.launch_window(folder="path/to/web")</code></li>
<li>The provider automatically serves the folder contents</li>
<li>External resources (CSS, JS, images) are loaded relative to index.html</li>
</ul>
</div>
<div class="features">
<h2>Benefits:</h2>
<div class="feature-grid">
<div class="feature-card">
<span class="icon">📁</span>
<h3>File Structure</h3>
<p>Organize your UI in separate files instead of inline HTML</p>
</div>
<div class="feature-card">
<span class="icon">🎨</span>
<h3>External CSS</h3>
<p>Keep your styles in separate CSS files for better maintainability</p>
</div>
<div class="feature-card">
<span class="icon"></span>
<h3>Fast Development</h3>
<p>Edit files directly and reload without rebuilding</p>
</div>
<div class="feature-card">
<span class="icon">🔧</span>
<h3>Multi-Provider</h3>
<p>Works with both webtop and computer providers</p>
</div>
</div>
</div>
<div class="demo-section">
<h2>Interactive Demo:</h2>
<button class="demo-button" onclick="handleClick()">Click Me!</button>
<p id="click-result" class="result"></p>
</div>
</div>
<script>
function handleClick() {
const result = document.getElementById('click-result');
result.textContent = '✅ Button clicked successfully!';
result.style.display = 'block';
setTimeout(() => {
result.style.display = 'none';
}, 3000);
}
// Display current timestamp
const timestamp = new Date().toLocaleString();
console.log('Page loaded at:', timestamp);
</script>
</body>
</html>