diff --git a/activity/room-reward/index.html b/activity/room-reward/index.html index 3e27a39..daa54db 100644 --- a/activity/room-reward/index.html +++ b/activity/room-reward/index.html @@ -74,19 +74,7 @@ aria-label="Room reward tiers" data-i18n-aria="roomReward.tiersLabel" > - + ', '
', @@ -65,7 +75,7 @@ '
', ]; - (data.tiers || []).forEach(function (item) { + tiers.forEach(function (item) { rows.push( [ '
', @@ -84,11 +94,42 @@ }); table.innerHTML = rows.join(''); + syncDynamicTableLayout(tiers.length + 1); if (window.HyAppI18n && window.HyAppI18n.apply) { window.HyAppI18n.apply(table); } } + function syncDynamicTableLayout(rowCount) { + var safeRowCount = Math.max(Number(rowCount) || 1, 1); + var rowHeight = 103; + var tableInsetY = 15; + var bottomBorderHeight = 119; + var tableTop = 1241; + var stageBottomPadding = 66; + var visualScale = 375 / 1080; + var innerHeight = safeRowCount * rowHeight; + var tableHeight = innerHeight + tableInsetY * 2; + var stageHeight = tableTop + tableHeight + stageBottomPadding; + var wrapHeight = Math.ceil(stageHeight * visualScale); + + if (rewardTable) rewardTable.style.height = tableHeight + 'px'; + if (tableFill) tableFill.style.height = innerHeight + 'px'; + if (table) table.style.height = innerHeight + 'px'; + if (tableSideBorder) tableSideBorder.style.height = tableHeight + 'px'; + if (tableBottomBorder) { + tableBottomBorder.style.top = + Math.max(tableHeight - bottomBorderHeight, 0) + 'px'; + } + if (tableDivider) tableDivider.style.height = innerHeight + 'px'; + if (stage) stage.style.height = stageHeight + 'px'; + if (stageWrap) stageWrap.style.height = wrapHeight + 'px'; + if (page) page.style.minHeight = wrapHeight + 'px'; + if (viewport) viewport.style.minHeight = wrapHeight + 'px'; + + updateBodyHeight(); + } + function renderUser(data) { data = data || mockData; document.getElementById('targetReward').textContent = data.targetReward; diff --git a/activity/room-reward/style.css b/activity/room-reward/style.css index 59c8dee..902c7e1 100644 --- a/activity/room-reward/style.css +++ b/activity/room-reward/style.css @@ -245,7 +245,7 @@ button { .table-border-bottom { left: 0; - top: 1045px; + top: 1044px; width: 1008px; height: 119px; }