-
+
+
<iframe src="..."></iframe>
- Copy embed
+ Copy embed
Copied
- Tip: iOS/Safari requires a tap before audio can start. Add allow="autoplay" and expect a user gesture.
+ Note: This is not live yet. We’ll ship a dedicated /embed widget + style presets next.
diff --git a/src/main.ts b/src/main.ts
index 787397d..bdd21f5 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -134,7 +134,7 @@ class MotifApp {
this.nextResultBtn.addEventListener('click', () => this.handleNextResult());
- // Embed snippet copy
+ // Embed snippet copy (may be disabled / not-live)
this.copyEmbedBtn?.addEventListener('click', () => void this.copyEmbedSnippet());
}
@@ -396,8 +396,9 @@ class MotifApp {
private updateEmbedSnippet(songTitle: string): void {
if (!this.embedSection || !this.embedCodeEl) return;
- const origin = window.location.origin;
- const url = `${origin}/embed?song=${encodeURIComponent(songTitle)}`;
+ const notLive = this.embedSection.getAttribute('data-not-live') === 'true';
+ const base = notLive ? 'https://YOUR_DOMAIN' : window.location.origin;
+ const url = `${base}/embed?song=${encodeURIComponent(songTitle)}`;
const snippet = `
`;
@@ -408,6 +409,10 @@ class MotifApp {
private async copyEmbedSnippet(): Promise
{
if (!this.embedCodeEl) return;
+ if (this.embedSection?.getAttribute('data-not-live') === 'true') {
+ this.updateStatus('Embed is coming soon.');
+ return;
+ }
const text = this.embedCodeEl.textContent || '';
if (!text.trim()) return;