Skip to content

Commit 9fec8a8

Browse files
Refactor goal progress display and enhance mobile layout with new styles
1 parent 2adf631 commit 9fec8a8

4 files changed

Lines changed: 64 additions & 19 deletions

File tree

src/app/gameRenderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export function createGameRenderer({
166166
function initMobileNav(): void {
167167
const handleNavInteraction = (event: Event): void => {
168168
const target = event.target;
169-
if (!(target instanceof HTMLElement)) {
169+
if (!(target instanceof Element)) {
170170
return;
171171
}
172172
const button = target.closest<HTMLButtonElement>(
@@ -190,7 +190,7 @@ export function createGameRenderer({
190190

191191
elements.mobileNav.addEventListener("pointerdown", (event) => {
192192
const target = event.target;
193-
if (!(target instanceof HTMLElement)) {
193+
if (!(target instanceof Element)) {
194194
return;
195195
}
196196
if (!target.closest("button[data-screen-id]")) {

src/app/managementPanelsController.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ interface ManagementPanelsOptions {
7878
prestigeUpgradeList: HTMLElement;
7979
goalTarget: HTMLElement;
8080
goalProgress: HTMLElement;
81+
goalProgressFill: HTMLElement;
8182
goalReward: HTMLElement;
8283
prestigeReset: HTMLButtonElement;
8384
};
@@ -667,7 +668,8 @@ export function createManagementPanelsController({
667668
? `Release Version ${releaseVersion}.0 (+${gain} Reputation)`
668669
: `Release Version ${releaseVersion}.0 (Not Ready)`;
669670
elements.prestigeReset.disabled = gain <= 0;
670-
elements.goalProgress.textContent = `Progress: ${(goalProgress * 100).toFixed(1)}% (${Math.floor(state.lifetimeLoc).toLocaleString()} / ${releaseLocTarget.toLocaleString()} LOC)`;
671+
elements.goalProgressFill.style.width = `${(goalProgress * 100).toFixed(1)}%`;
672+
elements.goalProgress.textContent = `${Math.floor(state.lifetimeLoc).toLocaleString()} / ${releaseLocTarget.toLocaleString()} LOC (${(goalProgress * 100).toFixed(1)}%)`;
671673
elements.goalReward.textContent = `Reputation on release v${releaseVersion}.0: +${gain}`;
672674

673675
prestigeRows.forEach((row, upgradeId) => {

src/app/shell.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ export interface ShellElements {
2424
eventList: HTMLElement;
2525
prestigeReset: HTMLButtonElement;
2626
restart: HTMLButtonElement;
27-
goalProgress: HTMLElement;
2827
goalTarget: HTMLElement;
28+
goalProgress: HTMLElement;
29+
goalProgressFill: HTMLElement;
2930
goalReward: HTMLElement;
3031
prestigeUpgradeList: HTMLElement;
3132
tradeoffModes: HTMLElement;
@@ -165,7 +166,10 @@ export function mountGameShell(appRoot: Element): {
165166
<section class="goal-panel">
166167
<h2>Release Goal</h2>
167168
<p class="status-line" data-ui="release-goal-target">Release Version 1.0 at 0 lifetime LOC.</p>
168-
<p class="status-line" data-ui="release-goal-progress">Progress: 0%</p>
169+
<div class="goal-progress" aria-hidden="true">
170+
<span data-ui="release-goal-progress-fill"></span>
171+
</div>
172+
<p class="status-line" data-ui="release-goal-progress">0 / 0 LOC</p>
169173
<p class="status-line" data-ui="release-goal-reward">Reputation on release: +0</p>
170174
<div class="prestige-actions">
171175
<button data-ui="prestige-reset-btn">Release Version 1.0 (Reset for Reputation)</button>
@@ -311,8 +315,12 @@ export function mountGameShell(appRoot: Element): {
311315
eventList: mustQuery(appRoot, '[data-ui="event-list"]'),
312316
prestigeReset: mustQuery(appRoot, '[data-ui="prestige-reset-btn"]'),
313317
restart: mustQuery(appRoot, '[data-ui="restart-btn"]'),
314-
goalProgress: mustQuery(appRoot, '[data-ui="release-goal-progress"]'),
315318
goalTarget: mustQuery(appRoot, '[data-ui="release-goal-target"]'),
319+
goalProgress: mustQuery(appRoot, '[data-ui="release-goal-progress"]'),
320+
goalProgressFill: mustQuery(
321+
appRoot,
322+
'[data-ui="release-goal-progress-fill"]',
323+
),
316324
goalReward: mustQuery(appRoot, '[data-ui="release-goal-reward"]'),
317325
prestigeUpgradeList: mustQuery(
318326
appRoot,

src/lib/css/styles.css

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,29 @@ input {
12171217
white-space: normal;
12181218
}
12191219

1220+
.goal-progress {
1221+
position: relative;
1222+
height: 10px;
1223+
margin: 6px 0 5px;
1224+
overflow: hidden;
1225+
border: 1px solid rgba(142, 255, 100, 0.32);
1226+
border-radius: 999px;
1227+
background: rgba(8, 20, 39, 0.72);
1228+
box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.28);
1229+
}
1230+
1231+
.goal-progress > span {
1232+
display: block;
1233+
height: 100%;
1234+
width: 0;
1235+
border-radius: inherit;
1236+
background: linear-gradient(90deg, #43e0ff, #8eff64);
1237+
box-shadow:
1238+
0 0 10px rgba(67, 224, 255, 0.34),
1239+
0 0 14px rgba(142, 255, 100, 0.22);
1240+
transition: width 0.22s ease;
1241+
}
1242+
12201243
.strategic-debt {
12211244
border: 1px solid rgba(255, 211, 107, 0.45);
12221245
border-radius: 9px;
@@ -1386,7 +1409,6 @@ input {
13861409
.game-shell {
13871410
height: 100%;
13881411
min-height: 0;
1389-
padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
13901412
}
13911413

13921414
.dashboard {
@@ -1396,6 +1418,8 @@ input {
13961418
height: 100%;
13971419
overflow-x: hidden;
13981420
overflow-y: auto;
1421+
padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
1422+
scroll-padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
13991423
-webkit-overflow-scrolling: touch;
14001424
}
14011425

@@ -1475,11 +1499,11 @@ input {
14751499

14761500
.game-shell[data-mobile-screen="play"] .tile-hero {
14771501
display: flex;
1478-
flex: 0 0 clamp(248px, calc(100svh - 395px), 320px);
1479-
height: clamp(248px, calc(100svh - 395px), 320px);
1502+
flex: 0 0 clamp(220px, calc(100svh - 430px), 284px);
1503+
height: clamp(220px, calc(100svh - 430px), 284px);
14801504
flex-direction: column;
14811505
justify-content: space-between;
1482-
gap: 8px;
1506+
gap: 6px;
14831507
overflow: hidden;
14841508
}
14851509

@@ -1488,11 +1512,6 @@ input {
14881512
display: none;
14891513
}
14901514

1491-
.game-shell[data-mobile-screen="play"] .tile-hero [data-ui="company-note"],
1492-
.game-shell[data-mobile-screen="play"] .tile-hero .company-progress {
1493-
display: none;
1494-
}
1495-
14961515
.game-shell[data-mobile-screen="play"] .tile-hero .company-evolution {
14971516
margin-bottom: 0;
14981517
}
@@ -1501,25 +1520,41 @@ input {
15011520
align-items: center;
15021521
}
15031522

1523+
.game-shell[data-mobile-screen="play"] .tile-hero [data-ui="company-note"] {
1524+
margin: 2px 0 0;
1525+
font-size: 0.66rem;
1526+
line-height: 1.2;
1527+
}
1528+
1529+
.game-shell[data-mobile-screen="play"] .tile-hero .company-progress {
1530+
margin-top: 4px;
1531+
}
1532+
15041533
.game-shell[data-mobile-screen="play"] .tile-hero .click-primary-wrap {
15051534
margin: 0;
15061535
}
15071536

15081537
.game-shell[data-mobile-screen="play"] .tile-hero .loc-visual-wrap {
1509-
margin-top: 4px;
1538+
margin-top: 2px;
15101539
}
15111540

15121541
.game-shell[data-mobile-screen="play"] .tile-hero .loc-visual {
1513-
grid-template-columns: repeat(6, minmax(0, 1fr));
1542+
grid-template-columns: repeat(5, minmax(0, 1fr));
15141543
gap: 2px;
15151544
}
15161545

15171546
.game-shell[data-mobile-screen="play"] .tile-hero .loc-line {
1518-
height: 3px;
1547+
height: 2px;
1548+
}
1549+
1550+
.game-shell[data-mobile-screen="play"]
1551+
.tile-hero
1552+
.loc-line:nth-child(n + 26) {
1553+
display: none;
15191554
}
15201555

15211556
.game-shell[data-mobile-screen="play"] .tile-hero .combo-meter {
1522-
margin-top: 4px;
1557+
margin-top: 2px;
15231558
}
15241559

15251560
.game-shell[data-mobile-screen="play"] .tile-hero .team-visual {

0 commit comments

Comments
 (0)