Been There Series
Dropping the 3D globe to turn a hotel tracker into a tactile room-key collection—drawn to true millimetre scale, unlocked with a tap or a turn, and gathered in a header tray删掉 3D 地球,把酒店打卡改成触感真实的房卡收藏:按真实毫米比例绘制,刷卡或拧钥匙解锁,收进顶栏托盘
November 20262026年11月
The first version of Been There Series put hotel stays onto a spinning 3D WebGL globe with floating emoji pins. It made a fun first impression for ten seconds, and then quietly got in its own way: Three.js felt heavy, phones couldn't pinch-zoom a globe alongside sidebars without fighting the browser, and—most importantly—a glowing dot on a map never actually felt like staying at a hotel.
What actually stays in your pocket after checking in is the room key: a crisp plastic card, a woven resort wristband, a wooden tag, a leather fob, or a heavy brass metal key. Rebuilding Been There Series meant deleting Three.js and the 3D globe completely—leaving zero runtime dependencies beyond React 18 itself—and redesigning the entire product around one simple loop: browse the hotels, tap 'I stayed here', watch the key open the lock, and collect it at true relative size in your tray.
第一版 Been There Series 把住过的酒店插在一颗旋转的 3D WebGL 地球上,配着飘来飘去的 Emoji 图钉。前十秒挺有趣,接着就开始碍事:Three.js 很沉,手机上双指缩放地球和侧边栏互相抢手势,最根本的是——球面上一颗发光小点,完全给不了你住过一家酒店的实感。
退房之后真正揣在兜里的,其实是房卡:一张塑料卡、一条度假村编织手环、一块木牌、一枚皮吊牌,或者一把沉甸甸的黄铜钥匙。重构 Been There Series 意味着把 Three.js 和整颗地球删干净(运行时依赖清零到只剩 React 18 自己),围绕一条极简循环重塑整个产品:浏览酒店、点下「I stayed here」、看房卡把门锁打开,再按真实相对尺寸收进顶栏托盘。
Hotels first—and drawing every room key to one millimetre scale酒店优先,把每张房卡画在同一把毫米尺上
Flipping the hierarchy from a map to a collection immediately simplified the entire interface. Each hotel card leads with its name and city, followed by its room key resting on a quiet 130 × 104 mm stage and a single check-in button. Because the stage is built as a CSS size container (where 1 mm equals 0.769 cqw), every key across the entire collection shares the exact same physical scale: a standard 85.6 × 54 mm key card genuinely looks larger than a 38 × 38 mm token or a 32 × 44 mm key fob, and narrower than a 118 × 22 mm wristband or a 34 × 98 mm wooden tag.1
Keys you haven't earned yet stay intentionally restrained. When a hotel has a transparent-background PNG photograph of its real key, CSS mask-image turns that exact silhouette into a soft grey outline—hiding the artwork until you check in without resorting to generic placeholder boxes. When a property doesn't have a photograph yet, it renders as a dashed geometric outline matching its kind (card, wristband, token, key fob, wooden tag, leather tag, or SVG metal key) with nothing printed on it, filling in with the hotel's name only once you mark it stayed.
把层级从地图翻回收藏,整个界面瞬间清爽下来。每张酒店卡先亮名字和城市,中间摆一张平放在安静 130 × 104 mm 舞台上的房卡,配一枚签到按钮。因为舞台本身是 CSS 尺寸容器(1 mm 等于 0.769 cqw),全站所有房卡共用完全一致的物理比例:标准 85.6 × 54 mm 房卡看着就真的比 38 × 38 mm 代币或 32 × 44 mm 钥匙扣大,也比 118 × 22 mm 手环或 34 × 98 mm 木牌窄。1
还没住过的房卡刻意保持克制。酒店有透明底 PNG 实拍图的,CSS mask-image 直接把真实轮廓化成一片柔和灰影,既不提前剧透图案也不用呆板占位框;暂时没图的,只画对应品类的虚线轮廓(房卡、手环、代币、钥匙扣、木牌、皮牌或 SVG 金属钥匙)且不印字,直到签到才填色印出酒店名。
A tap on the reader, a turn in the keyhole, and one accent color刷一下读卡器、拧一下锁孔,以及全站唯一一盏绿灯
Checking into a hotel has a small physical ritual attached to it, and the interaction tries to echo that ritual without overstaying its welcome. Pressing 'I stayed here' triggers a 1.9-second lock sequence calibrated in the same real millimetres as the stage: electronic keys (cards, wristbands, tokens, fobs, and tags) slide 14 mm right and 5 mm down onto a dark lock reader until its red LED flips to green; brass metal keys slide 12 mm into a keyhole, turn flat, turn back, and pull out while the lock ring lights up green.2 Under prefers-reduced-motion, the lock chrome and motion stay out of the way completely.
That lock reader's green light is the only accent color in the entire design system. Light and dark themes (following prefers-color-scheme automatically on neutral paper-grey and charcoal surfaces set in Geist) keep everything else strictly monochromatic—even the full stop at the end of the 'been there.' wordmark in the header is that same green light, pinging once every time a new check-in lands.
Once unlocked, the key settles into the KeyTray in the header in the exact order you checked in. Each mini key renders at a fixed 0.6 px/mm scale with a small, deterministic hand-placed tilt so the tray feels like keys tossed down on a desk rather than a rigid toolbar.3 Clicking any key in the tray clears active filters, scrolls smoothly back to that hotel card, and focuses it.
A map pin tells you where a hotel sits on Earth; a room key drawn to the millimetre—and unlocked with a green light—reminds you what it felt like to open the door.
入住酒店自带一套小小的物理仪式,这里的交互试着呼应这份仪式又不喧宾夺主。点下「I stayed here」会播一段按同一套真实毫米算好位移的 1.9 秒开锁序列:电子卡(房卡、手环、代币、钥匙扣、吊牌)向右移 14 mm、下移 5 mm 轻触深色读卡器,直到红灯翻绿;黄铜金属钥匙向右推入锁孔 12 mm、拧平、回正再拔出,锁孔环跟着亮绿。2 开启 prefers-reduced-motion 时,锁具元素与动画干脆退场,绝不强行播放。
那盏读卡器绿灯也是整套设计系统里唯一一个强调色。浅色与深色主题(随 prefers-color-scheme 自动切换,配 Geist 字体与中性纸灰/炭黑表面)其余部分严格保持单色,甚至顶栏「been there.」字标末尾那个句点,也是同一盏绿灯,每次新签到都会轻闪一下。
解锁后,房卡按签到先后落进顶栏 KeyTray。每枚迷你房卡按固定 0.6 px/mm 绘制,带着一点确定性的随手倾角,让托盘看着像顺手搁在桌上的几把钥匙,而不像刻板工具栏。3 点托盘里任意房卡,会自动清空筛选、平滑滚回对应酒店卡片并聚焦。
地图图钉只告诉你酒店在地球哪个经纬度;一张按毫米画出来、亮着绿灯解锁的房卡,才让你想起推开房门那一刻的手感。
Plain-text filters, two-step safety, and phone-friendly craft纯文本筛选、两步确认与手机端无妥协体验
Dropping the 3D globe also eliminated the old desktop-only viewport warning. The redesigned grid adapts cleanly from phone to desktop with a single search input (matching hotel name, city, and country) and plain-text filter controls—All, Stayed, and Not yet alongside continent regions—paired with live superscript counts where clicking an active region again clears it.
Everything personal stays lightweight and private. Visitor check-ins live exclusively in the browser's localStorage with no accounts or login walls. Undoing a single stay is one tap on its 'Stayed' button, while 'Clear my check-ins' in the footer uses an inline two-step confirmation—press once to arm for four seconds, press again to wipe—avoiding jarring browser alert modals while still protecting against accidental taps.
删掉 3D 地球也顺手撤掉了旧版仅限桌面端的提示。重绘后的网格在手机和桌面间顺滑自适应,配一个搜索框(搜酒店名、城市和国家)和纯文本筛选条(All、Stayed、Not yet 以及大洲分组),带实时上标计数,再点一次当前大洲即可取消。
个人状态保持轻巧私密。访客签到只存在浏览器本地 localStorage,没账号也没登录墙。撤销单次入住只需再点一下「Stayed」;页脚的「Clear my check-ins」采用内联两步确认——点一次武装四秒、再点一次清空——避开生硬的浏览器弹窗,也防误触。
Thin-MVP persistence in Cloudflare D1—and room-key privacy hygieneCloudflare D1 里的 Thin-MVP 持久化,与房卡照片隐私守则
Behind the scenes, Been There Series kept its Thin-MVP discipline intact: hotels, their keys, and one check-in action. The normalized Cloudflare D1 schema gained an optional 1-to-1 stay_keys table (storing kind, optional millimetre dimensions, material, and front/back photo URLs, defaulting cleanly to a standard 85.6 × 54 mm card whenever a row is absent), joined in a single query by the Cloudflare Pages Function at /api/stays and cached for 60 seconds.4
Even curating real room-key photography comes with a clear privacy rule documented right in the repository: before publishing any key photo, cover anything that could identify a room or booking—room numbers, barcodes, or handwriting—and only upload the photo after checking out.5
Notes注释
- KEY_KINDS defines default dimensions for all seven kinds: card (85.6 × 54 mm), wristband (118 × 22 mm), token (38 × 38 mm), key_fob (32 × 44 mm), wooden_tag (34 × 98 mm), leather_tag (70 × 36 mm), and metal_key (96 × 34 mm). Oversized entries scale proportionally to fit inside 120 × 100 mm so lock animations stay framed.↩︎KEY_KINDS 为七类房卡定义了默认尺寸:card(85.6 × 54 mm)、wristband(118 × 22 mm)、token(38 × 38 mm)、key_fob(32 × 44 mm)、wooden_tag(34 × 98 mm)、leather_tag(70 × 36 mm)与 metal_key(96 × 34 mm)。超尺寸项按比例缩进 120 × 100 mm 以内,确保开锁动画不越界。↩︎
- Because the 130 × 104 mm stage uses container-type: inline-size, CSS keyframes translate electronic keys by 10.8 cqw (14 mm) horizontally and 3.8 cqw (5 mm) vertically, and metal keys by 9.2 cqw (12 mm) into the keyhole before rotating via scaleY(0.18).↩︎因为 130 × 104 mm 舞台启用了 container-type: inline-size,CSS 关键帧将电子卡平移 10.8 cqw(14 mm)× 3.8 cqw(5 mm),金属钥匙推入 9.2 cqw(12 mm)后以 scaleY(0.18) 模拟拧转。↩︎
- Each collected key's slight resting angle is computed deterministically from its tray index via (((index * 37) % 9) - 4) * 0.9 degrees—random enough to feel natural, stable across renders.↩︎每枚已收集房卡的微倾角由托盘索引按 (((index * 37) % 9) - 4) * 0.9 度确定性算出,既有自然随性感,跨渲染又稳稳不变。↩︎
- functions/api/stays.js queries stays with a LEFT JOIN on stay_keys alongside tags, flexible metrics, and photos; local Vite development points VITE_STAYS_API_URL at a deployed endpoint without needing a local database server.↩︎functions/api/stays.js 对 stays 与 stay_keys 做 LEFT JOIN,一并返回标签、弹性指标与照片;本地 Vite 开发把 VITE_STAYS_API_URL 指向线上接口即可,不用本地起库。↩︎
- Transparent-background PNGs cropped tightly to the key serve double duty: the exact same front_url renders the full-color collected key and drives the CSS mask-image grey silhouette before check-in.↩︎紧裁透明背景 PNG 一图两用:同一个 front_url 签到后渲染彩色实拍房卡,签到前直接驱动 CSS mask-image 灰色剪影。↩︎
Built with React 18, Vite, CSS Modules, Cloudflare Pages Functions, and Cloudflare D1 (zero third-party runtime dependencies beyond React); live at travel.yflong.dev.使用 React 18、Vite、CSS Modules、Cloudflare Pages Functions 与 Cloudflare D1 构建(除 React 外零第三方运行时依赖),上线于 travel.yflong.dev。
Stack: React 18, Vite, CSS Modules, Cloudflare Functions, Cloudflare D1.技术栈:React 18、Vite、CSS Modules、Cloudflare Functions、Cloudflare D1。