From 1442fbae750664504aab4cf5ead991356aabebd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Tue, 19 May 2026 18:14:14 +0200 Subject: [PATCH] tablet: fit grid and cart on screen, no scrolling --- client/src/styles.css | 26 +++++++++++++++----------- flake.lock | 27 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 flake.lock diff --git a/client/src/styles.css b/client/src/styles.css index fc19cfa..d716865 100644 --- a/client/src/styles.css +++ b/client/src/styles.css @@ -31,6 +31,7 @@ button:disabled { opacity: 0.4; } flex-direction: column; height: 100%; max-width: 100vw; + overflow: hidden; } .bar-picker { @@ -61,18 +62,18 @@ button:disabled { opacity: 0.4; } .topbar .bar-name { font-size: 20px; font-weight: bold; } .topbar .change { font-size: 14px; padding: 8px 12px; } -/* Square-ish drink buttons, sized to fit a portrait tablet width. - 3 columns on a typical portrait iPad (~768px) gives ~240px-wide tiles. */ +/* Drink grid fills available space with no scrolling — tiles auto-size to fit. + 3 columns on portrait iPad (~768px); rows divide the remaining height equally. */ .grid { - flex: 1 1 auto; + flex: 1 1 0; + min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); + grid-auto-rows: 1fr; gap: 8px; padding: 8px; - overflow-y: auto; - align-content: start; + overflow: hidden; } -.grid > .drink { aspect-ratio: 1 / 1; } @media (max-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); } @@ -96,19 +97,22 @@ button:disabled { opacity: 0.4; } } .cart { - flex: 0 0 auto; + flex: 0 0 38vh; background: #1a1a1a; border-top: 1px solid #333; padding: 8px 16px; display: flex; flex-direction: column; - max-height: 38vh; + min-height: 0; } .cart-items { - flex: 1 1 auto; - overflow-y: auto; + flex: 1 1 0; + min-height: 0; + overflow: hidden; margin-bottom: 6px; - min-height: 60px; + display: flex; + flex-direction: column; + justify-content: flex-end; } .cart-line { display: flex; diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..94e0bfb --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1778869304, + "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d233902339c02a9c334e7e593de68855ad26c4cb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +}