Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(discovery): self-contained stylesheet so badges and cards render on pages without style.css

nirholasd155521c8556
diff --git a/public/feature-discovery.css b/public/feature-discovery.css
new file mode 100644
index 000000000..77f4c0402
--- /dev/null
+++ b/public/feature-discovery.css
@@ -0,0 +1,127 @@
+/* Feature-discovery layer (public/feature-discovery.js) — badges + cards.
+ *
+ * Not every page loads style.css (home, create, launches… carry their own
+ * inline design systems), so the discovery layer loads this file itself. The
+ * <link> is PREPENDED to <head>, so style.css — which carries an identical
+ * copy of these rules — and page stylesheets always win the cascade. The
+ * var() fallbacks render correctly on pages that define none of the tokens.
+ */
+
+.tws-disc-new {
+ display: inline-block;
+ margin-left: 6px;
+ padding: 1px 6px;
+ font-size: 10px;
+ font-weight: 600;
+ line-height: 1.5;
+ letter-spacing: 0.02em;
+ text-transform: uppercase;
+ vertical-align: middle;
+ color: var(--ink, var(--text, #e8e8e8));
+ background: var(--surface-3, rgba(255, 255, 255, 0.08));
+ border: 1px solid var(--stroke-strong, rgba(255, 255, 255, 0.14));
+ border-radius: var(--radius-pill, 999px);
+}
+
+.tws-disc-card {
+ position: fixed;
+ right: 18px;
+ bottom: 18px;
+ z-index: 10001;
+ width: min(320px, calc(100vw - 36px));
+ padding: 16px 16px 14px;
+ background: var(--surface-glass, linear-gradient(180deg, rgba(20, 21, 28, 0.92), rgba(14, 15, 22, 0.9)));
+ -webkit-backdrop-filter: blur(14px);
+ backdrop-filter: blur(14px);
+ border: 1px solid var(--stroke-strong, rgba(255, 255, 255, 0.14));
+ border-radius: var(--radius-card, 14px);
+ box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
+ color: var(--ink, var(--text, #e8e8e8));
+ opacity: 0;
+ transform: translateY(12px) scale(0.98);
+ transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
+}
+.tws-disc-card.is-in {
+ opacity: 1;
+ transform: translateY(0) scale(1);
+}
+
+.tws-disc-x {
+ position: absolute;
+ top: 8px;
+ right: 8px;
+ width: 26px;
+ height: 26px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 13px;
+ line-height: 1;
+ color: var(--ink-dim, #888);
+ background: transparent;
+ border: 1px solid transparent;
+ border-radius: var(--radius-pill, 999px);
+ cursor: pointer;
+ transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
+}
+.tws-disc-x:hover { color: var(--ink, var(--text, #e8e8e8)); background: var(--surface-2, rgba(255, 255, 255, 0.05)); }
+.tws-disc-x:active { background: var(--surface-3, rgba(255, 255, 255, 0.08)); }
+.tws-disc-x:focus-visible { outline: 2px solid var(--accent, #fff); outline-offset: 2px; }
+
+.tws-disc-kicker {
+ font-size: 11px;
+ font-weight: 600;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ color: var(--ink-dim, #888);
+ padding-right: 26px;
+}
+.tws-disc-title {
+ margin-top: 4px;
+ font-size: 16px;
+ font-weight: 650;
+ color: var(--ink, var(--text, #e8e8e8));
+}
+.tws-disc-desc {
+ margin-top: 5px;
+ font-size: 13px;
+ line-height: 1.45;
+ color: var(--ink-dim, #aaa);
+}
+.tws-disc-actions {
+ margin-top: 12px;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px;
+}
+.tws-disc-cta {
+ display: inline-flex;
+ align-items: center;
+ padding: 7px 13px;
+ font-size: 13px;
+ font-weight: 600;
+ text-decoration: none;
+ color: var(--ink, var(--text, #e8e8e8));
+ background: var(--surface-2, rgba(255, 255, 255, 0.05));
+ border: 1px solid var(--stroke-strong, rgba(255, 255, 255, 0.14));
+ border-radius: var(--radius-control, 10px);
+ transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
+}
+.tws-disc-cta:hover { background: var(--surface-3, rgba(255, 255, 255, 0.08)); border-color: var(--stroke-strong, rgba(255, 255, 255, 0.2)); }
+.tws-disc-cta:active { transform: translateY(1px); }
+.tws-disc-cta:focus-visible { outline: 2px solid var(--accent, #fff); outline-offset: 2px; }
+.tws-disc-cta--primary {
+ color: #0c0c0c;
+ background: var(--accent, #fff);
+ border-color: var(--accent, #fff);
+}
+.tws-disc-cta--primary:hover { background: #f0f0f0; border-color: #f0f0f0; }
+
+@media (max-width: 520px) {
+ .tws-disc-card { right: 12px; left: 12px; bottom: 12px; width: auto; }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .tws-disc-card { transition: opacity 0.001s linear; transform: none; }
+ .tws-disc-card.is-in { transform: none; }
+}
diff --git a/public/feature-discovery.js b/public/feature-discovery.js
index cc8b53ceb..9cf4df1da 100644
--- a/public/feature-discovery.js
+++ b/public/feature-discovery.js
@@ -167,25 +167,20 @@
// ── "New" badges on in-page links to new features ──────────────────────────
// Not every page loads style.css (home, create, launches… carry their own
- // inline design systems), so the badge ships its own fallback rule. It is
- // PREPENDED to <head> so any page stylesheet still wins the cascade.
- function ensureBadgeStyle() {
- if (document.getElementById('tws-disc-new-css')) return;
- var s = document.createElement('style');
- s.id = 'tws-disc-new-css';
- s.textContent =
- '.tws-disc-new{display:inline-block;margin-left:6px;padding:1px 6px;' +
- 'font-size:10px;font-weight:600;line-height:1.5;letter-spacing:0.02em;' +
- 'text-transform:uppercase;vertical-align:middle;' +
- 'color:var(--ink,var(--text,#e8e8e8));' +
- 'background:var(--surface-3,rgba(255,255,255,0.08));' +
- 'border:1px solid var(--stroke-strong,rgba(255,255,255,0.14));' +
- 'border-radius:var(--radius-pill,999px);}';
- document.head.insertBefore(s, document.head.firstChild);
+ // inline design systems), so this layer loads its own stylesheet for the
+ // badge + card. The <link> is PREPENDED to <head> so style.css — which
+ // carries an identical copy of these rules — and page styles win the cascade.
+ function ensureStyles() {
+ if (document.getElementById('tws-disc-css')) return;
+ var l = document.createElement('link');
+ l.id = 'tws-disc-css';
+ l.rel = 'stylesheet';
+ l.href = '/feature-discovery.css';
+ document.head.insertBefore(l, document.head.firstChild);
}
function decorateNewBadges(newSet) {
- ensureBadgeStyle();
+ ensureStyles();
var visited = visitedSet();
var anchors = document.querySelectorAll('a[href]');
for (var i = 0; i < anchors.length; i++) {
@@ -245,6 +240,7 @@
// spec: { kicker, title, desc, links:[{href,label,primary}], onDismiss }
function renderCard(spec) {
+ ensureStyles();
dismissCard();
var card = el('aside', 'tws-disc-card');
card.setAttribute('role', 'status');