Spaces:
Running
In this Quick post code, can you add a share button that once clicked on, comes up as a social image with link to respond
Browse files<div class="card" id="leftCol">
<div style="display:flex;justify-content:space-between;align-items:center"><strong>Quick Post</strong><span class="muted" style="font-size:12px"></span></div>
<div class="muted" style="margin-top:8px;font-size:13px">Share a customer service experience in under 2 minutes. Attach optional proof.</div>
<div style="margin-top:12px">
<input class="search" placeholder="Business name e.g. Konga" style="width:100%;padding:10px;border-radius:8px;border:1px solid var(--glass)" />
<textarea placeholder="Write your experience..." style="width:100%;height:120px;margin-top:8px;padding:10px;border-radius:8px;border:1px solid var(--glass)"></textarea>
<div style="display:flex;gap:8px;margin-top:8px;justify-content:space-between;align-items:center">
<div class="muted">Visibility: <span class="pill">Public</span></div>
<div style="display:flex;gap:8px"><button class="btn">Post Anonymously</button><button class="btn secondary">Attach proof</button></div>
</div>
</div>
- index.html +29 -3
|
@@ -126,8 +126,12 @@ Note: This is a visual, non-functional front-end mockup useful for pitching and
|
|
| 126 |
<textarea placeholder="Write your experience..." style="width:100%;height:120px;margin-top:8px;padding:10px;border-radius:8px;border:1px solid var(--glass)"></textarea>
|
| 127 |
<div style="display:flex;gap:8px;margin-top:8px;justify-content:space-between;align-items:center">
|
| 128 |
<div class="muted">Visibility: <span class="pill">Public</span></div>
|
| 129 |
-
<div style="display:flex;gap:8px">
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
</div>
|
| 132 |
|
| 133 |
<hr style="margin:12px 0;border:none;border-top:1px solid var(--glass)" />
|
|
@@ -335,10 +339,32 @@ Note: This is a visual, non-functional front-end mockup useful for pitching and
|
|
| 335 |
loginBtn.addEventListener('click',()=>loginModal.classList.add('show'));
|
| 336 |
closeModal.addEventListener('click',()=>loginModal.classList.remove('show'));
|
| 337 |
document.getElementById('mockLogin').addEventListener('click',()=>{alert('Account created (mock). You can now create ShoutLink.');loginModal.classList.remove('show');});
|
| 338 |
-
|
| 339 |
// Create link (mock)
|
| 340 |
document.getElementById('createLink').addEventListener('click',()=>{alert('ShoutLink created: behonest.me/'+(slugInput.value||'ayodele')+' (mock)');});
|
| 341 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
</script>
|
| 343 |
</body>
|
| 344 |
</html>
|
|
|
|
| 126 |
<textarea placeholder="Write your experience..." style="width:100%;height:120px;margin-top:8px;padding:10px;border-radius:8px;border:1px solid var(--glass)"></textarea>
|
| 127 |
<div style="display:flex;gap:8px;margin-top:8px;justify-content:space-between;align-items:center">
|
| 128 |
<div class="muted">Visibility: <span class="pill">Public</span></div>
|
| 129 |
+
<div style="display:flex;gap:8px">
|
| 130 |
+
<button class="btn">Post Anonymously</button>
|
| 131 |
+
<button class="btn secondary">Attach proof</button>
|
| 132 |
+
<button class="btn secondary" id="previewShareBtn">Preview Share</button>
|
| 133 |
+
</div>
|
| 134 |
+
</div>
|
| 135 |
</div>
|
| 136 |
|
| 137 |
<hr style="margin:12px 0;border:none;border-top:1px solid var(--glass)" />
|
|
|
|
| 339 |
loginBtn.addEventListener('click',()=>loginModal.classList.add('show'));
|
| 340 |
closeModal.addEventListener('click',()=>loginModal.classList.remove('show'));
|
| 341 |
document.getElementById('mockLogin').addEventListener('click',()=>{alert('Account created (mock). You can now create ShoutLink.');loginModal.classList.remove('show');});
|
|
|
|
| 342 |
// Create link (mock)
|
| 343 |
document.getElementById('createLink').addEventListener('click',()=>{alert('ShoutLink created: behonest.me/'+(slugInput.value||'ayodele')+' (mock)');});
|
| 344 |
|
| 345 |
+
// Preview share button
|
| 346 |
+
document.getElementById('previewShareBtn').addEventListener('click', () => {
|
| 347 |
+
const businessName = document.querySelector('#leftCol .search').value || 'Business';
|
| 348 |
+
const experience = document.querySelector('#leftCol textarea').value || 'Experience shared on Be Honest';
|
| 349 |
+
const shareCard = document.createElement('div');
|
| 350 |
+
shareCard.className = 'share-card';
|
| 351 |
+
shareCard.style.margin = '20px auto';
|
| 352 |
+
shareCard.style.maxWidth = '500px';
|
| 353 |
+
shareCard.innerHTML = `
|
| 354 |
+
<div style="padding:24px;border-radius:14px;text-align:center;background:var(--fun-grad);color:white;font-weight:800;font-size:20px">
|
| 355 |
+
"${experience}" — Shared about ${businessName} on Be Honest
|
| 356 |
+
<div style="margin-top:12px;font-size:14px;font-weight:normal">behonest.me/respond/${Math.random().toString(36).substring(2,8)}</div>
|
| 357 |
+
</div>
|
| 358 |
+
<div style="display:flex;gap:8px;margin-top:12px;justify-content:center">
|
| 359 |
+
<button class="btn">Copy Link</button>
|
| 360 |
+
<button class="btn secondary">Download Image</button>
|
| 361 |
+
</div>
|
| 362 |
+
`;
|
| 363 |
+
alert('Share preview generated (mock)');
|
| 364 |
+
shareCard.style.display = 'block';
|
| 365 |
+
document.querySelector('#leftCol').appendChild(shareCard);
|
| 366 |
+
});
|
| 367 |
+
|
| 368 |
</script>
|
| 369 |
</body>
|
| 370 |
</html>
|