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:
+4
-12
@@ -64,18 +64,10 @@
|
||||
const btn = document.createElement('button');
|
||||
btn.className = 'btn small'; btn.textContent = 'View this ad';
|
||||
btn.addEventListener('click', () => {
|
||||
window.open(m.targetUrl, '_blank'); // real visit to the advertiser
|
||||
let left = DWELL;
|
||||
btn.disabled = true;
|
||||
act.innerHTML = '<span class="wc-timer">Viewing… ' + left + 's</span>';
|
||||
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);
|
||||
window.open(m.targetUrl, '_blank'); // real visit to the advertiser (no countdown)
|
||||
viewed[i] = 1;
|
||||
try { localStorage.setItem(VKEY, JSON.stringify(viewed)); } catch (e) {}
|
||||
done(); updateGate();
|
||||
});
|
||||
act.appendChild(btn);
|
||||
}
|
||||
|
||||
+1
-1
@@ -40,6 +40,6 @@
|
||||
</div>
|
||||
</section>
|
||||
<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>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user