[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112417":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":24,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},112417,"caffeine-day","charles-postiaux\u002Fcaffeine-day","charles-postiaux","How much caffeine is still in you at bedtime. A dependency-free dot-matrix chart.","https:\u002F\u002Fbaobun.studio\u002Fdemo\u002Fcaffeine",null,"JavaScript",61,4,1,0,3,8,44.4,"MIT License",false,"main",true,[],"2026-11-10 11:48:44","2026-11-20 14:19:09","# Caffeine Day\n\nHow much caffeine is still in you at bedtime, drawn as a lit ridge of dots.\nDrag your drinks along the day and watch the bedtime number move.\n\n![Caffeine Day](preview.png)\n\n**Try it:** [baobun.studio\u002Fdemo\u002Fcaffeine](https:\u002F\u002Fbaobun.studio\u002Fdemo\u002Fcaffeine)\n\n- Drag a drink along the day. Tap empty space to add one.\n- Tap a drink to pick what it is (coffee, espresso, cold brew, black tea,\n  green tea, cola, energy drink) and how much you had.\n- Drag the bed line to change your bedtime.\n- The top right tells you the latest time for your last drink if you want to\n  be under 50 mg at bed.\n- Your day is saved in the URL, so you can share it.\n\nKeyboard: focus the chart, then ← → move the selected drink by 15 minutes\n(shift for an hour), `[` `]` pick the previous or next drink, delete removes it.\n\n## Run it\n\nNo build, no dependencies. Serve the folder with any static server:\n\n```bash\nnpx serve .\n```\n\nor `python3 -m http.server`, then open the address it prints. (Opening\n`index.html` straight from disk won't work, because browsers block ES modules\non `file:\u002F\u002F`.)\n\nTo put it in your own page:\n\n```html\n\u003Cdiv id=\"caffeine\" style=\"height: 100vh\">\u003C\u002Fdiv>\n\u003Cscript type=\"module\">\n  import { mount } from '.\u002Fcaffeine.js';\n  mount(document.getElementById('caffeine'));\n\u003C\u002Fscript>\n```\n\n`mount(el, { widget: true })` shows it as a small card that opens full screen\n(what `index.html` does). `mount(el, { hash: false })` turns off the URL state.\n\n## The model\n\nA one-compartment model with first-order absorption, summed over every drink:\n\n```\nC(t) = Σ dose · kₐ \u002F (kₐ − kₑ) · (e^(−kₑ·d) − e^(−kₐ·d))\n```\n\nwhere `d` is the hours since that drink, `kₐ = ln 2 \u002F 0.25 h` (absorbed with a\n15-minute half-life, so it peaks about an hour after drinking) and\n`kₑ = ln 2 \u002F 5 h` (a 5-hour elimination half-life).\n\nCaffeine per drink, from typical Mayo Clinic and USDA figures:\n\n| Drink | Reference serving | Caffeine |\n| --- | --- | --- |\n| Coffee (brewed) | 240 ml | 95 mg |\n| Espresso | 30 ml | 63 mg |\n| Cold brew | 473 ml | 205 mg |\n| Black tea | 240 ml | 47 mg |\n| Green tea | 240 ml | 28 mg |\n| Cola | 355 ml | 34 mg |\n| Energy drink | 250 ml | 80 mg |\n\nOther volumes scale linearly. The 50 mg \"sleep line\" is a rough rule of\nthumb, not a medical threshold.\n\n## Not medical advice\n\nReal drinks vary a lot (a coffee can be 60 mg or 200 mg), and so do people:\nthe half-life runs from about 3 to 7 hours in healthy adults and is longer\nduring pregnancy, with some medications, and shorter in smokers. Use it to get\na feel for the shape of your day, not to make health decisions.\n\n## Licence\n\nMIT. Made by [Charles Postiaux](https:\u002F\u002Fx.com\u002FPostiauxCharles) at\n[Baobun Studio](https:\u002F\u002Fbaobun.studio).\n","Caffeine Day 是一个轻量级、无依赖的咖啡因代谢可视化工具，用于估算睡前体内残留咖啡因量。它基于单室药代动力学模型（吸收半衰期15分钟，消除半衰期5小时），通过点阵图动态呈现全天各饮品摄入后的累积代谢曲线；支持拖拽添加\u002F调整饮品类型与时间、自定义就寝时间，并实时计算低于50mg残留的安全末次饮用时限。所有状态保存于URL中，便于分享与复现。适用于关注睡眠质量、尝试优化咖啡因摄入时机的普通用户及健康习惯追踪场景。",2,"2026-11-24 04:43:25","CREATED_QUERY"]