Files
Pedro Santos 77d81e4476 Lighter connections to RomM, one card per Switch game, app polish
- Reuse connections to RomM. When it stops answering, fail fast and check
  back every 5-30 s instead of every request waiting; the top right says
  "Difficulties connecting to server" (app and web UI)
- Game lists come 60 at a time; the daily cover pass skips platforms whose
  game count didn't change
- Switch: duplicate entries of one game show as one card; no version labels
- Review fixes: cancelling a Switch download keeps files that were there,
  a folder's update/DLC is found when its update comes first, a stale hold
  can't delete a game, the web Downloads tab reloads only on change
- App: platform logos on library cards and in Configure Emulators, game
  descriptions scroll by holding Up/Down, a roomier details sheet, a star
  on the rating, bold user @ host:port with a lock for HTTPS, no "Save sync"
  tagline on Home, notifications kept clear of the button hints
2026-10-21 01:31:11 -04:00

117 lines
11 KiB
CSS

/* RommPS web UI: layout and components. Colours, shapes and effects come
* from the theme tokens in ui/themes/ (classic.css lists them all). */
* { box-sizing: border-box; }
body { margin: 0; background-color: var(--page); background-image: var(--backdrop); background-attachment: fixed; color: var(--text); font: 18px/1.45 var(--font); }
header { display: flex; align-items: center; gap: 16px; padding: 14px 24px; background: var(--header); border-bottom: var(--hairline); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); position: -webkit-sticky; position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header h1 { font-size: 22px; margin: 0 12px 0 0; }
header h1 span { color: var(--accent-text); }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
.tab, button, select, input, textarea { font: inherit; color: inherit; }
.tab { background: var(--surface-raised); border: 2px solid transparent; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.tab.active { background: var(--primary); color: var(--on-primary); }
#conn { margin-left: auto; font-size: 15px; color: var(--text-muted); }
main { padding: 20px 24px 60px; max-width: 1400px; margin: 0 auto; }
section { display: none; } section.active { display: block; }
.card { background: var(--surface); border: var(--hairline); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); }
.card h2 { margin: 0 0 12px; font-size: 20px; }
.card h3 { margin: 20px 0 8px; font-size: 17px; }
.grid { display: grid; grid-gap: 14px; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.stats { display: grid; grid-gap: 12px; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.stat { background: var(--surface-raised); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 24px; } .stat small { color: var(--text-muted); }
button { background: var(--surface-raised); border: 2px solid var(--control-edge); border-radius: var(--radius); padding: 10px 18px; cursor: pointer; }
button.primary { background: var(--primary); color: var(--on-primary); } button.danger { background: var(--danger-bg); color: var(--danger-text); }
button.small { padding: 6px 12px; font-size: 15px; }
button:disabled { opacity: .5; cursor: default; }
:focus { outline: none; } :focus-visible { border-color: var(--focus) !important; box-shadow: 0 0 0 3px var(--focus-glow); }
/* Older WebKit (the PS4's browser) has no :focus-visible or flex gap; the script
* at the end sets no-fv and no-flexgap on <html> there. */
.no-fv :focus { border-color: var(--focus) !important; box-shadow: 0 0 0 3px var(--focus-glow); }
.no-flexgap header > *, .no-flexgap nav > *, .no-flexgap .row > *, .no-flexgap .plat > *, .no-flexgap .rom .btns > *,
.no-flexgap .toggle > *, .no-flexgap .steps > *, .no-flexgap .pairbox > *, .no-flexgap .emu .head > *,
.no-flexgap .emu .group > *, .no-flexgap .choice > *, .no-flexgap .ribbon > * { margin-right: 8px; margin-bottom: 6px; }
input, select, textarea { background: var(--field); border: 2px solid var(--outline); border-radius: var(--radius); padding: 10px 12px; width: 100%; }
textarea { font: 14px/1.4 var(--font-mono); min-height: 320px; }
label { display: block; margin: 10px 0 4px; color: var(--text-muted); font-size: 15px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1 1 auto; } .row > button, .row > .fixed { flex: 0 0 auto; }
.muted { color: var(--text-muted); } .ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); }
.pulse { animation: pulse 1.6s ease-in-out infinite; } @keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--pill-bg); color: var(--pill-text); margin: 0 6px 6px 0; white-space: nowrap; }
.pill.ok { background: var(--pill-ok-bg); color: var(--pill-ok-text); } .pill.off { background: var(--pill-off-bg); color: var(--text-muted); } .pill.warn { background: var(--pill-warn-bg); color: var(--pill-warn-text); }
.plats { display: grid; grid-gap: 16px; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.plat { background: var(--surface-raised); border: 2px solid var(--control-edge); border-radius: var(--radius-card); padding: 18px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.plat .logo { height: 96px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.plat .logo img { width: 96px; height: 96px; object-fit: contain; background: transparent; }
.plat .logo span { font-size: 40px; font-weight: 700; color: var(--accent-text); }
.plat .n { font-weight: 600; font-size: 19px; } .plat small { display: block; color: var(--text-muted); }
.seg { display: inline-flex; border-radius: var(--radius); overflow: hidden; }
.seg button { border-radius: 0; padding: 10px 14px; } .seg button.on { background: var(--primary); color: var(--on-primary); }
.romtable td { vertical-align: middle; } .romtable img { width: 40px; height: 54px; object-fit: cover; border-radius: 4px; background: var(--sunken); display: block; }
.rom { background: var(--surface-raised); border: 2px solid var(--control-edge); border-radius: var(--radius-card); overflow: hidden; display: flex; flex-direction: column; }
/* 3:4 by padding rather than aspect-ratio, which older WebKit ignores. */
.rom .cover { position: relative; height: 0; padding-top: 133.333%; background-color: var(--sunken); background-position: center; background-repeat: no-repeat; background-size: cover; }
.rom .badge { position: absolute; left: 0; bottom: 0; margin: 8px; background: var(--ok); color: var(--on-ok); font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.rom .badge.dl { background: var(--warn); color: var(--on-warn); }
.rom .t { padding: 8px 10px 4px; font-size: 15px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.9em; }
.rom .s { padding: 0 10px; font-size: 13px; color: var(--text-muted); }
.rom button { margin: 8px 10px 10px; padding: 8px; }
.rom .btns { display: flex; gap: 6px; margin: 8px 10px 10px; min-width: 0; }
.rom .btns button { margin: 0; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rom .btns button.icon { flex: 0 0 auto; }
button.icon { display: inline-flex; align-items: center; justify-content: center; padding: 8px 10px; line-height: 0; }
button.icon svg { width: 18px; height: 18px; }
.dl-item { padding: 12px 0; border-bottom: 1px solid var(--outline); }
.installed-item .row { align-items: center; }
.instCover { width: 58px; border-radius: 8px; display: block; flex: 0 0 auto; }
.installed-item .t { margin-top: 4px; font-size: 16px; }
.installed-item .meta { margin-top: 2px; }
.dl-item:last-child { border-bottom: 0; }
.dl-item .meta { font-size: 15px; color: var(--text-muted); margin-top: 4px; }
.bar { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--primary); width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
td, th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--outline); vertical-align: top; }
th { color: var(--text-muted); font-weight: 500; }
pre { background: var(--sunken-deep); border-radius: var(--radius); padding: 12px; overflow: auto; font-size: 13px; max-height: 60vh; white-space: pre-wrap; word-break: break-word; }
code { background: var(--surface-raised); padding: 2px 6px; border-radius: var(--radius-small); word-break: break-all; font-size: 14px; }
.code { font: 700 56px/1 var(--font-mono); letter-spacing: 8px; color: var(--accent-text); margin: 12px 0; }
.toggle { display: flex; align-items: center; gap: 10px; margin: 10px 0; } .toggle input { width: auto; transform: scale(1.4); }
.toggle label { margin: 0; color: var(--text); font-size: 17px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--toast); border: var(--hairline); padding: 12px 20px; border-radius: var(--radius); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); display: none; z-index: 10; max-width: 90vw; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.steps span { padding: 6px 14px; border-radius: 999px; background: var(--surface-raised); color: var(--text-muted); font-size: 15px; }
.steps span.on { background: var(--primary); color: var(--on-primary); } .steps span.done { color: var(--ok); }
.wz { display: none; } .wz.on { display: block; }
.pairbox { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.qr { background: #fff; padding: 10px; border-radius: var(--radius); line-height: 0; } .qr svg { width: 220px; height: 220px; }
.emu { background: var(--surface-raised); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.emu .head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; color: var(--text); font-size: 18px; }
.emu .head input { width: auto; transform: scale(1.4); }
.emu .head b { font-size: 22px; }
.emu .path { color: var(--text-muted); font-size: 14px; margin: 6px 0 10px; }
.emu .group { display: flex; gap: 10px; align-items: baseline; }
.emu .group > small { color: var(--text-muted); width: 80px; flex: 0 0 80px; }
.choice { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-raised); border: 2px solid var(--control-edge); border-radius: var(--radius); padding: 14px; margin: 8px 0; cursor: pointer; color: var(--text); font-size: 17px; }
.choice input { width: auto; transform: scale(1.3); margin-top: 5px; }
.choice.disabled { opacity: .55; cursor: default; }
.choice b { display: block; }
#modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: var(--overlay); display: none; align-items: flex-start; justify-content: center; z-index: 20; padding: 40px 16px; overflow: auto; }
#modal.on { display: flex; }
#modal .card { width: 100%; max-width: 900px; }
[data-collapse].collapsed .collapsible { display: none; }
.notice { border-left: 4px solid var(--warn); background: var(--notice-bg); border-radius: var(--radius-notice); padding: 12px 16px; margin: 14px 0; }
.notice b { color: var(--pill-warn-text); }
a { color: var(--accent-text); }
.ribbon { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 14px; }
.ribbon button { min-width: 38px; padding: 6px 0; font-size: 15px; }
.ribbon button:disabled { opacity: .3; }
.ribbon, [data-rom] { scroll-margin-top: 90px; } /* clear of the sticky header */
#updBody details { margin-top: 14px; }
.tplat { border-top: var(--hairline); padding: 8px 0; }
.tplat summary { cursor: pointer; padding: 4px 0; }
.tgame { margin: 10px 0 10px 14px; }
.tfile { margin: 4px 0 0 10px; word-break: break-all; }
.noSaves .syncCol { display: none; }