diff --git a/blog.js b/blog.js index 12941b7..1fed133 100644 --- a/blog.js +++ b/blog.js @@ -152,7 +152,7 @@ function rss(posts) { return 'InstantAdPay blog' + SITE + '/blogCoaching and teaching articles from Marty Bostick.' + items + ''; } function sitemap(posts) { - const pages = ['/', '/blog', '/whats-new', '/leaderboard', '/ledger', '/contract', '/plays', '/wallets', '/earning', '/partners']; + const pages = ['/', '/blog', '/whats-new', '/leaderboard', '/ledger', '/contract', '/plays', '/wallets', '/earning', '/partners', '/friday']; const u = pages.map(p => '' + SITE + p + 'weekly').join('') + posts.map(p => '' + SITE + '/blog/' + p.slug + '' + new Date(p.updated).toISOString().slice(0, 10) + 'monthly').join(''); return '' + u + ''; diff --git a/public/assets/friday.js b/public/assets/friday.js new file mode 100644 index 0000000..e205a3f --- /dev/null +++ b/public/assets/friday.js @@ -0,0 +1,37 @@ +/* /friday status strip (Marty, 2026-09-25). External file on purpose: the site's CSP blocks + inline scripts, which is how the first deploy shipped a strip stuck on "Checking". */ +(function () { + var el = document.getElementById('frState'); + if (!el) return; + function n(x) { return Number(x || 0).toLocaleString('en-US'); } + // the minute (Central) when the next Friday starts, found by scanning rather than assumed, + // so a daylight-saving change cannot put the countdown an hour out + function startsAt(dayKey) { + var now = Date.now(); + for (var m = 0; m < 8 * 1440; m++) { + var t = now + m * 60000; + var d = new Date(t).toLocaleDateString('en-CA', { timeZone: 'America/Chicago' }); + if (d === dayKey) return t; + } + return null; + } + function render(f) { + if (!f || !f.on) { el.innerHTML = 'PausedFive Dollar Friday is not running right now. Join free and you will hear when it is back.'; return; } + if (f.live) { + var t = f.today || {}; + el.className = 'fr-state live'; + el.innerHTML = 'Live nowIt is Five Dollar Friday. Bonus runs until midnight Central.' + + '' + n(t.packs) + ' pack' + (t.packs === 1 ? '' : 's') + ' so far today' + + '' + n(t.bonusCredits) + ' bonus credits issued'; + return; + } + var at = f.nextFriday ? startsAt(f.nextFriday) : null; + var left = at ? Math.max(0, at - Date.now()) : 0; + var hrs = Math.floor(left / 3600000), mins = Math.floor((left % 3600000) / 60000), days = Math.floor(hrs / 24); + var when = at ? (days >= 1 ? days + ' day' + (days === 1 ? '' : 's') + ' ' + (hrs % 24) + 'h' : hrs + 'h ' + mins + 'm') : ''; + el.className = 'fr-state'; + el.innerHTML = 'NextNext Five Dollar Friday: ' + (f.nextLabel || f.nextFriday || 'soon') + '. Starts at midnight Central' + (when ? ', in ' + when : '') + '.' + + 'Join now so your account is ready before it starts.'; + } + fetch('/api/friday').then(function (r) { return r.ok ? r.json() : null; }).catch(function () { return null; }).then(render); +})(); diff --git a/public/friday.html b/public/friday.html index 708a0b5..42e8c1c 100644 --- a/public/friday.html +++ b/public/friday.html @@ -69,42 +69,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- +