|
69 | 69 | .gs-tt p{margin:5px 0 0;color:var(--ink-2);font-size:15px;line-height:1.4} |
70 | 70 | .gs-n{flex:none;align-self:center;font-family:var(--mono);font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;color:var(--gs-c);background:color-mix(in srgb,var(--gs-c) 13%,transparent);border-radius:999px;padding:5px 12px} |
71 | 71 |
|
72 | | -/* ---------- the grid: 4 across on computers, 3 on small laptops, 2 on tablets and phones ---------- */ |
73 | | -.gc-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:1fr;gap:18px} |
74 | | -@media (max-width:959px){.gc-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:auto}} |
75 | | -@media (max-width:879px){.gc-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}} |
76 | | -@media (max-width:330px){.gc-grid{grid-template-columns:minmax(0,1fr)}} |
| 72 | +/* ---------- the grid: at most 4 across on computers, 3 on small laptops, 2 on tablets and phones ---------- |
| 73 | + Even rows: layout.js counts each section's visible cards and picks how many columns it uses (--ev-cols, up to |
| 74 | + --ev-max) and which cards are wide (data-ev-w), so every row ends flush (see README: Even rows). Without it |
| 75 | + (the script not loaded yet) the grid uses --ev-max columns and the .wide / .pw cards below. */ |
| 76 | +.gc-grid{--ev-max:4;display:grid;grid-template-columns:repeat(var(--ev-cols,var(--ev-max)),minmax(0,1fr));grid-auto-rows:1fr;gap:18px} |
| 77 | +@media (max-width:959px){.gc-grid{--ev-max:3;grid-auto-rows:auto}} |
| 78 | +@media (max-width:879px){.gc-grid{--ev-max:2;gap:14px}} |
| 79 | +@media (max-width:330px){.gc-grid{--ev-max:1}} |
77 | 80 |
|
78 | 81 | /* ---------- a game card ---------- */ |
79 | 82 | .br-games .gc{position:relative;display:flex;flex-direction:column;min-width:0;background:var(--panel);border:1px solid color-mix(in srgb,var(--line) 80%,transparent);border-radius:var(--gc-r);overflow:hidden;box-shadow:var(--gc-shadow);transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease} |
|
95 | 98 | .br-games .gc .btn.primary{width:100%;justify-content:center;min-height:42px;border-radius:11px;font-size:15px;background:var(--gs-c);border-color:var(--gs-c);color:var(--gs-ink);box-shadow:0 6px 14px -8px var(--gs-c);transition:filter .15s ease,transform .15s ease} |
96 | 99 | .br-games .gc .btn.primary:active{transform:scale(.97)} |
97 | 100 |
|
98 | | -/* Wide cards (two columns, picture on the left) keep each section's rows full on computers, four across: Shooters has |
99 | | - 4 regular, Parkour 6 (2 wide + 4 = two rows), Arcade 5 (3 wide + 2 = two rows), Cars, Party and Puzzles |
100 | | - 4 regular too. The wide ones |
101 | | - are each section's most played. Between 560 and 960 px a wide card takes a whole row of two, which keeps the other |
102 | | - cards in pairs. On phones (560 px and less) only .pw cards (Coil, so the others pair up) take a |
103 | | - whole row and the rest pair up. If a section's count changes, fix wide/pw. */ |
| 101 | +/* Wide cards (two columns, picture on the left). .wide (computers and tablets) and .pw (phones) say which games the |
| 102 | + site would like big, usually each section's most played; Edit layout (layout.js) can change that per player. |
| 103 | + Those are wishes: layout.js keeps every row full, so it marks the cards that are actually wide with data-ev-w, |
| 104 | + making a card wide or small where that's what keeps the rows even. In a grid of two columns a wide card is a |
| 105 | + whole row. The .wide rules here only apply before layout.js has run (no data-ev on the grid). */ |
104 | 106 | @media (min-width:960px), (min-width:561px) and (max-width:879px){ |
105 | | - .br-games .gc.wide{grid-column:span 2;flex-direction:row} |
106 | | - .br-games .gc.wide .shot{flex:0 0 52%;aspect-ratio:auto;min-height:220px;margin:7px 0 7px 7px} |
107 | | - .br-games .gc.wide .shot img{position:absolute;inset:0} |
108 | | - .br-games .gc.wide .body{padding:16px 18px 16px;gap:9px} |
109 | | - .br-games .gc.wide h3{font-size:31px} |
110 | | - .br-games .gc.wide .gc-blurb{font-size:15px;-webkit-line-clamp:4;min-height:0} |
111 | | - .br-games .gc.wide .gc-more summary{right:auto;left:calc(52% - 31px)} |
112 | | - .br-games .gc.wide .gc-more[open] summary{left:auto;right:15px} /* open: the info covers the whole card, so the × goes back to its corner */ |
| 107 | + .br-games .gc-grid:not([data-ev]) > .gc.wide{grid-column:span 2} |
| 108 | +} |
| 109 | +.br-games .gc-grid[data-ev] > .gc[data-ev-w]{grid-column:span 2} |
| 110 | +@media (min-width:960px), (min-width:561px) and (max-width:879px){ |
| 111 | + .br-games .gc-grid:not([data-ev]) > .gc.wide{flex-direction:row} |
| 112 | + .br-games .gc-grid:not([data-ev]) > .gc.wide .shot{flex:0 0 52%;aspect-ratio:auto;min-height:220px;margin:7px 0 7px 7px} |
| 113 | + .br-games .gc-grid:not([data-ev]) > .gc.wide .shot img{position:absolute;inset:0} |
| 114 | + .br-games .gc-grid:not([data-ev]) > .gc.wide .body{padding:16px 18px 16px;gap:9px} |
| 115 | + .br-games .gc-grid:not([data-ev]) > .gc.wide h3{font-size:31px} |
| 116 | + .br-games .gc-grid:not([data-ev]) > .gc.wide .gc-blurb{font-size:15px;-webkit-line-clamp:4;min-height:0} |
| 117 | + .br-games .gc-grid:not([data-ev]) > .gc.wide .gc-more summary{right:auto;left:calc(52% - 31px)} |
| 118 | + .br-games .gc-grid:not([data-ev]) > .gc.wide .gc-more[open] summary{left:auto;right:15px} /* open: the info covers the whole card, so the × goes back to its corner */ |
| 119 | +} |
| 120 | +@media (min-width:561px){ |
| 121 | + .br-games .gc-grid[data-ev] > .gc[data-ev-w]{flex-direction:row} |
| 122 | + .br-games .gc-grid[data-ev] > .gc[data-ev-w] .shot{flex:0 0 52%;aspect-ratio:auto;min-height:220px;margin:7px 0 7px 7px} |
| 123 | + .br-games .gc-grid[data-ev] > .gc[data-ev-w] .shot img{position:absolute;inset:0} |
| 124 | + .br-games .gc-grid[data-ev] > .gc[data-ev-w] .body{padding:16px 18px 16px;gap:9px} |
| 125 | + .br-games .gc-grid[data-ev] > .gc[data-ev-w] h3{font-size:31px} |
| 126 | + .br-games .gc-grid[data-ev] > .gc[data-ev-w] .gc-blurb{font-size:15px;-webkit-line-clamp:4;min-height:0} |
| 127 | + .br-games .gc-grid[data-ev] > .gc[data-ev-w] .gc-more summary{right:auto;left:calc(52% - 31px)} |
| 128 | + .br-games .gc-grid[data-ev] > .gc[data-ev-w] .gc-more[open] summary{left:auto;right:15px} |
113 | 129 | } |
114 | 130 | /* Hover and keyboard focus: lift the card, zoom and brighten the picture. */ |
115 | 131 | @media (hover: hover){ |
|
171 | 187 | .br-games .gc .gc-blurb{font-size:12.5px;line-height:1.35;-webkit-line-clamp:3;min-height:2.7em} |
172 | 188 | .gc-chips{gap:4px} |
173 | 189 | .gc-chips li{font-size:10.5px;padding:3px 7px;gap:5px} |
174 | | - .gc:not(.pw):not(.gc-daily) .gc-chips li:nth-child(n+2){display:none} |
175 | | - /* phones: only the first card of Puzzles, Parkour and Shooter / Action (.pw) stays a whole row; the others pair up */ |
176 | | - .br-games .gc.pw{grid-column:1 / -1} |
177 | | - .br-games .gc.pw h3{font-size:26px} |
178 | | - .br-games .gc.pw .gc-blurb{font-size:14px;min-height:0} |
| 190 | + .gc-grid:not([data-ev]) > .gc:not(.pw):not(.gc-daily) .gc-chips li:nth-child(n+2), |
| 191 | + .gc-grid[data-ev] > .gc:not([data-ev-w]):not(.gc-daily) .gc-chips li:nth-child(n+2){display:none} |
| 192 | + /* phones: a wide card (.pw before layout.js runs, data-ev-w after) is a whole row, picture on top; the others pair up */ |
| 193 | + .br-games .gc-grid:not([data-ev]) > .gc.pw{grid-column:1 / -1} |
| 194 | + .br-games .gc-grid:not([data-ev]) > .gc.pw h3,.br-games .gc-grid[data-ev] > .gc[data-ev-w] h3{font-size:26px} |
| 195 | + .br-games .gc-grid:not([data-ev]) > .gc.pw .gc-blurb,.br-games .gc-grid[data-ev] > .gc[data-ev-w] .gc-blurb{font-size:14px;min-height:0} |
179 | 196 | .gc-chips li.on::before{width:6px;height:6px} |
180 | 197 | .br-games .gc .btn.primary{min-height:38px;font-size:14px;border-radius:9px;padding:6px 10px} |
181 | 198 | .gc-info{padding:12px 12px 14px;font-size:13px} |
|
197 | 214 | .pz-wrap{grid-column:1 / -1;min-width:0} |
198 | 215 | /* Puzzles' rows needn't all be as tall as its game cards: the tiles take only what they need */ |
199 | 216 | .gs-puzzles .gc-grid{grid-auto-rows:auto} |
200 | | -/* Shooters: four regular cards, kept in one row of four down to 880 px (where other sections drop to three); 2 x 2 below that */ |
201 | | -@media (min-width:880px) and (max-width:959px){.br-games .gs-shooters .gc-grid{grid-template-columns:repeat(4,minmax(0,1fr))}} |
202 | 217 | .pz-h{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px;margin:2px 0 10px;font-family:var(--mono);font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--gs-c)} |
203 | 218 | /* today's progress (hidden on the home page's copy, which doesn't run the script that fills it) and the way to the Daily Puzzles page */ |
204 | 219 | .pz-today{color:var(--ink-2);letter-spacing:.04em;text-transform:none} |
205 | 220 | .pz-h a{margin-left:auto;color:var(--gs-c);text-underline-offset:3px} |
206 | | -.pz-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px} |
207 | | -@media (max-width:1100px){.pz-grid{grid-template-columns:repeat(4,minmax(0,1fr))}} |
208 | | -@media (max-width:879px){.pz-grid{grid-template-columns:repeat(3,minmax(0,1fr))}} |
209 | | -@media (max-width:560px){.pz-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}} |
| 221 | +/* even rows here too (layout.js): with a search on, fewer tiles share the row or one or two tiles stretch */ |
| 222 | +.pz-grid{--ev-max:6;display:grid;grid-template-columns:repeat(var(--ev-cols,var(--ev-max)),minmax(0,1fr));gap:10px} |
| 223 | +@media (max-width:1100px){.pz-grid{--ev-max:4}} |
| 224 | +@media (max-width:879px){.pz-grid{--ev-max:3}} |
| 225 | +@media (max-width:560px){.pz-grid{--ev-max:2;gap:8px}} |
| 226 | +.pz-grid[data-ev] > .pz[data-ev-w]{grid-column:span 2} |
210 | 227 | .br-games .pz{min-width:0;margin:0} |
211 | 228 | .br-games .pz a{display:flex;align-items:center;gap:9px;height:100%;min-height:58px;padding:6px 8px 6px 6px;border-radius:12px;text-decoration:none;color:var(--ink);background:var(--panel);border:1px solid color-mix(in srgb,var(--line) 80%,transparent);box-shadow:var(--gc-shadow);transition:transform .15s ease,border-color .15s ease} |
212 | 229 | .br-games .pz img{flex:none;width:58px;height:44px;border-radius:8px;object-fit:cover;background:var(--tape)} |
|
0 commit comments