Wall: drop the view countdown — a click marks the ad viewed and unlocks join

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-07 10:13:22 -05:00
parent 0c803c07cb
commit 2bfe019c16
2 changed files with 5 additions and 13 deletions
+4 -12
View File
@@ -64,18 +64,10 @@
const btn = document.createElement('button'); const btn = document.createElement('button');
btn.className = 'btn small'; btn.textContent = 'View this ad'; btn.className = 'btn small'; btn.textContent = 'View this ad';
btn.addEventListener('click', () => { btn.addEventListener('click', () => {
window.open(m.targetUrl, '_blank'); // real visit to the advertiser window.open(m.targetUrl, '_blank'); // real visit to the advertiser (no countdown)
let left = DWELL; viewed[i] = 1;
btn.disabled = true; try { localStorage.setItem(VKEY, JSON.stringify(viewed)); } catch (e) {}
act.innerHTML = '<span class="wc-timer">Viewing… ' + left + 's</span>'; done(); updateGate();
const t = setInterval(() => {
left--;
if (left > 0) { act.querySelector('.wc-timer').textContent = 'Viewing… ' + left + 's'; return; }
clearInterval(t);
viewed[i] = 1;
try { localStorage.setItem(VKEY, JSON.stringify(viewed)); } catch (e) {}
done(); updateGate();
}, 1000);
}); });
act.appendChild(btn); act.appendChild(btn);
} }
+1 -1
View File
@@ -40,6 +40,6 @@
</div> </div>
</section> </section>
<script src="/assets/common.js?v=20260908c"></script> <script src="/assets/common.js?v=20260908c"></script>
<script src="/assets/wall.js?v=20260907s"></script> <script src="/assets/wall.js?v=20260908d"></script>
</body> </body>
</html> </html>