feat: New features (research, invest, gambling, new game+, trophies)

This commit is contained in:
gauvainboiche
2026-10-08 14:03:00 +02:00
parent 1caa4d92b9
commit fc0d5e3ba4
56 changed files with 4332 additions and 249 deletions
+2
View File
@@ -15,6 +15,8 @@
--accent: #2563eb;
--accent-contrast: #ffffff;
--danger: #c0392b;
--good: #1a7f4b; /* gains */
--bad: #c0392b; /* losses */
--radius: 10px;
--font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
+219
View File
@@ -423,3 +423,222 @@ select,
background: var(--danger);
color: #fff;
}
/* ------------------------------------------------------- resource bar */
.res {
display: flex;
flex: 1 1 0;
align-items: center;
gap: 0.5rem;
min-width: 0;
}
.res .icon {
--icon-size: 1.75rem;
}
.res > div {
min-width: 0;
}
.res__label {
display: block;
overflow: hidden;
color: var(--text-muted);
font-size: 0.7rem;
text-overflow: ellipsis;
white-space: nowrap;
}
.res strong {
display: block;
overflow: hidden;
font-size: 1.05rem;
font-variant-numeric: tabular-nums;
text-overflow: ellipsis;
white-space: nowrap;
}
.res--primary strong {
color: var(--accent);
}
@media (max-width: 519px) {
.resourcebar {
gap: 0.5rem;
padding: 0.35rem 0.75rem;
}
.res .icon {
display: none;
}
.res strong {
font-size: 0.95rem;
}
}
/* ----------------------------------------------------------------- tabs */
.tab {
position: relative;
width: 100%;
min-height: 44px;
padding: 0.4rem 1rem;
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: var(--radius);
cursor: pointer;
text-align: left;
touch-action: manipulation;
}
.tab[aria-current='page'] {
background: var(--accent);
border-color: var(--accent);
color: var(--accent-contrast);
font-weight: 600;
}
@media (min-width: 760px) {
.tab {
width: auto;
text-align: center;
}
}
/* A dot: something new (newly unlocked) or waiting (an opportunity to seize). */
.tab--new .tab::after,
.tab--alert .tab::after {
position: absolute;
top: 6px;
right: 6px;
width: 10px;
height: 10px;
background: var(--danger);
border: 2px solid var(--surface);
border-radius: 50%;
content: '';
}
.tab--alert .tab::after {
animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
50% {
transform: scale(1.5);
}
}
@media (prefers-reduced-motion: reduce) {
.tab--alert .tab::after {
animation: none;
}
}
/* ------------------------------------------------------------ gains/losses */
.pos {
color: var(--good);
}
.neg {
color: var(--bad);
}
.badge.pos,
.badge.neg {
background: transparent;
border: 1px solid currentColor;
}
/* --------------------------------------------------- cards with actions */
.card--stack {
flex-direction: column;
}
.card__row {
display: flex;
align-items: flex-start;
gap: var(--gap);
}
.card__actions {
display: flex;
gap: var(--gap);
}
.card__actions .btn {
flex: 1;
}
.card--done {
border-left: 4px solid var(--good);
}
.card--locked {
opacity: 0.6;
}
.cards--grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}
.panel--low .panel__title { color: var(--good); }
.panel--high .panel__title { color: var(--bad); }
/* ---------------------------------------------- contracts, gamble, legacy */
.callout {
display: flex;
flex-direction: column;
gap: 0.35rem;
padding: 0.75rem;
background: var(--surface-2);
border: 2px solid var(--accent);
border-radius: var(--radius);
}
.progress {
width: 100%;
height: 14px;
accent-color: var(--accent);
}
.log {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.log__entry {
padding: 0.3rem 0.6rem;
background: var(--surface-2);
border-left: 4px solid var(--border);
border-radius: 4px;
font-size: 0.9rem;
}
.log__entry--win,
.log__entry--jackpot {
border-left-color: var(--good);
}
.log__entry--lose,
.log__entry--crash {
border-left-color: var(--bad);
}
.log__entry--jackpot,
.log__entry--crash {
font-weight: 700;
}
/* A hint under a big figure goes on its own line (rate under research points, bonus under chips). */
.tile .hint {
display: block;
}
+111 -7
View File
@@ -1,10 +1,14 @@
/* Page layout. Mobile first: one column, then 2 and 3 columns as space allows. */
/* Page layout. Mobile first: one column, a burger menu; then tabs and more columns as space allows. */
/* --------------------------------------------------------------- top bar */
.topbar {
display: flex;
flex-wrap: wrap;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
grid-template-areas:
'title toggle'
'menu menu';
align-items: center;
justify-content: space-between;
gap: var(--gap);
padding: var(--gap) 1rem;
background: var(--surface);
@@ -12,22 +16,102 @@
}
.topbar__title {
grid-area: title;
font-size: 1.25rem;
overflow-wrap: anywhere;
}
.topbar__controls {
.menu-toggle {
grid-area: toggle;
}
/* Phones: the menu is a drop-down opened by the burger button. */
.menu {
grid-area: menu;
display: none;
flex-direction: column;
gap: var(--gap);
}
.menu[data-open] {
display: flex;
}
.tabs {
display: flex;
flex-direction: column;
gap: 0.35rem;
}
.menu__controls {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
gap: var(--gap);
padding-top: var(--gap);
border-top: 1px solid var(--border);
}
/* Tablet and desktop: the tabs form a bar under the title, the controls sit on the right. */
@media (min-width: 760px) {
.topbar {
grid-template-columns: minmax(0, 1fr) auto;
grid-template-areas:
'title controls'
'tabs tabs';
row-gap: 0.5rem;
}
/* More specific than .btn (components.css loads later) so the burger really disappears. */
.topbar .menu-toggle {
display: none;
}
/* The nav's children join the top bar grid directly. */
.menu,
.menu[data-open] {
display: contents;
}
.tabs {
grid-area: tabs;
flex-direction: row;
flex-wrap: wrap;
}
.menu__controls {
grid-area: controls;
padding-top: 0;
border-top: 0;
}
}
/* -------------------------------------------------------- resource bar */
.resourcebar {
position: sticky;
top: 0;
z-index: 5;
display: flex;
gap: var(--gap);
padding: 0.4rem 1rem;
background: var(--surface);
border-bottom: 1px solid var(--border);
box-shadow: 0 2px 6px rgb(0 0 0 / 0.12);
}
/* ----------------------------------------------------------------- views */
.views {
max-width: 1400px;
margin: 0 auto;
}
/* The production section is a named grid, the others a simple responsive one. */
.game {
display: grid;
gap: 1rem;
padding: 1rem;
max-width: 1400px;
margin: 0 auto;
grid-template-columns: minmax(0, 1fr);
grid-template-areas:
'stats'
@@ -37,6 +121,14 @@
'upgrades';
}
.view {
display: grid;
gap: 1rem;
padding: 1rem;
grid-template-columns: minmax(0, 1fr);
align-items: start;
}
.panel--stats { grid-area: stats; }
.panel--production { grid-area: production; }
.panel--market { grid-area: market; }
@@ -53,6 +145,14 @@
'generators upgrades';
align-items: start;
}
.view {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.panel--wide {
grid-column: 1 / -1;
}
}
/* Desktop */
@@ -65,4 +165,8 @@
'production generators upgrades'
'market generators upgrades';
}
.view {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}