Changed from RitzRuntime.loadComponent() (doesn't exist) to new RitzLoader().load() (correct API). Also updated DOM element IDs: - #root → #app (RitzLoader default) - Added #status div for load status messages - Added styling for status indicator Should now load properly in browser. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
143 lines
3.5 KiB
HTML
143 lines
3.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Ritz TextInput 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%);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 20px;
|
|
}
|
|
|
|
.container {
|
|
background: white;
|
|
padding: 40px;
|
|
border-radius: 16px;
|
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
max-width: 500px;
|
|
width: 100%;
|
|
}
|
|
|
|
h1 {
|
|
color: #667eea;
|
|
margin-bottom: 10px;
|
|
font-size: 32px;
|
|
}
|
|
|
|
.instructions {
|
|
color: #666;
|
|
margin-bottom: 30px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.button-group {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 20px;
|
|
margin: 30px 0;
|
|
}
|
|
|
|
button {
|
|
width: 60px;
|
|
height: 60px;
|
|
font-size: 32px;
|
|
border: 2px solid #667eea;
|
|
background: white;
|
|
color: #667eea;
|
|
border-radius: 12px;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
font-weight: bold;
|
|
}
|
|
|
|
button:hover {
|
|
background: #667eea;
|
|
color: white;
|
|
transform: scale(1.1);
|
|
}
|
|
|
|
button:active {
|
|
transform: scale(0.95);
|
|
}
|
|
|
|
.counter-display {
|
|
background: #f8f9ff;
|
|
padding: 20px 40px;
|
|
border-radius: 12px;
|
|
border: 3px solid #667eea;
|
|
font-size: 24px;
|
|
font-weight: bold;
|
|
color: #667eea;
|
|
min-width: 150px;
|
|
text-align: center;
|
|
}
|
|
|
|
.todo {
|
|
margin-top: 40px;
|
|
padding-top: 30px;
|
|
border-top: 2px dashed #e0e0e0;
|
|
color: #999;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.todo-list {
|
|
margin-top: 15px;
|
|
padding-left: 25px;
|
|
}
|
|
|
|
.todo-list li {
|
|
color: #666;
|
|
font-size: 13px;
|
|
margin: 8px 0;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
#app {
|
|
width: 100%;
|
|
}
|
|
|
|
#status {
|
|
position: fixed;
|
|
top: 20px;
|
|
right: 20px;
|
|
padding: 10px 20px;
|
|
background: rgba(255, 255, 255, 0.95);
|
|
border-radius: 8px;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: #667eea;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="app">Loading...</div>
|
|
<div id="status"></div>
|
|
|
|
<script src="../runtime/ritz-runtime.js"></script>
|
|
<script>
|
|
// Wait for DOM to be ready
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
new RitzLoader().load('TextInput.wasm', 'TextInput');
|
|
});
|
|
} else {
|
|
new RitzLoader().load('TextInput.wasm', 'TextInput');
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|