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');
|
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
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user