From ce3725ae37b6b1b70f1d91a5d4ab094ef722af6a Mon Sep 17 00:00:00 2001 From: zhx Date: Tue, 16 Jun 2026 16:59:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=85=E5=80=BC=EF=BC=8C=E6=96=B0=E5=85=AC?= =?UTF-8?q?=E4=BC=9A=E5=BC=80=E4=B8=9A=E6=B4=BB=E5=8A=A8=EF=BC=8CCP?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- activity/agency-opening/index.html | 4 +- activity/agency-opening/script.js | 23 ++- activity/agency-opening/style.css | 51 ++--- activity/cp/index.html | 113 +++++++++-- activity/cp/script.js | 251 ++++++++++++++++++++---- activity/cp/style.css | 46 +++-- common/api.js | 10 + common/locales/ar.json | 1 + common/locales/en.json | 1 + common/locales/es.json | 1 + common/locales/id.json | 1 + common/locales/tr.json | 1 + common/locales/zh.json | 1 + recharge/index.html | 303 +++++++++++++++++++++++++---- 14 files changed, 639 insertions(+), 168 deletions(-) diff --git a/activity/agency-opening/index.html b/activity/agency-opening/index.html index dee2139..96de93c 100644 --- a/activity/agency-opening/index.html +++ b/activity/agency-opening/index.html @@ -7,7 +7,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" /> New Agency Opening Event - +
@@ -366,6 +366,6 @@ - + diff --git a/activity/agency-opening/script.js b/activity/agency-opening/script.js index 0363261..6250507 100644 --- a/activity/agency-opening/script.js +++ b/activity/agency-opening/script.js @@ -250,7 +250,13 @@ .map(function (item) { var revenue = firstValue( item, - ['opening_revenue', 'openingRevenue', 'revenue'], + [ + 'opening_revenue', + 'openingRevenue', + 'threshold_coin_spent', + 'thresholdCoinSpent', + 'revenue', + ], '500K' ); var reward = firstValue( @@ -261,7 +267,7 @@ return [ '
', '', - escapeHTML(revenue), + escapeHTML(formatCoinLabel(revenue)), '', '', escapeHTML(reward), @@ -290,9 +296,8 @@ state.qualification.identity; document.getElementById('hostCountText').textContent = state.qualification.hostCount + - ' / ' + - state.qualification.hostRequirement + - '+'; + ' / > ' + + state.qualification.hostRequirement; document.getElementById('openingStatusText').textContent = state.qualification.openingStatus; document.getElementById('eligibilityText').textContent = state @@ -419,6 +424,14 @@ .replace(/'/g, '''); } + function formatCoinLabel(value) { + var amount = Number(value); + if (!Number.isFinite(amount) || amount <= 0) return value; + if (amount % 1000000 === 0) return amount / 1000000 + 'M'; + if (amount % 1000 === 0) return amount / 1000 + 'K'; + return String(amount); + } + function init() { document.title = t( 'agencyOpening.pageTitle', diff --git a/activity/agency-opening/style.css b/activity/agency-opening/style.css index 82c16f4..2e59d9c 100644 --- a/activity/agency-opening/style.css +++ b/activity/agency-opening/style.css @@ -130,8 +130,8 @@ button:focus-visible { left: 18px; top: 46px; display: grid; - grid-template-columns: 221px repeat(5, 141px); - gap: 0; + grid-template-columns: repeat(6, minmax(0, 1fr)); + gap: 6px; align-items: center; width: 1026px; height: 70px; @@ -141,7 +141,13 @@ button:focus-visible { .language-tab { position: relative; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + width: 100%; height: 57px; + padding: 0 10px; border: 2px solid #fde5cc; border-radius: 39px; background: linear-gradient(180deg, #4d145a, #210a34); @@ -153,47 +159,14 @@ button:focus-visible { text-shadow: 0 1px 7px rgba(87, 16, 110, 0.82); } -.language-tab:first-child { - width: 221px; - height: 65px; - border: 0; - border-radius: 0; - background: transparent; - isolation: isolate; -} - .language-tab span { position: relative; - z-index: 2; -} - -.language-tab:first-child::before, -.language-tab:first-child::after { - position: absolute; - content: ''; - inset: 0 auto auto 0; - width: 221px; - height: 65px; - background-image: url('./assets/lang-sheen.png'); - background-size: 221px 65px; - background-repeat: no-repeat; z-index: 1; - -webkit-mask: url('./assets/lang-mask-left.svg') 0 0 / 100px 65px no-repeat; - mask: url('./assets/lang-mask-left.svg') 0 0 / 100px 65px no-repeat; -} - -.language-tab:first-child::after { - transform: rotate(180deg) scaleY(-1); - -webkit-mask: url('./assets/lang-mask-right.svg') 121px 0 / 100px 65px - no-repeat; - mask: url('./assets/lang-mask-right.svg') 121px 0 / 100px 65px no-repeat; } .language-tab.is-active { + background: linear-gradient(180deg, #6b2a72, #2b0c46); color: #fff8e4; -} - -.language-tab:not(:first-child).is-active { box-shadow: inset 0 0 18px rgba(255, 222, 151, 0.2), 0 0 14px rgba(255, 203, 116, 0.22); @@ -618,14 +591,14 @@ button:focus-visible { .rules-list { position: absolute; left: 119px; - top: 306px; + top: 258px; width: 842px; margin: 0; padding: 0 0 0 48px; color: var(--gold); - font-size: 32px; + font-size: 30px; font-weight: 500; - line-height: 52px; + line-height: 48px; text-transform: capitalize; z-index: 3; } diff --git a/activity/cp/index.html b/activity/cp/index.html index 5f21eb1..6d36601 100644 --- a/activity/cp/index.html +++ b/activity/cp/index.html @@ -31,52 +31,116 @@ > EN - - + -
+
- + 02 D
- + 02 H
- + 02 M
- + 02 S
- @@ -94,9 +158,15 @@ (function () { try { var params = new URLSearchParams(window.location.search); - if (!params.get('lang') && !window.localStorage.getItem('cp_activity_lang_ready')) { + if ( + !params.get('lang') && + !window.localStorage.getItem('cp_activity_lang_ready') + ) { window.localStorage.setItem('hyapp_h5_lang', 'en'); - window.localStorage.setItem('cp_activity_lang_ready', '1'); + window.localStorage.setItem( + 'cp_activity_lang_ready', + '1' + ); } } catch (error) { document.documentElement.lang = 'en'; @@ -104,6 +174,7 @@ })(); + diff --git a/activity/cp/script.js b/activity/cp/script.js index 8615733..eaa4706 100644 --- a/activity/cp/script.js +++ b/activity/cp/script.js @@ -10,6 +10,11 @@ var activeTab = 'plaza'; var countdownEndAt = 0; var countdownTimer = 0; + var activityData = { + rank: null, + rewards: null, + periodEndMS: 0, + }; var viewport = document.getElementById('appViewport'); var page = document.getElementById('page'); @@ -25,9 +30,24 @@ previousRows: buildRows('score', 4), }, rank: [ - { place: 1, score: '1,234,567', leftName: 'Namename', rightName: 'Namename' }, - { place: 2, score: '987,654', leftName: 'Namename', rightName: 'Namename' }, - { place: 3, score: '876,543', leftName: 'Namename', rightName: 'Namename' }, + { + place: 1, + score: '1,234,567', + leftName: 'Namename', + rightName: 'Namename', + }, + { + place: 2, + score: '987,654', + leftName: 'Namename', + rightName: 'Namename', + }, + { + place: 3, + score: '876,543', + leftName: 'Namename', + rightName: 'Namename', + }, ], rewards: [ { @@ -98,17 +118,31 @@ function resolveFallbackEndAt() { var params = new URLSearchParams(window.location.search || ''); - var explicitEnd = Date.parse(params.get('end_at') || params.get('endAt') || ''); - if (Number.isFinite(explicitEnd) && explicitEnd > Date.now()) return explicitEnd; + var explicitEnd = Date.parse( + params.get('end_at') || params.get('endAt') || '' + ); + if (Number.isFinite(explicitEnd) && explicitEnd > Date.now()) + return explicitEnd; try { var cached = Number(window.localStorage.getItem(STORAGE_KEY)); if (Number.isFinite(cached) && cached > Date.now()) return cached; - var fallback = Date.now() + 2 * 86400 * 1000 + 2 * 3600 * 1000 + 2 * 60 * 1000 + 2 * 1000; + var fallback = + Date.now() + + 2 * 86400 * 1000 + + 2 * 3600 * 1000 + + 2 * 60 * 1000 + + 2 * 1000; window.localStorage.setItem(STORAGE_KEY, String(fallback)); return fallback; } catch (error) { - return Date.now() + 2 * 86400 * 1000 + 2 * 3600 * 1000 + 2 * 60 * 1000 + 2 * 1000; + return ( + Date.now() + + 2 * 86400 * 1000 + + 2 * 3600 * 1000 + + 2 * 60 * 1000 + + 2 * 1000 + ); } } @@ -126,9 +160,11 @@ function updateCountdown() { var parts = getTimeParts(); Object.keys(parts).forEach(function (key) { - document.querySelectorAll('[data-count="' + key + '"]').forEach(function (node) { - node.textContent = twoDigits(parts[key]); - }); + document + .querySelectorAll('[data-count="' + key + '"]') + .forEach(function (node) { + node.textContent = twoDigits(parts[key]); + }); }); } @@ -152,23 +188,28 @@ } function renderCPRow(row) { - var center = row.type === 'score' - ? [ - '', - '', - escapeHTML(row.score), - '', - ].join('') - : [ - '
', - '', - '
', - ].join(''); + var center = + row.type === 'score' + ? [ + '', + '', + escapeHTML(row.score), + '', + ].join('') + : [ + '
', + '', + '
', + ].join(''); return [ '
', - '
', - '
', + '
', + '
', '', escapeHTML(row.leftName), '', @@ -185,10 +226,16 @@ function renderPlaza() { var firstBody = [ '

', - t('cp.plazaGiftTitle', 'Gifts exchanged between CPs ≥ 5000 gold will be displayed here'), + t( + 'cp.plazaGiftTitle', + 'Gifts exchanged between CPs ≥ 5000 gold will be displayed here' + ), '

', '

', - t('cp.plazaGiftSubtitle', '(Display the last 10 records, sorted in ascending order.)'), + t( + 'cp.plazaGiftSubtitle', + '(Display the last 10 records, sorted in ascending order.)' + ), '

', '
', mockData.plaza.exchangeRows.map(renderCPRow).join(''), @@ -199,7 +246,10 @@ t('cp.previousNo1Title', 'The previous number one position'), '', '

', - t('cp.plazaGiftSubtitle', '(Display the last 10 records, sorted in ascending order.)'), + t( + 'cp.plazaGiftSubtitle', + '(Display the last 10 records, sorted in ascending order.)' + ), '

', '
', mockData.plaza.previousRows.map(renderCPRow).join(''), @@ -241,7 +291,12 @@ } function renderPodiumCard(item) { - var crown = item.place === 1 ? 'rank-crown-gold.png' : item.place === 2 ? 'rank-crown-silver.png' : 'crown-bronze.png'; + var crown = + item.place === 1 + ? 'rank-crown-gold.png' + : item.place === 2 + ? 'rank-crown-silver.png' + : 'crown-bronze.png'; return [ '