Replaces the screenshot placeholder with a live animated demo showing: - Sidebar with fake sessions and token usage bars - User typing animation with cursor - Thinking indicator with animated dots - Colored tool call badges (web_search, exec) - Expandable tool results with parameters - Formatted assistant response with markdown - Auto-looping animation All pure CSS/JS, no dependencies. Matches the app's dark theme and color scheme. Closes feedback item #12
677 lines
24 KiB
HTML
677 lines
24 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>PinchChat — Webchat UI for OpenClaw</title>
|
|
<meta name="description" content="A sleek, dark-themed webchat UI for OpenClaw. Monitor sessions, stream responses, and inspect tool calls in real-time." />
|
|
<meta property="og:title" content="PinchChat" />
|
|
<meta property="og:description" content="A sleek, dark-themed webchat UI for OpenClaw." />
|
|
<meta property="og:image" content="https://raw.githubusercontent.com/MarlBurroW/pinchchat/main/public/logo.png" />
|
|
<meta property="og:url" content="https://marlburrow.github.io/pinchchat/" />
|
|
<link rel="icon" type="image/png" href="https://raw.githubusercontent.com/MarlBurroW/pinchchat/main/public/logo.png" />
|
|
<style>
|
|
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
|
|
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
|
|
:root {
|
|
--bg-primary: #0a0a0f;
|
|
--bg-secondary: #12121a;
|
|
--bg-card: #1a1a2e;
|
|
--border: #2a2a3e;
|
|
--text-primary: #e4e4e7;
|
|
--text-secondary: #a1a1aa;
|
|
--accent-cyan: #22d3ee;
|
|
--accent-purple: #a78bfa;
|
|
--accent-pink: #f472b6;
|
|
--glow-cyan: rgba(34, 211, 238, 0.15);
|
|
--glow-purple: rgba(167, 139, 250, 0.15);
|
|
}
|
|
|
|
body {
|
|
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
background: var(--bg-primary);
|
|
color: var(--text-primary);
|
|
line-height: 1.6;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
/* Animated background gradient */
|
|
.bg-gradient {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: -1;
|
|
background:
|
|
radial-gradient(ellipse 80% 50% at 50% -20%, var(--glow-cyan), transparent),
|
|
radial-gradient(ellipse 60% 40% at 80% 60%, var(--glow-purple), transparent),
|
|
var(--bg-primary);
|
|
}
|
|
|
|
.container {
|
|
max-width: 960px;
|
|
margin: 0 auto;
|
|
padding: 0 1.5rem;
|
|
}
|
|
|
|
/* Hero */
|
|
.hero {
|
|
text-align: center;
|
|
padding: 6rem 0 4rem;
|
|
}
|
|
|
|
.hero-logo {
|
|
width: 140px;
|
|
height: 140px;
|
|
margin: 0 auto 1.5rem;
|
|
filter: drop-shadow(0 0 30px rgba(34, 211, 238, 0.3));
|
|
animation: float 4s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes float {
|
|
0%, 100% { transform: translateY(0); }
|
|
50% { transform: translateY(-10px); }
|
|
}
|
|
|
|
.hero h1 {
|
|
font-size: 3.5rem;
|
|
font-weight: 800;
|
|
letter-spacing: -0.02em;
|
|
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.hero .tagline {
|
|
font-size: 1.25rem;
|
|
color: var(--text-secondary);
|
|
max-width: 600px;
|
|
margin: 0 auto 2.5rem;
|
|
}
|
|
|
|
.buttons {
|
|
display: flex;
|
|
gap: 1rem;
|
|
justify-content: center;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
padding: 0.75rem 1.75rem;
|
|
border-radius: 0.75rem;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
text-decoration: none;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
|
|
color: var(--bg-primary);
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 8px 30px rgba(34, 211, 238, 0.3);
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: var(--bg-card);
|
|
color: var(--text-primary);
|
|
border: 1px solid var(--border);
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
border-color: var(--accent-cyan);
|
|
transform: translateY(-2px);
|
|
}
|
|
|
|
/* Docker oneliner */
|
|
.oneliner {
|
|
margin: 3rem auto;
|
|
max-width: 700px;
|
|
background: var(--bg-secondary);
|
|
border: 1px solid var(--border);
|
|
border-radius: 0.75rem;
|
|
padding: 1rem 1.5rem;
|
|
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
font-size: 0.9rem;
|
|
color: var(--accent-cyan);
|
|
text-align: left;
|
|
position: relative;
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.oneliner::before {
|
|
content: '$ ';
|
|
color: var(--accent-purple);
|
|
}
|
|
|
|
.oneliner-label {
|
|
text-align: center;
|
|
font-size: 0.85rem;
|
|
color: var(--text-secondary);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
/* Features */
|
|
.features {
|
|
padding: 4rem 0;
|
|
}
|
|
|
|
.features h2 {
|
|
text-align: center;
|
|
font-size: 2rem;
|
|
font-weight: 700;
|
|
margin-bottom: 3rem;
|
|
}
|
|
|
|
.features-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.feature-card {
|
|
background: var(--bg-card);
|
|
border: 1px solid var(--border);
|
|
border-radius: 1rem;
|
|
padding: 1.5rem;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.feature-card:hover {
|
|
border-color: var(--accent-cyan);
|
|
transform: translateY(-3px);
|
|
box-shadow: 0 8px 30px rgba(34, 211, 238, 0.08);
|
|
}
|
|
|
|
.feature-icon {
|
|
font-size: 1.75rem;
|
|
margin-bottom: 0.75rem;
|
|
}
|
|
|
|
.feature-card h3 {
|
|
font-size: 1.1rem;
|
|
font-weight: 600;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.feature-card p {
|
|
font-size: 0.9rem;
|
|
color: var(--text-secondary);
|
|
line-height: 1.5;
|
|
}
|
|
|
|
/* Screenshot section */
|
|
.screenshot-section {
|
|
padding: 3rem 0;
|
|
text-align: center;
|
|
}
|
|
|
|
.screenshot-section h2 {
|
|
font-size: 2rem;
|
|
font-weight: 700;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.screenshot-placeholder {
|
|
background: var(--bg-card);
|
|
border: 1px dashed var(--border);
|
|
border-radius: 1rem;
|
|
padding: 4rem 2rem;
|
|
color: var(--text-secondary);
|
|
font-size: 1rem;
|
|
}
|
|
|
|
/* Footer */
|
|
.footer {
|
|
text-align: center;
|
|
padding: 4rem 0 2rem;
|
|
color: var(--text-secondary);
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
.footer a {
|
|
color: var(--accent-cyan);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.footer a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.footer-links {
|
|
display: flex;
|
|
gap: 2rem;
|
|
justify-content: center;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
/* Responsive */
|
|
@media (max-width: 640px) {
|
|
.hero { padding: 4rem 0 2rem; }
|
|
.hero h1 { font-size: 2.5rem; }
|
|
.hero .tagline { font-size: 1.05rem; }
|
|
.oneliner { font-size: 0.78rem; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="bg-gradient"></div>
|
|
|
|
<section class="hero">
|
|
<div class="container">
|
|
<img src="https://raw.githubusercontent.com/MarlBurroW/pinchchat/main/public/logo.png" alt="PinchChat Logo" class="hero-logo" />
|
|
<h1>PinchChat</h1>
|
|
<p class="tagline">A sleek, dark-themed webchat UI for <a href="https://github.com/openclaw/openclaw" style="color: var(--accent-cyan); text-decoration: none;">OpenClaw</a>. Monitor sessions, stream AI responses, and inspect tool calls — all in real-time.</p>
|
|
<div class="buttons">
|
|
<a href="https://github.com/MarlBurroW/pinchchat#-quick-start" class="btn btn-primary">🚀 Get Started</a>
|
|
<a href="https://github.com/MarlBurroW/pinchchat" class="btn btn-secondary">⭐ GitHub</a>
|
|
</div>
|
|
|
|
<p class="oneliner-label" style="margin-top: 3rem;">Run it now with one command:</p>
|
|
<div class="oneliner">docker run -p 3000:80 ghcr.io/marlburrow/pinchchat:latest</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="features">
|
|
<div class="container">
|
|
<h2>Features</h2>
|
|
<div class="features-grid">
|
|
<div class="feature-card">
|
|
<div class="feature-icon">🔧</div>
|
|
<h3>Tool Call Visualization</h3>
|
|
<p>See what your agent is doing in real-time. Colored badges, visible parameters, expandable results — the feature missing from every other chat UI.</p>
|
|
</div>
|
|
<div class="feature-card">
|
|
<div class="feature-icon">💬</div>
|
|
<h3>GPT-like Interface</h3>
|
|
<p>Sessions in a sidebar, switch between conversations. Instantly familiar if you've used ChatGPT or Claude.</p>
|
|
</div>
|
|
<div class="feature-card">
|
|
<div class="feature-icon">📋</div>
|
|
<h3>Multi-Session Navigation</h3>
|
|
<p>Browse all active sessions — main chat, cron jobs, sub-agents, background tasks. Everything in one place.</p>
|
|
</div>
|
|
<div class="feature-card">
|
|
<div class="feature-icon">⚡</div>
|
|
<h3>Live Streaming</h3>
|
|
<p>Watch the agent think and write token by token. Full WebSocket streaming from your OpenClaw gateway.</p>
|
|
</div>
|
|
<div class="feature-card">
|
|
<div class="feature-icon">📊</div>
|
|
<h3>Token Usage Tracking</h3>
|
|
<p>Progress bars per session showing context usage in real-time. Know exactly how much headroom is left.</p>
|
|
</div>
|
|
<div class="feature-card">
|
|
<div class="feature-icon">🖼️</div>
|
|
<h3>Inline Images</h3>
|
|
<p>Generated or read images render directly in chat. Click to view full-size in a lightbox.</p>
|
|
</div>
|
|
<div class="feature-card">
|
|
<div class="feature-icon">🎯</div>
|
|
<h3>Chat-Focused</h3>
|
|
<p>No settings menus or config panels cluttering the screen. Just the conversation, clean and efficient.</p>
|
|
</div>
|
|
<div class="feature-card">
|
|
<div class="feature-icon">🌐</div>
|
|
<h3>i18n</h3>
|
|
<p>English and French built-in. Easy to add new languages.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="demo-section">
|
|
<div class="container">
|
|
<h2>See it in Action</h2>
|
|
<p style="text-align:center;color:var(--text-secondary);margin-bottom:2rem;font-size:0.95rem;">Watch the agent think, call tools, and respond — all in real-time.</p>
|
|
<div class="demo-window">
|
|
<!-- Sidebar -->
|
|
<div class="demo-sidebar">
|
|
<div class="demo-sidebar-header">
|
|
<img src="https://raw.githubusercontent.com/MarlBurroW/pinchchat/main/public/logo.png" alt="" class="demo-sidebar-logo" />
|
|
<span>PinchChat</span>
|
|
</div>
|
|
<div class="demo-session demo-session-active">
|
|
<div class="demo-session-name">🏠 Main Session</div>
|
|
<div class="demo-token-bar"><div class="demo-token-fill" style="width:42%"></div></div>
|
|
</div>
|
|
<div class="demo-session">
|
|
<div class="demo-session-name">⏰ Daily AI Watch</div>
|
|
<div class="demo-token-bar"><div class="demo-token-fill demo-token-low" style="width:18%"></div></div>
|
|
</div>
|
|
<div class="demo-session">
|
|
<div class="demo-session-name">🔧 PinchChat Improve</div>
|
|
<div class="demo-token-bar"><div class="demo-token-fill" style="width:67%"></div></div>
|
|
</div>
|
|
<div class="demo-session">
|
|
<div class="demo-session-name">📧 Email Check</div>
|
|
<div class="demo-token-bar"><div class="demo-token-fill demo-token-low" style="width:8%"></div></div>
|
|
</div>
|
|
</div>
|
|
<!-- Chat area -->
|
|
<div class="demo-chat">
|
|
<div class="demo-chat-scroll" id="demo-chat-area">
|
|
<!-- Messages injected by JS -->
|
|
</div>
|
|
<div class="demo-input">
|
|
<div class="demo-input-box" id="demo-input-text"></div>
|
|
<div class="demo-send-btn">➤</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<style>
|
|
.demo-section { padding: 3rem 0 4rem; }
|
|
.demo-section h2 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
|
|
|
|
.demo-window {
|
|
display: flex;
|
|
border: 1px solid var(--border);
|
|
border-radius: 1rem;
|
|
overflow: hidden;
|
|
height: 420px;
|
|
background: var(--bg-secondary);
|
|
box-shadow: 0 20px 60px rgba(0,0,0,0.4);
|
|
}
|
|
|
|
/* Sidebar */
|
|
.demo-sidebar {
|
|
width: 220px;
|
|
min-width: 220px;
|
|
background: #0d0d14;
|
|
border-right: 1px solid var(--border);
|
|
padding: 0.75rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.25rem;
|
|
}
|
|
.demo-sidebar-header {
|
|
display: flex; align-items: center; gap: 0.5rem;
|
|
font-weight: 700; font-size: 0.95rem; padding: 0.5rem 0.25rem 0.75rem;
|
|
color: var(--text-primary);
|
|
}
|
|
.demo-sidebar-logo { width: 22px; height: 22px; border-radius: 4px; }
|
|
.demo-session {
|
|
padding: 0.5rem 0.6rem;
|
|
border-radius: 0.5rem;
|
|
cursor: default;
|
|
transition: background 0.15s;
|
|
}
|
|
.demo-session-active { background: rgba(34,211,238,0.08); }
|
|
.demo-session-name { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
.demo-session-active .demo-session-name { color: var(--text-primary); }
|
|
.demo-token-bar {
|
|
height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden;
|
|
}
|
|
.demo-token-fill { height: 100%; background: var(--accent-cyan); border-radius: 2px; transition: width 1s ease; }
|
|
.demo-token-low { background: #4ade80; }
|
|
|
|
/* Chat */
|
|
.demo-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
|
|
.demo-chat-scroll { flex: 1; overflow-y: auto; padding: 1.25rem 1.25rem 0.5rem; display: flex; flex-direction: column; gap: 1rem; }
|
|
.demo-input {
|
|
display: flex; align-items: center; gap: 0.5rem;
|
|
padding: 0.75rem 1rem;
|
|
border-top: 1px solid var(--border);
|
|
}
|
|
.demo-input-box {
|
|
flex: 1; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
|
|
border-radius: 0.5rem; padding: 0.5rem 0.75rem;
|
|
font-size: 0.85rem; color: var(--text-primary); min-height: 34px;
|
|
font-family: inherit;
|
|
}
|
|
.demo-send-btn {
|
|
width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
|
|
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
|
|
border-radius: 0.5rem; color: var(--bg-primary); font-size: 1rem; cursor: default;
|
|
}
|
|
|
|
/* Messages */
|
|
.demo-msg { display: flex; gap: 0.6rem; animation: msgIn 0.3s ease; }
|
|
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
|
|
.demo-avatar {
|
|
width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
|
|
font-size: 0.75rem; flex-shrink: 0; margin-top: 2px;
|
|
}
|
|
.demo-avatar-user { background: rgba(34,211,238,0.15); color: var(--accent-cyan); }
|
|
.demo-avatar-bot { background: rgba(167,139,250,0.15); color: var(--accent-purple); }
|
|
.demo-msg-body { flex: 1; min-width: 0; }
|
|
.demo-msg-role { font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 0.15rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
|
|
.demo-msg-text { font-size: 0.85rem; line-height: 1.55; color: var(--text-primary); }
|
|
.demo-msg-text code { background: rgba(255,255,255,0.06); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.8rem; font-family: 'SF Mono','Fira Code',monospace; }
|
|
|
|
/* Thinking */
|
|
.demo-thinking {
|
|
display: inline-flex; align-items: center; gap: 0.4rem;
|
|
font-size: 0.78rem; color: var(--accent-purple); padding: 0.3rem 0;
|
|
}
|
|
.demo-thinking-dots span {
|
|
display: inline-block; width: 4px; height: 4px; background: var(--accent-purple);
|
|
border-radius: 50%; animation: blink 1.2s infinite;
|
|
}
|
|
.demo-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
|
|
.demo-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
|
|
@keyframes blink { 0%,80%,100% { opacity: 0.2; } 40% { opacity: 1; } }
|
|
|
|
/* Tool calls */
|
|
.demo-tool {
|
|
display: inline-flex; align-items: center; gap: 0.35rem;
|
|
padding: 0.2rem 0.55rem; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 500;
|
|
border: 1px solid; margin: 0.2rem 0.3rem 0.2rem 0; cursor: default;
|
|
transition: all 0.2s;
|
|
}
|
|
.demo-tool-exec { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.1); color: #fcd34d; }
|
|
.demo-tool-read { border-color: rgba(14,165,233,0.3); background: rgba(14,165,233,0.1); color: #7dd3fc; }
|
|
.demo-tool-web { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.1); color: #6ee7b7; }
|
|
.demo-tool-edit { border-color: rgba(139,92,246,0.3); background: rgba(139,92,246,0.1); color: #c4b5fd; }
|
|
.demo-tool-memory { border-color: rgba(244,63,94,0.3); background: rgba(244,63,94,0.1); color: #fda4af; }
|
|
|
|
.demo-tool-expand {
|
|
margin: 0.2rem 0 0.3rem;
|
|
border: 1px solid rgba(255,255,255,0.06);
|
|
border-radius: 0.5rem;
|
|
background: rgba(255,255,255,0.02);
|
|
font-size: 0.73rem;
|
|
overflow: hidden;
|
|
animation: expandIn 0.3s ease;
|
|
}
|
|
@keyframes expandIn { from { opacity:0; max-height:0; } to { opacity:1; max-height:200px; } }
|
|
.demo-tool-expand-header {
|
|
padding: 0.35rem 0.6rem;
|
|
color: var(--text-secondary);
|
|
font-weight: 600;
|
|
border-bottom: 1px solid rgba(255,255,255,0.04);
|
|
}
|
|
.demo-tool-expand-body {
|
|
padding: 0.35rem 0.6rem;
|
|
color: var(--text-secondary);
|
|
font-family: 'SF Mono','Fira Code',monospace;
|
|
font-size: 0.7rem;
|
|
white-space: pre-wrap;
|
|
max-height: 80px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Typing cursor */
|
|
.demo-cursor { display: inline-block; width: 2px; height: 1em; background: var(--accent-cyan); animation: cursorBlink 0.8s step-end infinite; vertical-align: text-bottom; margin-left: 1px; }
|
|
@keyframes cursorBlink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
|
|
|
|
/* Responsive: hide sidebar on small screens */
|
|
@media (max-width: 640px) {
|
|
.demo-sidebar { display: none; }
|
|
.demo-window { height: 380px; }
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
(function() {
|
|
const chat = document.getElementById('demo-chat-area');
|
|
const input = document.getElementById('demo-input-text');
|
|
|
|
// Scenario timeline
|
|
const scenario = [
|
|
{ type: 'input-type', text: 'What\'s the weather in Grenoble and check my latest emails?', delay: 0 },
|
|
{ type: 'input-send', delay: 800 },
|
|
{ type: 'user-msg', text: 'What\'s the weather in Grenoble and check my latest emails?', delay: 200 },
|
|
{ type: 'thinking', delay: 400 },
|
|
{ type: 'tool-badge', name: 'web_search', cls: 'demo-tool-web', icon: '🌐', label: 'web_search', delay: 800 },
|
|
{ type: 'tool-expand', tool: 'web_search', params: '{ "query": "weather Grenoble today" }', result: '☀️ Grenoble: 14°C, partly cloudy\nWind: 12 km/h NW · Humidity: 58%\nForecast: Clear evening, 8°C overnight', delay: 600 },
|
|
{ type: 'tool-badge', name: 'exec', cls: 'demo-tool-exec', icon: '⚡', label: 'exec', delay: 500 },
|
|
{ type: 'tool-expand', tool: 'exec', params: '{ "command": "gmail unread 3" }', result: '1. [Urgent] Deploy review needed — team@fasst.io\n2. Charlotte\'s school — photo day reminder\n3. Newsletter — This Week in AI', delay: 700 },
|
|
{ type: 'remove-thinking', delay: 100 },
|
|
{ type: 'assistant-msg', html: 'Here\'s your update:<br><br>🌤️ <strong>Grenoble</strong> — 14°C, partly cloudy. Clear evening ahead (8°C tonight).<br><br>📧 <strong>3 unread emails:</strong><br>1. <code>[Urgent]</code> Deploy review needed — from team@fasst.io<br>2. Charlotte\'s school — photo day reminder 📸<br>3. Newsletter — This Week in AI<br><br>Want me to open any of these?', delay: 200 },
|
|
{ type: 'pause', delay: 4000 },
|
|
{ type: 'reset', delay: 0 },
|
|
];
|
|
|
|
let thinkingEl = null;
|
|
let toolArea = null;
|
|
let currentBotMsg = null;
|
|
|
|
function scrollDown() {
|
|
chat.scrollTop = chat.scrollHeight;
|
|
}
|
|
|
|
function typeText(el, text, cb) {
|
|
let i = 0;
|
|
el.textContent = '';
|
|
const cursor = document.createElement('span');
|
|
cursor.className = 'demo-cursor';
|
|
el.appendChild(cursor);
|
|
const iv = setInterval(() => {
|
|
if (i < text.length) {
|
|
el.insertBefore(document.createTextNode(text[i]), cursor);
|
|
i++;
|
|
} else {
|
|
clearInterval(iv);
|
|
if (cursor.parentNode) cursor.remove();
|
|
if (cb) cb();
|
|
}
|
|
}, 28);
|
|
}
|
|
|
|
function createBotMsg() {
|
|
const msg = document.createElement('div');
|
|
msg.className = 'demo-msg';
|
|
msg.innerHTML = '<div class="demo-avatar demo-avatar-bot">🤖</div><div class="demo-msg-body"><div class="demo-msg-role">Assistant</div></div>';
|
|
chat.appendChild(msg);
|
|
currentBotMsg = msg.querySelector('.demo-msg-body');
|
|
toolArea = document.createElement('div');
|
|
currentBotMsg.appendChild(toolArea);
|
|
scrollDown();
|
|
return currentBotMsg;
|
|
}
|
|
|
|
function runStep(idx) {
|
|
if (idx >= scenario.length) return;
|
|
const step = scenario[idx];
|
|
const next = () => setTimeout(() => runStep(idx + 1), scenario[idx + 1]?.delay || 0);
|
|
|
|
switch (step.type) {
|
|
case 'input-type':
|
|
typeText(input, step.text, next);
|
|
break;
|
|
case 'input-send':
|
|
input.textContent = '';
|
|
next();
|
|
break;
|
|
case 'user-msg': {
|
|
const msg = document.createElement('div');
|
|
msg.className = 'demo-msg';
|
|
msg.innerHTML = '<div class="demo-avatar demo-avatar-user">👤</div><div class="demo-msg-body"><div class="demo-msg-role">You</div><div class="demo-msg-text"></div></div>';
|
|
chat.appendChild(msg);
|
|
msg.querySelector('.demo-msg-text').textContent = step.text;
|
|
scrollDown();
|
|
next();
|
|
break;
|
|
}
|
|
case 'thinking': {
|
|
if (!currentBotMsg) createBotMsg();
|
|
thinkingEl = document.createElement('div');
|
|
thinkingEl.className = 'demo-thinking';
|
|
thinkingEl.innerHTML = 'Thinking <span class="demo-thinking-dots"><span></span><span></span><span></span></span>';
|
|
currentBotMsg.appendChild(thinkingEl);
|
|
scrollDown();
|
|
next();
|
|
break;
|
|
}
|
|
case 'tool-badge': {
|
|
if (!toolArea) createBotMsg();
|
|
const badge = document.createElement('span');
|
|
badge.className = 'demo-tool ' + step.cls;
|
|
badge.innerHTML = step.icon + ' ' + step.label;
|
|
badge.dataset.toolName = step.name;
|
|
toolArea.appendChild(badge);
|
|
scrollDown();
|
|
next();
|
|
break;
|
|
}
|
|
case 'tool-expand': {
|
|
const expand = document.createElement('div');
|
|
expand.className = 'demo-tool-expand';
|
|
expand.innerHTML =
|
|
'<div class="demo-tool-expand-header">▶ ' + step.tool + '</div>' +
|
|
'<div class="demo-tool-expand-body"><strong>Parameters:</strong>\n' + step.params + '\n\n<strong>Result:</strong>\n' + step.result + '</div>';
|
|
toolArea.appendChild(expand);
|
|
scrollDown();
|
|
next();
|
|
break;
|
|
}
|
|
case 'remove-thinking':
|
|
if (thinkingEl) { thinkingEl.remove(); thinkingEl = null; }
|
|
next();
|
|
break;
|
|
case 'assistant-msg': {
|
|
const textDiv = document.createElement('div');
|
|
textDiv.className = 'demo-msg-text';
|
|
textDiv.innerHTML = step.html;
|
|
currentBotMsg.appendChild(textDiv);
|
|
scrollDown();
|
|
next();
|
|
break;
|
|
}
|
|
case 'pause':
|
|
setTimeout(next, step.delay);
|
|
break;
|
|
case 'reset':
|
|
setTimeout(() => {
|
|
chat.innerHTML = '';
|
|
input.textContent = '';
|
|
thinkingEl = null;
|
|
toolArea = null;
|
|
currentBotMsg = null;
|
|
runStep(0);
|
|
}, 500);
|
|
break;
|
|
}
|
|
}
|
|
|
|
// Start after a short delay
|
|
setTimeout(() => runStep(0), 1200);
|
|
})();
|
|
</script>
|
|
|
|
<footer class="footer">
|
|
<div class="container">
|
|
<div class="footer-links">
|
|
<a href="https://github.com/MarlBurroW/pinchchat">GitHub</a>
|
|
<a href="https://github.com/openclaw/openclaw">OpenClaw</a>
|
|
<a href="https://discord.com/invite/clawd">Community</a>
|
|
<a href="https://github.com/MarlBurroW/pinchchat/blob/main/LICENSE">MIT License</a>
|
|
</div>
|
|
<p>Built with ❤️ for the <a href="https://github.com/openclaw/openclaw">OpenClaw</a> community</p>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|