361 lines
17 KiB
TypeScript
361 lines
17 KiB
TypeScript
/**
|
|
* rNotes demo page — server-rendered HTML body.
|
|
*
|
|
* Returns the static HTML skeleton for the interactive notes demo.
|
|
* The client-side notes-demo.ts populates note cards, packing list,
|
|
* sidebar, and notebook header via WebSocket snapshots.
|
|
*/
|
|
|
|
export function renderDemo(): string {
|
|
return `
|
|
<div class="rd-root" style="--rd-accent-from:#f59e0b; --rd-accent-to:#fb923c">
|
|
|
|
<!-- ── Hero ── -->
|
|
<section class="rd-hero">
|
|
<div style="display:inline-flex;align-items:center;gap:0.5rem;padding:0.375rem 1rem;background:rgba(245,158,11,0.1);border:1px solid rgba(245,158,11,0.2);border-radius:9999px;font-size:0.875rem;color:#fbbf24;font-weight:500;margin-bottom:1.5rem;">
|
|
<span id="rd-hero-dot" style="width:0.5rem;height:0.5rem;border-radius:9999px;background:#f59e0b;animation:rd-pulse 2s ease-in-out infinite;"></span>
|
|
<span id="rd-hero-label">Interactive Demo</span>
|
|
</div>
|
|
<h1>See how rNotes works</h1>
|
|
<p class="rd-subtitle">A collaborative knowledge base for your team</p>
|
|
<div class="rd-meta">
|
|
<span>Live transcription</span>
|
|
<span>Audio & video</span>
|
|
<span>Organized notebooks</span>
|
|
<span>Canvas sync</span>
|
|
<span>Real-time collaboration</span>
|
|
</div>
|
|
<div class="rd-avatars" id="rd-avatars">
|
|
<div class="rd-avatar" style="background:#14b8a6" title="...">...</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- ── Context bar + Reset ── -->
|
|
<section class="rd-section rd-section--narrow">
|
|
<div style="display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:1rem;margin-bottom:1.5rem;">
|
|
<p style="text-align:center;font-size:0.875rem;color:#94a3b8;max-width:40rem;margin:0;">
|
|
This demo shows a <span style="color:#e2e8f0;font-weight:500">Trip Planning Notebook</span> scenario
|
|
with notes, a packing list, tags, and canvas sync — all powered by the
|
|
<span style="color:#e2e8f0;font-weight:500">r* ecosystem</span> with live data from
|
|
<span style="color:#e2e8f0;font-weight:500">rSpace</span>.
|
|
</p>
|
|
<button id="rd-reset-btn" class="rd-btn rd-btn--ghost" disabled>
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>
|
|
Reset Demo
|
|
</button>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- ── Notebook header card ── -->
|
|
<section class="rd-section rd-section--narrow">
|
|
<div class="rd-card" id="rd-notebook-header" style="margin-bottom:1.5rem;">
|
|
<div class="rd-card-header">
|
|
<div class="rd-card-title">
|
|
<span class="rd-icon" style="font-size:1.25rem;">📓</span>
|
|
<span id="rd-nb-title">Loading...</span>
|
|
<span id="rd-nb-count" class="rd-text-xs rd-text-muted" style="margin-left:0.5rem;"></span>
|
|
</div>
|
|
<a href="https://rnotes.online" target="_blank" rel="noopener noreferrer" class="rd-card-header rd-open-link">Open in rNotes</a>
|
|
</div>
|
|
<div class="rd-card-body" style="padding:0.75rem 1.25rem;">
|
|
<p id="rd-nb-desc" class="rd-text-sm rd-text-muted" style="margin:0;">Loading notebook data...</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ── Main layout: sidebar + content ── -->
|
|
<div style="display:grid;grid-template-columns:1fr;gap:1.5rem;" class="rd-notes-layout">
|
|
|
|
<!-- Sidebar -->
|
|
<div id="rd-sidebar">
|
|
<div class="rd-card" style="overflow:hidden;">
|
|
<!-- Sidebar header -->
|
|
<div style="padding:0.75rem 1rem;border-bottom:1px solid rgba(51,65,85,0.5);display:flex;align-items:center;justify-content:space-between;">
|
|
<span style="font-size:0.75rem;font-weight:600;color:#94a3b8;text-transform:uppercase;letter-spacing:0.05em;">Notebook</span>
|
|
<span id="rd-sb-note-count" style="font-size:0.75rem;color:#64748b;">0 notes</span>
|
|
</div>
|
|
<!-- Active notebook tree -->
|
|
<div style="padding:0.5rem;">
|
|
<div style="margin-bottom:0.25rem;">
|
|
<div style="display:flex;align-items:center;gap:0.5rem;padding:0.5rem 0.75rem;border-radius:0.5rem;font-size:0.875rem;background:rgba(245,158,11,0.1);color:#fcd34d;">
|
|
<span>📓</span>
|
|
<span id="rd-sb-nb-title" style="font-weight:500;">Loading...</span>
|
|
</div>
|
|
<div style="margin-left:1rem;margin-top:0.125rem;">
|
|
<div style="display:flex;align-items:center;justify-content:space-between;padding:0.375rem 0.75rem;border-radius:0.375rem;font-size:0.75rem;background:rgba(51,65,85,0.4);color:white;">
|
|
<span>Notes</span>
|
|
<span id="rd-sb-notes-num" style="color:#475569">0</span>
|
|
</div>
|
|
<div style="display:flex;align-items:center;justify-content:space-between;padding:0.375rem 0.75rem;border-radius:0.375rem;font-size:0.75rem;color:#64748b;margin-top:0.125rem;cursor:pointer;" onmouseover="this.style.background='rgba(51,65,85,0.2)';this.style.color='#cbd5e1'" onmouseout="this.style.background='';this.style.color='#64748b'">
|
|
<span>Packing List</span>
|
|
<span style="color:#475569">1</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Quick info links -->
|
|
<div style="padding:0.75rem 1rem;border-top:1px solid rgba(51,65,85,0.5);display:flex;flex-direction:column;gap:0.5rem;">
|
|
<div style="display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;color:#64748b;">
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
|
|
<span>Search notes...</span>
|
|
</div>
|
|
<div style="display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;color:#64748b;">
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/></svg>
|
|
<span>Browse tags</span>
|
|
</div>
|
|
<div style="display:flex;align-items:center;gap:0.5rem;font-size:0.75rem;color:#64748b;">
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
|
|
<span>Recent edits</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Notes + Packing list -->
|
|
<div>
|
|
<!-- Notes section -->
|
|
<div id="rd-notes-section">
|
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;">
|
|
<div style="display:flex;align-items:center;gap:0.5rem;">
|
|
<h2 style="font-size:0.875rem;font-weight:600;color:#cbd5e1;margin:0;">Notes</h2>
|
|
<span id="rd-notes-count" class="rd-text-xs rd-text-muted">0 notes</span>
|
|
</div>
|
|
<span class="rd-text-xs rd-text-muted">Sort: Recently edited</span>
|
|
</div>
|
|
|
|
<!-- Loading skeleton -->
|
|
<div id="rd-loading" style="display:flex;flex-direction:column;gap:1rem;">
|
|
${[1, 2, 3]
|
|
.map(
|
|
() => `
|
|
<div class="rd-card" style="padding:1rem;">
|
|
<div style="height:1rem;background:rgba(51,65,85,0.5);border-radius:0.25rem;width:66%;margin-bottom:0.75rem;animation:rd-skeleton-pulse 1.5s ease-in-out infinite;"></div>
|
|
<div style="height:0.75rem;background:rgba(51,65,85,0.3);border-radius:0.25rem;width:100%;margin-bottom:0.5rem;animation:rd-skeleton-pulse 1.5s ease-in-out infinite;"></div>
|
|
<div style="height:0.75rem;background:rgba(51,65,85,0.3);border-radius:0.25rem;width:80%;margin-bottom:0.75rem;animation:rd-skeleton-pulse 1.5s ease-in-out infinite;"></div>
|
|
<div style="display:flex;gap:0.5rem;">
|
|
<div style="height:1.25rem;background:rgba(51,65,85,0.3);border-radius:0.25rem;width:4rem;animation:rd-skeleton-pulse 1.5s ease-in-out infinite;"></div>
|
|
<div style="height:1.25rem;background:rgba(51,65,85,0.3);border-radius:0.25rem;width:5rem;animation:rd-skeleton-pulse 1.5s ease-in-out infinite;"></div>
|
|
</div>
|
|
</div>`,
|
|
)
|
|
.join("")}
|
|
</div>
|
|
<style>
|
|
@keyframes rd-skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
|
|
</style>
|
|
|
|
<!-- Note cards container (populated by notes-demo.ts) -->
|
|
<div id="rd-notes-container" style="display:flex;flex-direction:column;gap:1rem;"></div>
|
|
|
|
<!-- Empty state -->
|
|
<div id="rd-notes-empty" class="rd-card" style="display:none;padding:2rem;text-align:center;">
|
|
<p class="rd-text-muted rd-text-sm">No notes found. Try resetting the demo.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Packing list section -->
|
|
<div id="rd-packing-section" style="margin-top:1.5rem;display:none;">
|
|
<div style="display:flex;align-items:center;gap:0.5rem;margin-bottom:1rem;">
|
|
<h2 style="font-size:0.875rem;font-weight:600;color:#cbd5e1;margin:0;">Packing List</h2>
|
|
</div>
|
|
<div id="rd-packing-container"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- ── Features showcase ── -->
|
|
<section class="rd-section" style="margin-top:2rem;">
|
|
<h2 style="font-size:1.5rem;font-weight:700;color:white;text-align:center;margin-bottom:2rem;">Everything you need to capture knowledge</h2>
|
|
<div style="display:grid;grid-template-columns:repeat(2,1fr);gap:1rem;" class="rd-features-grid">
|
|
${[
|
|
{
|
|
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="23"/><line x1="8" y1="23" x2="16" y2="23"/></svg>`,
|
|
title: "Live Transcription",
|
|
desc: "Record and transcribe in real time. Stream audio via WebSocket or transcribe offline with Parakeet.js.",
|
|
},
|
|
{
|
|
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,
|
|
title: "Rich Editing",
|
|
desc: "Headings, lists, code blocks, highlights, images, and file attachments in every note.",
|
|
},
|
|
{
|
|
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/></svg>`,
|
|
title: "Notebooks",
|
|
desc: "Organize notes into notebooks with sections. Nest as deep as you need.",
|
|
},
|
|
{
|
|
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/></svg>`,
|
|
title: "Flexible Tags",
|
|
desc: "Cross-cutting tags let you find notes across all notebooks instantly.",
|
|
},
|
|
{
|
|
icon: `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>`,
|
|
title: "Canvas Sync",
|
|
desc: "Pin any note to your rSpace canvas for visual collaboration with your team.",
|
|
},
|
|
]
|
|
.map(
|
|
(f) => `
|
|
<div class="rd-card" style="padding:1.25rem;">
|
|
<div style="width:2.5rem;height:2.5rem;background:rgba(245,158,11,0.1);border-radius:0.5rem;display:flex;align-items:center;justify-content:center;margin-bottom:0.75rem;">
|
|
${f.icon}
|
|
</div>
|
|
<h3 style="font-size:0.875rem;font-weight:600;color:white;margin:0 0 0.25rem;">${f.title}</h3>
|
|
<p style="font-size:0.75rem;color:#94a3b8;margin:0;line-height:1.5;">${f.desc}</p>
|
|
</div>`,
|
|
)
|
|
.join("")}
|
|
</div>
|
|
</section>
|
|
|
|
<!-- ── CTA ── -->
|
|
<section class="rd-section rd-section--narrow">
|
|
<div class="rd-cta">
|
|
<h2>Ready to capture everything?</h2>
|
|
<p>
|
|
rNotes gives your team a shared knowledge base with rich editing, flexible organization,
|
|
and deep integration with the r* ecosystem — all on a collaborative canvas.
|
|
</p>
|
|
<a href="/create-space" style="background:linear-gradient(135deg,#f59e0b,#f97316);box-shadow:0 8px 24px rgba(245,158,11,0.25);">
|
|
Start Taking Notes
|
|
</a>
|
|
</div>
|
|
</section>
|
|
|
|
</div>
|
|
|
|
<style>
|
|
/* ── Notes-specific layout ── */
|
|
@media (min-width: 1024px) {
|
|
.rd-notes-layout {
|
|
grid-template-columns: 16rem 1fr !important;
|
|
}
|
|
}
|
|
@media (min-width: 640px) {
|
|
.rd-features-grid {
|
|
grid-template-columns: repeat(3, 1fr) !important;
|
|
}
|
|
}
|
|
@media (min-width: 1024px) {
|
|
.rd-features-grid {
|
|
grid-template-columns: repeat(5, 1fr) !important;
|
|
}
|
|
}
|
|
|
|
/* Note card styles */
|
|
.rd-note-card {
|
|
cursor: pointer;
|
|
transition: border-color 0.15s;
|
|
}
|
|
.rd-note-card:hover {
|
|
border-color: rgba(100,116,139,0.6);
|
|
}
|
|
.rd-note-card--expanded {
|
|
cursor: default;
|
|
border-color: rgba(245,158,11,0.3) !important;
|
|
box-shadow: 0 0 0 1px rgba(245,158,11,0.15);
|
|
}
|
|
|
|
/* Synced badge */
|
|
.rd-synced-badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.375rem;
|
|
font-size: 0.75rem;
|
|
padding: 0.25rem 0.625rem;
|
|
background: rgba(20,184,166,0.1);
|
|
border: 1px solid rgba(20,184,166,0.2);
|
|
color: #2dd4bf;
|
|
border-radius: 9999px;
|
|
white-space: nowrap;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* Markdown rendered content */
|
|
.rd-md h3 { font-size: 1.125rem; font-weight: 700; color: white; margin: 1rem 0 0.5rem; }
|
|
.rd-md h4 { font-size: 1rem; font-weight: 600; color: #e2e8f0; margin: 1rem 0 0.5rem; }
|
|
.rd-md h5 { font-size: 0.875rem; font-weight: 600; color: #cbd5e1; margin: 0.75rem 0 0.25rem; }
|
|
.rd-md p { font-size: 0.875rem; color: #cbd5e1; margin: 0.25rem 0; line-height: 1.6; }
|
|
.rd-md strong { color: white; font-weight: 500; }
|
|
.rd-md em { color: #cbd5e1; font-style: italic; }
|
|
.rd-md code {
|
|
color: #fcd34d;
|
|
background: rgba(30,41,59,1);
|
|
padding: 0.125rem 0.375rem;
|
|
border-radius: 0.25rem;
|
|
font-size: 0.75rem;
|
|
font-family: monospace;
|
|
}
|
|
.rd-md .rd-md-quote {
|
|
background: rgba(245,158,11,0.1);
|
|
border-left: 2px solid #f59e0b;
|
|
padding: 0.5rem 1rem;
|
|
border-radius: 0 0.5rem 0.5rem 0;
|
|
margin: 0.5rem 0;
|
|
}
|
|
.rd-md .rd-md-quote p { color: #fcd34d; }
|
|
.rd-md ul, .rd-md ol { margin: 0.5rem 0; padding: 0; list-style: none; }
|
|
.rd-md ul li, .rd-md ol li {
|
|
display: flex; align-items: flex-start; gap: 0.5rem;
|
|
font-size: 0.875rem; color: #cbd5e1; padding: 0.125rem 0;
|
|
}
|
|
.rd-md ul li::before { content: "\\2022"; color: #f59e0b; margin-top: 0.1rem; flex-shrink: 0; }
|
|
.rd-md ol li .rd-md-num { color: #f59e0b; font-weight: 500; min-width: 1.2em; text-align: right; flex-shrink: 0; }
|
|
.rd-md .rd-md-codeblock {
|
|
background: rgba(2,6,23,1);
|
|
border-radius: 0.5rem;
|
|
border: 1px solid rgba(51,65,85,0.5);
|
|
overflow: hidden;
|
|
margin: 0.5rem 0;
|
|
}
|
|
.rd-md .rd-md-codeblock-lang {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 0.5rem 1rem;
|
|
background: rgba(30,41,59,0.5);
|
|
border-bottom: 1px solid rgba(51,65,85,0.5);
|
|
font-size: 0.75rem; color: #94a3b8; font-family: monospace;
|
|
}
|
|
.rd-md .rd-md-codeblock pre {
|
|
padding: 0.75rem 1rem;
|
|
font-size: 0.75rem; color: #cbd5e1;
|
|
font-family: monospace;
|
|
overflow-x: auto;
|
|
line-height: 1.5;
|
|
margin: 0;
|
|
}
|
|
|
|
/* Tag pill */
|
|
.rd-note-tag {
|
|
display: inline-block;
|
|
font-size: 0.75rem;
|
|
padding: 0.125rem 0.5rem;
|
|
background: rgba(51,65,85,0.5);
|
|
color: #94a3b8;
|
|
border-radius: 0.375rem;
|
|
border: 1px solid rgba(51,65,85,0.3);
|
|
}
|
|
|
|
/* Packing list checkbox */
|
|
.rd-pack-check {
|
|
width: 1.25rem; height: 1.25rem; border-radius: 0.25rem; flex-shrink: 0;
|
|
border: 2px solid #475569;
|
|
display: flex; align-items: center; justify-content: center;
|
|
cursor: pointer; transition: all 0.15s;
|
|
}
|
|
.rd-pack-check--checked {
|
|
background: #f59e0b; border-color: #f59e0b;
|
|
}
|
|
.rd-pack-check:hover { border-color: #64748b; }
|
|
|
|
/* Packing item label */
|
|
.rd-pack-item {
|
|
display: flex; align-items: center; gap: 0.75rem;
|
|
padding: 0.5rem 0.75rem;
|
|
border-radius: 0.5rem;
|
|
cursor: pointer;
|
|
transition: background 0.1s;
|
|
}
|
|
.rd-pack-item:hover { background: rgba(51,65,85,0.3); }
|
|
</style>`;
|
|
}
|