<!-- Copyright (c) 2026 Globefin. Released under the MIT License. -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Before the Cone — a hurricane fund for a Lake Charles family</title>
<style>
:root { --sign: #1d4f91; --signdk: #143867; --white: #fff; --alert: #f28c28; --gulf: #2a8c8c; --land: #d9e4d3; --mud: #b9c6b1; --ink: #1d2733; --mute: #5d6b78; --line: #d6dee6; --paper: #f4f7f9; --red: #c0392b; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.5; }
.sign, h1, h2, .num { font-family: "Bahnschrift", "DIN Alternate", "DIN Condensed", "Arial Narrow", "Roboto Condensed", sans-serif; }
header { background: var(--sign); color: #fff; }
header .in { max-width: 1120px; margin: 0 auto; padding: 1.4rem 1.3rem 1.3rem; display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; }
.plate { border: 3px solid #fff; border-radius: 10px; padding: .5rem .8rem; text-align: center; line-height: 1.05; }
.plate svg { width: 46px; height: 46px; display: block; margin: 0 auto .2rem; }
.plate span { font-size: .78rem; letter-spacing: .04em; }
header h1 { margin: 0; font-size: 2.5rem; font-weight: 700; letter-spacing: .01em; }
header p { margin: .2rem 0 0; color: #d6e3f5; max-width: 700px; }
header .who { font-size: .85rem; color: #ffd8ad; margin-top: .4rem; }
main { max-width: 1120px; margin: 0 auto; padding: 1.4rem 1.3rem 2rem; }
h2 { font-size: 1.5rem; margin: 0 0 .2rem; font-weight: 700; }
.sub { color: var(--mute); font-size: .9rem; margin: 0 0 .8rem; }
.top { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,.65fr); gap: 1.6rem; }
/* map */
.map { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem; }
.map svg { width: 100%; height: auto; display: block; }
.mapscroll { overflow-x: auto; }
@media (max-width: 640px) { .map svg { min-width: 600px; } }
.dest { cursor: pointer; }
.dest:focus { outline: none; }
.dest:focus circle.ring { stroke: var(--alert); stroke-width: 4; }
.trip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .6rem; margin-top: .7rem; }
.trip label { font-size: .78rem; color: var(--mute); display: block; }
.trip input { width: 100%; font: inherit; font-size: .95rem; padding: .35rem .45rem; border: 1px solid var(--line); border-radius: 6px; }
.step { display: flex; align-items: center; gap: .3rem; }
.step button { font: inherit; width: 2rem; height: 2rem; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.step b { min-width: 2rem; text-align: center; font-variant-numeric: tabular-nums; }
/* gauge */
.gauge { background: var(--ink); color: #fff; border-radius: 12px; padding: 1.1rem 1.2rem; display: grid; grid-template-columns: 90px 1fr; gap: 1rem; }
.gauge svg { width: 90px; height: 260px; }
.gauge .num { font-size: 2.6rem; line-height: 1; color: var(--alert); }
.gauge .lbl { font-size: .9rem; color: #c7d2dc; }
.gauge .row { margin-top: .9rem; }
.gauge input { width: 100%; font: inherit; padding: .35rem .45rem; border-radius: 6px; border: 0; }
.gauge .row label { font-size: .8rem; color: #c7d2dc; display: block; margin-bottom: .2rem; }
/* go-bag */
.bag { margin-top: 2rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.tile { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .7rem .7rem .55rem; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.tile.in { border-color: var(--sign); background: #eef4fc; }
.tile svg { width: 34px; height: 34px; display: block; margin-bottom: .3rem; }
.tile .nm { font-size: .88rem; display: block; line-height: 1.25; }
.tile .pr { display: flex; align-items: center; gap: .2rem; margin-top: .35rem; font-size: .85rem; }
.tile .pr input { width: 4.6rem; font: inherit; font-size: .85rem; padding: .15rem .3rem; border: 1px solid var(--line); border-radius: 5px; }
.tile .chk { position: absolute; top: .5rem; right: .55rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; color: #fff; }
.tile.in .chk { background: var(--sign); border-color: var(--sign); }
/* insurance */
.ins { margin-top: 2rem; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.ins label { font-size: .8rem; color: var(--mute); display: block; }
.ins input, .ins select { width: 100%; font: inherit; padding: .4rem .45rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.tally { margin-top: 2rem; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 1.6rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
td { padding: .4rem .2rem; border-bottom: 1px solid var(--line); }
td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); font-size: 1.05rem; }
.alert { background: #fff3e6; border-left: 5px solid var(--alert); border-radius: 8px; padding: .7rem .9rem; font-size: .92rem; margin-bottom: .6rem; }
.bad { color: var(--red); font-weight: 600; }
.work { font-size: .88rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.toolbar button { font: inherit; font-size: .92rem; border-radius: 8px; padding: .5rem 1rem; cursor: pointer; border: 2px solid var(--sign); background: #fff; color: var(--sign); }
.toolbar button.primary { background: var(--sign); color: #fff; }
button:focus-visible, input:focus-visible, select:focus-visible, .tile:focus-visible { outline: 3px solid var(--alert); outline-offset: 2px; }
footer { max-width: 1120px; margin: 0 auto; padding: 0 1.3rem 2.4rem; font-size: .8rem; color: var(--mute); }
@media (max-width: 880px) {
.top, .tally { grid-template-columns: minmax(0,1fr); } .ins { grid-template-columns: 1fr 1fr; } .trip { grid-template-columns: 1fr 1fr; }
header .in { grid-template-columns: 1fr; } header h1 { font-size: 2rem; }
}
@media print { .toolbar, .step button { display: none !important; } }
</style>
</head>
<body>
<header>
<div class="in">
<div class="plate sign" aria-hidden="true">
<svg viewBox="0 0 48 48"><circle cx="24" cy="24" r="22" fill="none" stroke="#fff" stroke-width="2"/><path d="M24 10c-8 0-12 6-12 11 0 4 3 7 7 7-3-2-4-5-3-8 2 3 6 4 8 4 8 0 12-6 12-11 0-4-3-7-7-7 3 2 4 5 3 8-2-3-6-4-8-4z" fill="#fff"/></svg>
<span>Evacuation<br>route</span>
</div>
<div>
<h1>Before the Cone</h1>
<p>After a storm, the first bills come before the insurance check: the hurricane deductible, a week away from home,
and the gas to get there. Plan where you'd go and what you'd take, and see what to set aside each month before June 1.</p>
<div class="who">Built for a family of four in Lake Charles, Louisiana, with a dog and a homeowners policy.</div>
</div>
</div>
</header>
<main>
<div class="top">
<section>
<h2>Where would you go?</h2>
<p class="sub">Tap a city. Miles are rough one-way road distances from Lake Charles; check your own route.</p>
<div class="map">
<div class="mapscroll"><svg id="map" viewBox="0 0 640 380" role="group" aria-label="Map of evacuation destinations"></svg></div>
<div class="trip">
<div><label for="miles">One-way miles</label><input id="miles" type="number" min="0" step="5"></div>
<div><label for="rate">Hotel, per night</label><input id="rate" type="number" min="0" step="5"></div>
<div><label>Nights away</label><div class="step"><button type="button" id="nMinus" aria-label="One fewer night">−</button><b id="nights">0</b><button type="button" id="nPlus" aria-label="One more night">+</button></div></div>
<div><label>Hotel rooms</label><div class="step"><button type="button" id="rMinus" aria-label="One fewer room">−</button><b id="rooms">0</b><button type="button" id="rPlus" aria-label="One more room">+</button></div></div>
<div><label for="people">People</label><input id="people" type="number" min="0" step="1"></div>
<div><label for="pets">Pets</label><input id="pets" type="number" min="0" step="1"></div>
<div><label for="mpg">Car mpg</label><input id="mpg" type="number" min="0" step="1"></div>
<div><label for="gas">Gas, $/gal</label><input id="gas" type="number" min="0" step="0.05"></div>
</div>
</div>
</section>
<section class="gauge" aria-live="polite">
<svg id="gaugeSvg" viewBox="0 0 90 260" aria-hidden="true"></svg>
<div>
<div class="lbl">Set aside each month</div>
<div class="num" id="perMonth">$0</div>
<div class="lbl" id="perMonthL"></div>
<div class="row"><label for="saved">Already saved</label><input id="saved" type="number" min="0" step="50"></div>
<div class="row"><label for="target">Have it by</label><input id="target" type="date"></div>
<div class="row lbl">The Atlantic hurricane season runs June 1 to November 30.</div>
</div>
</section>
</div>
<section class="bag">
<h2>Pack the go-bag</h2>
<p class="sub">Tap what you'd need to buy. Change any price to match your store.</p>
<div class="tiles" id="tiles"></div>
</section>
<section class="ins">
<div><label for="dwell">Dwelling coverage ($)</label><input id="dwell" type="number" min="0" step="1000"></div>
<div><label for="dedType">Hurricane deductible is</label><select id="dedType"><option value="pct">a % of coverage</option><option value="flat">a flat amount</option></select></div>
<div><label for="ded" id="dedL">Deductible</label><input id="ded" type="number" min="0" step="0.5"></div>
<div><label for="flood">Flood insurance?</label><select id="flood"><option value="yes">Yes</option><option value="no">No</option></select></div>
<div id="floodBox"><label for="floodDed">Flood deductible ($)</label><input id="floodDed" type="number" min="0" step="250"></div>
<div><label for="lostPay">Pay you'd lose while away ($)</label><input id="lostPay" type="number" min="0" step="50"></div>
<div><label for="food">Food, per person per day ($)</label><input id="food" type="number" min="0" step="1"></div>
<div><label for="petFee">Pet fee, per pet per night ($)</label><input id="petFee" type="number" min="0" step="5"></div>
</section>
<div class="tally">
<section>
<h2>Cash to have on hand</h2>
<table><tbody id="lines"></tbody></table>
</section>
<section>
<div id="alerts"></div>
<div class="work" id="work"></div>
<div class="toolbar">
<button type="button" class="primary" id="saveBtn">Save my plan</button>
<button type="button" id="openBtn">Open a saved plan</button>
<button type="button" id="printBtn">Print</button>
<button type="button" id="resetBtn">Start over</button>
<input type="file" id="fileIn" accept=".json,application/json" hidden>
</div>
<div id="fileMsg" role="status" style="margin-top:.6rem;font-size:.9rem;"></div>
</section>
</div>
</main>
<footer>
<p><b>For education only.</b> Not insurance, financial or emergency-management advice. Your policy's actual terms decide
what you pay — read your declarations page or ask your agent. In an emergency, follow official evacuation orders.
Nothing you type leaves this page: there's no account, and nothing is sent anywhere. Made for the Globefin Demos
gallery as an example. No outside code was used.</p>
</footer>
<script>
(function () {
"use strict";
var APP = "globefin-before-the-cone", VERSION = 2, NS = "http://www.w3.org/2000/svg";
// Map positions are a stylised layout, not to scale. Miles are rough one-way road distances.
var CITIES = [
{ id: "lafayette", name: "Lafayette", x: 400, y: 238, miles: 75, rate: 115, side: "left" },
{ id: "batonrouge", name: "Baton Rouge", x: 505, y: 215, miles: 130, rate: 125, side: "below" },
{ id: "alexandria", name: "Alexandria", x: 365, y: 120, miles: 100, rate: 105 },
{ id: "shreveport", name: "Shreveport", x: 255, y: 40, miles: 190, rate: 110 },
{ id: "houston", name: "Houston", x: 130, y: 268, miles: 140, rate: 135 },
{ id: "dallas", name: "Dallas", x: 70, y: 70, miles: 300, rate: 140 }
];
var HOME = { x: 285, y: 262 };
var BAG = [
{ id: "water", name: "Water, 1 gal per person per day", price: 40, icon: '<path d="M17 4c-5 7-9 12-9 17a9 9 0 0 0 18 0c0-5-4-10-9-17z" fill="#2a8c8c"/>' },
{ id: "food", name: "Food that keeps, a week", price: 120, icon: '<rect x="6" y="10" width="22" height="18" rx="2" fill="#f28c28"/><rect x="9" y="6" width="16" height="6" rx="1" fill="#1d4f91"/>' },
{ id: "light", name: "Flashlights & batteries", price: 35, icon: '<rect x="6" y="13" width="14" height="9" rx="2" fill="#1d2733"/><path d="M20 12l9-4v18l-9-4z" fill="#f2c94c"/>' },
{ id: "first", name: "First-aid kit", price: 30, icon: '<rect x="5" y="9" width="24" height="18" rx="3" fill="#c0392b"/><path d="M15 13h4v4h4v4h-4v4h-4v-4h-4v-4h4z" fill="#fff"/>' },
{ id: "meds", name: "Prescription refills", price: 60, icon: '<rect x="8" y="6" width="18" height="24" rx="3" fill="#fff" stroke="#1d4f91" stroke-width="2"/><path d="M12 14h10M12 19h10M12 24h6" stroke="#1d4f91" stroke-width="2"/>' },
{ id: "power", name: "Battery bank for phones", price: 40, icon: '<rect x="9" y="5" width="16" height="26" rx="3" fill="#1d2733"/><path d="M18 10l-5 9h4l-2 7 6-10h-4z" fill="#f2c94c"/>' },
{ id: "docs", name: "Waterproof pouch for documents", price: 20, icon: '<rect x="6" y="8" width="22" height="20" rx="2" fill="#a7c4e6"/><path d="M10 14h14M10 19h14M10 24h9" stroke="#1d4f91" stroke-width="2"/>' },
{ id: "pet", name: "Pet food, crate & records", price: 70, icon: '<circle cx="17" cy="21" r="6" fill="#8b5a2b"/><circle cx="9" cy="13" r="3" fill="#8b5a2b"/><circle cx="15" cy="9" r="3" fill="#8b5a2b"/><circle cx="21" cy="9" r="3" fill="#8b5a2b"/><circle cx="26" cy="13" r="3" fill="#8b5a2b"/>' },
{ id: "cash", name: "Cash on hand (ATMs go down)", price: 300, icon: '<rect x="4" y="10" width="26" height="15" rx="2" fill="#5a9e5a"/><circle cx="17" cy="17.5" r="4" fill="#d9f0d9"/>' },
{ id: "fuel", name: "Generator fuel & cans", price: 90, icon: '<path d="M8 10h14l6 6v14H8z" fill="#c0392b"/><rect x="11" y="5" width="8" height="5" fill="#1d2733"/>' },
{ id: "tarp", name: "Tarps & roofing nails", price: 60, icon: '<path d="M4 22l13-12 13 12z" fill="#2f6fb7"/><path d="M8 22v6h18v-6" fill="#1d4f91"/>' }
];
function nextJune1() { var d = new Date(), y = d.getFullYear(); if (d >= new Date(y, 5, 1)) y += 1; return y + "-06-01"; }
function sample() {
return { city: "batonrouge", miles: 130, rate: 125, nights: 7, rooms: 1, people: 4, pets: 1, mpg: 24, gas: 3.10,
dwell: 220000, dedType: "pct", ded: 2, flood: "yes", floodDed: 1250, lostPay: 900, food: 30, petFee: 25,
saved: 1200, target: nextJune1(),
bag: { water: { in: true, price: 40 }, food: { in: true, price: 120 }, light: { in: true, price: 35 }, first: { in: false, price: 30 },
meds: { in: true, price: 60 }, power: { in: true, price: 40 }, docs: { in: true, price: 20 }, pet: { in: true, price: 70 },
cash: { in: true, price: 300 }, fuel: { in: false, price: 90 }, tarp: { in: false, price: 60 } } };
}
var state = sample(), dirty = false;
var $ = function (id) { return document.getElementById(id); };
var money = function (n) { return "$" + Math.round(n).toLocaleString("en-US"); };
function num(v) { var n = parseFloat(v); return isFinite(n) ? n : 0; }
function pos(n) { return Math.max(0, n); }
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return {"&":"&","<":"<",">":">","\"":"""}[c]; }); }
function el(tag, a, p) { var e = document.createElementNS(NS, tag); for (var k in a) e.setAttribute(k, a[k]); if (p) p.appendChild(e); return e; }
// ---------- the map ----------
function drawMap() {
var svg = $("map"); svg.innerHTML = "";
el("rect", { width: 640, height: 380, fill: "#d9e4d3" }, svg);
// the Gulf and its coast
el("path", { d: "M0 300 C80 290 140 296 200 300 C260 304 300 292 340 296 C390 300 430 286 480 292 C540 298 590 284 640 290 L640 380 L0 380Z", fill: "#7fb8c4" }, svg);
el("path", { d: "M0 300 C80 290 140 296 200 300 C260 304 300 292 340 296 C390 300 430 286 480 292 C540 298 590 284 640 290", fill: "none", stroke: "#2a8c8c", "stroke-width": 2 }, svg);
// the cone of a storm still days out, for scale
el("path", { d: "M330 372 L250 300 Q300 270 360 300 Z", fill: "#f28c28", opacity: .28 }, svg);
el("path", { d: "M330 372 L330 320", stroke: "#f28c28", "stroke-width": 2, "stroke-dasharray": "4 4" }, svg);
var ct = el("text", { x: 345, y: 368, "font-size": 11, fill: "#8a4a10" }, svg); ct.textContent = "a storm's cone, days out";
var gt = el("text", { x: 470, y: 340, "font-size": 13, fill: "#1d2733", "font-family": "Bahnschrift, Arial Narrow, sans-serif" }, svg); gt.textContent = "Gulf of Mexico";
// state line, Sabine River-ish
el("path", { d: "M215 0 L215 120 C210 180 225 230 218 300", fill: "none", stroke: "#8a9a84", "stroke-width": 1.5, "stroke-dasharray": "6 5" }, svg);
var tx = el("text", { x: 160, y: 190, "font-size": 12, fill: "#5d6b78" }, svg); tx.textContent = "Texas";
var la = el("text", { x: 470, y: 150, "font-size": 12, fill: "#5d6b78" }, svg); la.textContent = "Louisiana";
// route to the chosen city
var c = CITIES.filter(function (x) { return x.id === state.city; })[0];
if (c) {
el("path", { d: "M" + HOME.x + " " + HOME.y + " Q" + ((HOME.x + c.x) / 2) + " " + (Math.min(HOME.y, c.y) - 30) + " " + c.x + " " + c.y,
fill: "none", stroke: "#1d4f91", "stroke-width": 4, "stroke-linecap": "round" }, svg);
}
// home
el("circle", { cx: HOME.x, cy: HOME.y, r: 9, fill: "#c0392b", stroke: "#fff", "stroke-width": 3 }, svg);
var h = el("text", { x: HOME.x, y: HOME.y + 26, "text-anchor": "middle", "font-size": 14, "font-weight": 700, fill: "#1d2733", "font-family": "Bahnschrift, Arial Narrow, sans-serif" }, svg); h.textContent = "Lake Charles";
CITIES.forEach(function (city) {
var on = city.id === state.city;
var g = el("g", { "class": "dest", tabindex: 0, role: "button", "aria-pressed": on ? "true" : "false", "aria-label": city.name + ", about " + city.miles + " miles" }, svg);
el("circle", { "class": "ring", cx: city.x, cy: city.y, r: on ? 11 : 8, fill: on ? "#1d4f91" : "#fff", stroke: "#1d4f91", "stroke-width": 3 }, g);
var lx = city.side === "left" ? city.x - 15 : city.side === "below" ? city.x : city.x + 15;
var ly = city.side === "below" ? city.y + 30 : city.y + 5;
var anc = city.side === "left" ? "end" : city.side === "below" ? "middle" : "start";
var t = el("text", { x: lx, y: ly, "text-anchor": anc, "font-size": 14, fill: "#1d2733", "font-weight": on ? 700 : 400, "font-family": "Bahnschrift, Arial Narrow, sans-serif" }, g);
t.textContent = city.name + " · " + city.miles + " mi";
function pick() { state.city = city.id; state.miles = city.miles; state.rate = city.rate; dirty = true; fill(); var again = $("map").querySelectorAll(".dest")[CITIES.indexOf(city)]; if (again) again.focus(); }
g.addEventListener("click", pick);
g.addEventListener("keydown", function (e) { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); pick(); } });
});
}
// ---------- the go-bag ----------
function drawBag() {
var box = $("tiles"); box.innerHTML = "";
BAG.forEach(function (item) {
var b = state.bag[item.id] || { in: false, price: item.price };
state.bag[item.id] = b;
var t = document.createElement("div"); t.className = "tile" + (b.in ? " in" : ""); t.tabIndex = 0; t.setAttribute("role", "checkbox"); t.setAttribute("aria-checked", b.in ? "true" : "false");
t.setAttribute("aria-label", item.name);
t.innerHTML = '<span class="chk" aria-hidden="true">' + (b.in ? "✓" : "") + '</span><svg viewBox="0 0 34 34" aria-hidden="true">' + item.icon + '</svg>' +
'<span class="nm">' + esc(item.name) + '</span><span class="pr">$<input type="number" min="0" step="5" value="' + b.price + '" aria-label="Price of ' + esc(item.name) + '"></span>';
function toggle() { b.in = !b.in; dirty = true; drawBag(); update(); var again = $("tiles").children[BAG.indexOf(item)]; if (again) again.focus(); }
t.addEventListener("click", function (e) { if (e.target.tagName !== "INPUT") toggle(); });
t.addEventListener("keydown", function (e) { if ((e.key === "Enter" || e.key === " ") && e.target === t) { e.preventDefault(); toggle(); } });
t.querySelector("input").addEventListener("input", function () { b.price = num(this.value); dirty = true; update(); });
box.appendChild(t);
});
}
// ---------- the rain gauge ----------
function drawGauge(saved, goal) {
var svg = $("gaugeSvg"); svg.innerHTML = "";
var top = 20, bot = 240, f = goal > 0 ? Math.min(1, saved / goal) : 1;
el("rect", { x: 22, y: top, width: 46, height: bot - top, rx: 8, fill: "none", stroke: "#c7d2dc", "stroke-width": 2 }, svg);
var h = (bot - top - 6) * f;
el("rect", { x: 25, y: bot - 3 - h, width: 40, height: h, rx: 6, fill: "#2a8c8c" }, svg);
for (var i = 1; i < 4; i++) { var y = top + (bot - top) * i / 4; el("line", { x1: 68, x2: 80, y1: y, y2: y, stroke: "#c7d2dc" }, svg); }
var t = el("text", { x: 45, y: 14, "text-anchor": "middle", fill: "#fff", "font-size": 12 }, svg); t.textContent = Math.round(f * 100) + "%";
}
function monthsUntil(iso) {
var t = new Date(iso + "T00:00:00"), now = new Date(); if (isNaN(t)) return null;
var m = (t.getFullYear() - now.getFullYear()) * 12 + (t.getMonth() - now.getMonth()); if (t.getDate() < now.getDate()) m -= 1; return m;
}
function update() {
var s = state;
var wind = s.dedType === "pct" ? pos(s.dwell) * pos(s.ded) / 100 : pos(s.ded);
var flood = s.flood === "yes" ? pos(s.floodDed) : 0;
var hotel = pos(s.nights) * pos(s.rooms) * pos(s.rate);
var pets = pos(s.nights) * pos(s.pets) * pos(s.petFee);
var gas = pos(s.mpg) > 0 ? pos(s.miles) * 2 / s.mpg * pos(s.gas) : 0;
var food = pos(s.people) * pos(s.nights) * pos(s.food);
var bag = BAG.reduce(function (t, it) { var b = s.bag[it.id]; return t + (b && b.in ? pos(b.price) : 0); }, 0);
var goal = wind + flood + hotel + pets + gas + food + pos(s.lostPay) + bag;
var gap = Math.max(0, goal - pos(s.saved)), months = monthsUntil(s.target);
var city = CITIES.filter(function (c) { return c.id === s.city; })[0];
var rows = [
["Hurricane deductible" + (s.dedType === "pct" ? " (" + pos(s.ded) + "% of " + money(s.dwell) + ")" : ""), wind],
["Flood deductible", flood],
["Hotel" + (city ? " in " + city.name : "") + " (" + pos(s.nights) + " nights × " + pos(s.rooms) + " × " + money(s.rate) + ")", hotel],
["Pet fees", pets],
["Gas (" + pos(s.miles) + " mi each way ÷ " + pos(s.mpg) + " mpg × $" + pos(s.gas).toFixed(2) + ")", gas],
["Food (" + pos(s.people) + " people × " + pos(s.nights) + " days × " + money(s.food) + ")", food],
["Pay lost while away", pos(s.lostPay)],
["Go-bag", bag]
];
$("lines").innerHTML = rows.map(function (r) { return "<tr><td>" + esc(r[0]) + "</td><td>" + money(r[1]) + "</td></tr>"; }).join("") +
'<tr class="tot"><td>Have this in cash by ' + new Date(s.target + "T00:00:00").toLocaleDateString("en-US", { month: "long", day: "numeric" }) + '</td><td>' + money(goal) + "</td></tr>";
if (gap === 0) { $("perMonth").textContent = "Ready"; $("perMonthL").textContent = "Your fund already covers it."; }
else if (months === null) { $("perMonth").textContent = money(gap); $("perMonthL").textContent = "still to save — pick a date"; }
else if (months < 1) { $("perMonth").textContent = money(gap); $("perMonthL").textContent = "short, with under a month to go"; }
else { $("perMonth").textContent = money(Math.ceil(gap / months)); $("perMonthL").textContent = "for " + months + " month" + (months === 1 ? "" : "s") + " to reach " + money(goal); }
drawGauge(pos(s.saved), goal);
var al = [];
if (s.flood === "no") al.push("<b>Standard homeowners policies don't cover flood.</b> Flood policies usually have a 30-day waiting period, so don't wait until a storm is in the Gulf.");
if (s.dedType === "pct" && s.ded > 10) al.push('<span class="bad">A hurricane deductible over 10% is unusual — check your declarations page.</span>');
if (s.mpg <= 0 && s.miles > 0) al.push('<span class="bad">Enter your car\'s mpg to count the gas.</span>');
$("alerts").innerHTML = al.map(function (a) { return '<div class="alert">' + a + "</div>"; }).join("");
$("work").innerHTML = "<b>How it's worked out.</b> Every line shows its own arithmetic. Gas counts the round trip (miles × 2). The total is the cash you'd need before any insurance payment arrives. " +
"The monthly amount is what's still missing (" + money(gap) + ") divided by the whole months left before your date, rounded up to the dollar.";
$("nights").textContent = pos(s.nights); $("rooms").textContent = pos(s.rooms);
}
var NUMS = ["miles","rate","people","pets","mpg","gas","dwell","ded","floodDed","lostPay","food","petFee","saved"];
function fill() {
NUMS.forEach(function (k) { $(k).value = state[k]; });
$("dedType").value = state.dedType; $("flood").value = state.flood; $("target").value = state.target;
$("dedL").textContent = state.dedType === "pct" ? "Deductible (%)" : "Deductible ($)";
$("floodBox").style.visibility = state.flood === "yes" ? "visible" : "hidden";
drawMap(); drawBag(); update();
}
NUMS.forEach(function (k) { $(k).addEventListener("input", function () { state[k] = num(this.value); if (k === "miles" || k === "rate") { state.city = ""; drawMap(); } dirty = true; update(); }); });
$("dedType").addEventListener("change", function () { state.dedType = this.value; dirty = true; fill(); });
$("flood").addEventListener("change", function () { state.flood = this.value; dirty = true; fill(); });
$("target").addEventListener("change", function () { state.target = this.value; dirty = true; update(); });
function stepper(id, key, d) { $(id).addEventListener("click", function () { state[key] = Math.max(0, pos(state[key]) + d); dirty = true; update(); }); }
stepper("nMinus", "nights", -1); stepper("nPlus", "nights", 1); stepper("rMinus", "rooms", -1); stepper("rPlus", "rooms", 1);
$("saveBtn").addEventListener("click", function () {
var blob = new Blob([JSON.stringify({ app: APP, version: VERSION, saved: new Date().toISOString(), data: state }, null, 2)], { type: "application/json" });
var a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "hurricane-plan.json";
document.body.appendChild(a); a.click(); a.remove(); setTimeout(function () { URL.revokeObjectURL(a.href); }, 1000);
dirty = false; $("fileMsg").textContent = "Saved. Open it again each spring to update the numbers.";
});
$("openBtn").addEventListener("click", function () { $("fileIn").click(); });
$("fileIn").addEventListener("change", function () {
var f = this.files[0]; this.value = ""; if (!f) return;
var r = new FileReader();
r.onload = function () {
var d; try { d = JSON.parse(r.result); } catch (e) { d = null; }
function bad(why) { $("fileMsg").innerHTML = '<span class="bad">That file can\'t be opened here — ' + esc(why) + '.</span> Nothing on screen was changed.'; }
if (!d || d.app !== APP) return bad("it isn't a Before the Cone file");
var s = d.data; if (!s || typeof s !== "object") return bad("the plan is missing");
var c = sample();
NUMS.concat(["nights","rooms"]).forEach(function (k) { c[k] = num(s[k]); });
c.city = CITIES.some(function (x) { return x.id === s.city; }) ? s.city : "";
c.dedType = s.dedType === "flat" ? "flat" : "pct"; c.flood = s.flood === "no" ? "no" : "yes";
c.target = /^\d{4}-\d{2}-\d{2}$/.test(s.target || "") ? s.target : nextJune1();
BAG.forEach(function (it) { var b = s.bag && s.bag[it.id]; c.bag[it.id] = { in: !!(b && b.in), price: b ? num(b.price) : it.price }; });
if (dirty && !confirm("Replace what's on screen with the saved plan? Unsaved changes will be lost.")) return;
state = c; dirty = false; fill(); $("fileMsg").textContent = "Opened your saved plan.";
};
r.onerror = function () { $("fileMsg").innerHTML = '<span class="bad">That file couldn\'t be read.</span> Nothing on screen was changed.'; };
r.readAsText(f);
});
$("printBtn").addEventListener("click", function () { window.print(); });
$("resetBtn").addEventListener("click", function () {
if (dirty && !confirm("Start over with the example household? Unsaved changes will be lost.")) return;
state = sample(); dirty = false; fill(); $("fileMsg").textContent = "";
});
window.addEventListener("beforeunload", function (e) { if (dirty) { e.preventDefault(); e.returnValue = ""; } });
fill();
// On a narrow screen the map scrolls sideways; start with Lake Charles in view.
(function () { var w = document.querySelector(".mapscroll"); if (w && w.scrollWidth > w.clientWidth) w.scrollLeft = (w.scrollWidth - w.clientWidth) * 0.55; })();
})();
</script>
</body>
</html>
Websites this page contacts when it runs — fonts, chart libraries, data. Found by reading its source.
Published on Globefin under the MIT License. You may copy, change, and reuse this page, including commercially — just keep the notice below with it.
Copyright © 2026 Shane Hadden. Licensed under the MIT License. Published on Globefin.
Provided as is, without warranty. Any external libraries it loads keep their own licences. Terms →
Scripts run, but the demo has its own throwaway origin. It can't read your session or cookies, can't reach the page around it, and can't navigate your tab. Don't enter real passwords or personal data into any demo.