claude-opus-5 @ max · CC
CCmax
- config
- claude-opus-5-eff-max--cli--claude-code--dev
- batch
- 2026-07-19--unified
- transport
- claude-code-cli-headless
- protocol
- cli · plan
- served model
- claude-opus-5
- 采集于
- 2026年7月18日 11:54 · N=2
variant
live
slot 0 · P-q · sandboxed iframe

截图是 similarity 通道测量时的原始像素。运行 live 会在 sandboxed iframe 中重新执行原始输出;渲染结果取决于你的浏览器和字体,不保证与测量像素一致。
similarity 邻居
最近
claude-opus-5 @xhigh · CC0.67claude-fable-5 @xhigh · CC0.65claude-opus-5 @high · CC0.63claude-fable-5 · CC0.63qwen3.7-max · go0.62最远
qwen3.6-plus · go0.48gemini-3.1-pro-preview @low · api0.51claude-haiku-4-5 @max · CC0.51claude-sonnet-4 · kiro0.51hy3-free · api0.51限于 session 2026-07-19--unified
similarity 衡量本 session 内的趋同程度 —— 不是质量。
Fidelity —— 卡片展示的数据对不对?
- namematch
- conditionmatch
- datematch
- max tempmismatch展示值:21.2
- min tempmatch展示值:16
- hourlyambiguouscoverage · 0 命中 · 0 不符 · 24 未展示
- request sidematch0 处违规
extractor fidelity-extractor-v1+Berlin-2026-07-15
源码 —— 原始模型输出,一字节未改
下载 card.html<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=1280, initial-scale=1">
<title>Weather</title>
<style>
*, *::before, *::after { box-sizing: border-box; }
:root {
--text: #eef2fb;
--muted: rgba(226, 234, 250, .62);
--faint: rgba(226, 234, 250, .40);
--stroke: rgba(255, 255, 255, .09);
--accent: #8fb8ff;
--glow: 143, 184, 255;
--p1: #2a3760;
--p2: #161d38;
--ic1: #DCE6F6;
--ic2: #A9B8D4;
--font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
Roboto, "Helvetica Neue", Arial, sans-serif;
--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
html, body { height: 100%; }
body {
margin: 0;
padding: 30px;
display: flex;
align-items: center;
justify-content: center;
font-family: var(--font);
color: var(--text);
background-color: #070a14;
background-image:
radial-gradient(920px 620px at 12% -12%, rgba(var(--glow), .22), transparent 62%),
radial-gradient(760px 520px at 104% 112%, rgba(120, 140, 255, .16), transparent 60%),
linear-gradient(180deg, #0b1020 0%, #070a14 62%, #05070f 100%);
background-attachment: fixed;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
body::after {
content: "";
position: fixed;
inset: 0;
pointer-events: none;
opacity: .035;
mix-blend-mode: overlay;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stage { width: min(1168px, 100%); }
.card {
position: relative;
border-radius: 26px;
padding: 30px 32px 32px;
border: 1px solid var(--stroke);
background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .022));
box-shadow:
0 44px 90px -34px rgba(0, 0, 0, .85),
0 2px 0 0 rgba(255, 255, 255, .05) inset,
0 -1px 0 0 rgba(0, 0, 0, .3) inset;
backdrop-filter: blur(22px) saturate(125%);
-webkit-backdrop-filter: blur(22px) saturate(125%);
}
/* ---------- header ---------- */
.head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 24px;
padding-bottom: 22px;
margin-bottom: 22px;
border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.name {
margin: 0;
font-size: 34px;
font-weight: 620;
letter-spacing: -.022em;
line-height: 1.1;
}
.place .meta {
margin: 8px 0 0;
font-size: 12.5px;
letter-spacing: .04em;
color: var(--faint);
font-variant-numeric: tabular-nums;
}
.when { text-align: right; }
.badge {
display: inline-flex;
align-items: center;
gap: 7px;
height: 24px;
padding: 0 11px;
border-radius: 999px;
font-size: 11px;
font-weight: 600;
letter-spacing: .1em;
text-transform: uppercase;
color: var(--accent);
background: rgba(var(--glow), .12);
border: 1px solid rgba(var(--glow), .28);
}
.badge::before {
content: "";
width: 5px;
height: 5px;
border-radius: 50%;
background: currentColor;
box-shadow: 0 0 8px currentColor;
}
.when .date {
margin: 10px 0 0;
font-size: 17px;
font-weight: 550;
letter-spacing: -.01em;
color: rgba(238, 242, 251, .92);
}
.when .iso {
margin: 5px 0 0;
font-family: var(--mono);
font-size: 11.5px;
color: var(--faint);
}
/* ---------- layout ---------- */
.body {
display: grid;
grid-template-columns: 396px minmax(0, 1fr);
gap: 20px;
align-items: stretch;
}
/* ---------- sky panel ---------- */
.sky {
position: relative;
overflow: hidden;
min-height: 400px;
border-radius: 20px;
padding: 28px 26px 26px;
border: 1px solid rgba(255, 255, 255, .09);
background: linear-gradient(158deg, var(--p1) 0%, var(--p2) 78%);
box-shadow: 0 22px 44px -26px rgba(0, 0, 0, .8);
transition: background .5s ease;
}
.sky::before {
content: "";
position: absolute;
left: -18%;
right: -18%;
top: -46%;
height: 78%;
background: radial-gradient(48% 56% at 50% 62%, rgba(var(--glow), .5), transparent 70%);
}
.sky::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 42%);
pointer-events: none;
}
.sky-inner {
position: relative;
z-index: 1;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
.icon {
display: block;
filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45));
}
.icon .c1 { fill: var(--ic1); }
.icon .c2f { fill: var(--ic2); }
.icon .c2 { fill: none; stroke: var(--ic2); stroke-width: 3.2; stroke-linecap: round; }
.cond {
margin: 14px 0 0;
font-size: 19px;
font-weight: 560;
letter-spacing: -.005em;
color: rgba(255, 255, 255, .94);
}
.hi-label {
margin: 18px 0 0;
font-size: 10.5px;
font-weight: 620;
letter-spacing: .18em;
text-transform: uppercase;
color: rgba(255, 255, 255, .5);
}
.hi {
margin: 2px 0 0;
font-size: 72px;
font-weight: 600;
letter-spacing: -.045em;
line-height: 1;
font-variant-numeric: tabular-nums;
text-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.hi .deg { font-weight: 350; opacity: .62; }
.chips { display: flex; gap: 9px; margin-top: 20px; }
.chip {
display: inline-flex;
align-items: baseline;
gap: 8px;
padding: 8px 14px;
border-radius: 999px;
background: rgba(255, 255, 255, .09);
border: 1px solid rgba(255, 255, 255, .13);
font-variant-numeric: tabular-nums;
}
.chip i {
font-style: normal;
font-size: 10px;
font-weight: 620;
letter-spacing: .14em;
text-transform: uppercase;
color: rgba(255, 255, 255, .55);
}
.chip b { font-size: 15px; font-weight: 580; letter-spacing: -.01em; }
.note {
margin: 18px 0 0;
font-size: 11.5px;
letter-spacing: .04em;
color: rgba(255, 255, 255, .42);
}
/* ---------- data panel ---------- */
.panel {
border-radius: 20px;
padding: 20px 22px 22px;
border: 1px solid rgba(255, 255, 255, .07);
background: linear-gradient(180deg, rgba(9, 13, 26, .62), rgba(9, 13, 26, .38));
display: flex;
flex-direction: column;
}
.panel-head {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
margin-bottom: 6px;
}
.panel-head h2 {
margin: 0;
font-size: 13px;
font-weight: 620;
letter-spacing: .12em;
text-transform: uppercase;
color: rgba(238, 242, 251, .78);
}
.unit {
font-size: 11.5px;
letter-spacing: .1em;
color: var(--faint);
font-variant-numeric: tabular-nums;
}
.chart { height: 262px; margin: 0 -4px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: rgba(255, 255, 255, .065); stroke-width: 1; }
.chart .ylab, .chart .xlab {
fill: rgba(226, 234, 250, .42);
font-size: 11px;
font-weight: 500;
font-family: var(--font);
font-variant-numeric: tabular-nums;
}
.chart .dot { fill: rgba(255, 255, 255, .78); }
.chart .mark { stroke: #0a0e1a; stroke-width: 2.2; }
.chart .mlab {
font-size: 12.5px;
font-weight: 700;
font-family: var(--font);
font-variant-numeric: tabular-nums;
}
.chart .nowline { stroke: rgba(255, 255, 255, .34); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .nowlab {
fill: rgba(255, 255, 255, .55);
font-size: 9.5px;
font-weight: 640;
letter-spacing: .16em;
font-family: var(--font);
}
.chart-empty {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border: 1px dashed rgba(255, 255, 255, .12);
border-radius: 14px;
color: var(--muted);
font-size: 13.5px;
}
.strip {
margin-top: 16px;
display: grid;
grid-template-columns: repeat(12, minmax(0, 1fr));
gap: 6px;
}
.hcell {
border-radius: 10px;
padding: 7px 2px 8px;
text-align: center;
border: 1px solid rgba(255, 255, 255, .05);
background: rgba(255, 255, 255, .04);
}
.hcell .h {
display: block;
font-size: 10px;
font-weight: 550;
letter-spacing: .04em;
color: rgba(226, 234, 250, .48);
font-variant-numeric: tabular-nums;
}
.hcell .t {
display: block;
margin-top: 3px;
font-size: 13px;
font-weight: 620;
letter-spacing: -.012em;
font-variant-numeric: tabular-nums;
}
.hcell.is-max { border-color: rgba(255, 144, 87, .5); }
.hcell.is-max .t { color: #FFB48C; }
.hcell.is-min { border-color: rgba(86, 182, 240, .5); }
.hcell.is-min .t { color: #97D6F8; }
.hcell.is-null .t { color: var(--faint); }
/* ---------- loading / error ---------- */
.state {
grid-column: 1 / -1;
min-height: 400px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 14px;
text-align: center;
border-radius: 20px;
border: 1px dashed rgba(255, 255, 255, .12);
background: rgba(255, 255, 255, .02);
padding: 32px;
}
.state.err {
border-color: rgba(255, 138, 138, .3);
background: rgba(255, 90, 90, .05);
}
.spinner {
width: 34px;
height: 34px;
border-radius: 50%;
background: conic-gradient(from 0deg, rgba(255, 255, 255, 0), var(--accent));
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 0);
mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 0);
animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state p { margin: 0; color: var(--muted); font-size: 14px; }
.state h2 {
margin: 4px 0 0;
font-size: 21px;
font-weight: 620;
letter-spacing: -.015em;
color: #FFD9D9;
}
.err-msg { max-width: 620px; line-height: 1.55; }
.err-url {
max-width: 700px;
font-family: var(--mono);
font-size: 11.5px;
line-height: 1.6;
color: var(--faint);
word-break: break-all;
background: rgba(0, 0, 0, .3);
border: 1px solid rgba(255, 255, 255, .07);
border-radius: 10px;
padding: 9px 12px;
}
.btn {
margin-top: 6px;
font: inherit;
font-size: 13.5px;
font-weight: 580;
color: var(--text);
padding: 10px 20px;
border-radius: 999px;
cursor: pointer;
border: 1px solid rgba(255, 255, 255, .18);
background: rgba(255, 255, 255, .09);
transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.legal {
margin: 16px 0 0;
text-align: center;
font-size: 11.5px;
letter-spacing: .05em;
color: rgba(226, 234, 250, .28);
}
@media (prefers-reduced-motion: reduce) {
* { animation: none !important; transition: none !important; }
}
</style>
</head>
<body>
<main class="stage">
<section class="card" id="card" data-state="loading">
<header class="head" id="head"></header>
<div class="body" id="panelBody" aria-live="polite"></div>
</section>
<p class="legal">Open-Meteo compatible API · same-origin request · all times and dates in UTC</p>
</main>
<script>
(function () {
"use strict";
/* ------------------------------------------------------------------ *
* Parameters
* ------------------------------------------------------------------ */
var qp = new URLSearchParams(window.location.search);
function num(v, fallback) {
var n = parseFloat(v);
return isFinite(n) ? n : fallback;
}
var lat = num(qp.get("lat"), 52.52);
var lon = num(qp.get("lon"), 13.405);
var place = (qp.get("name") || "").trim() || "Berlin";
var today = new Date().toISOString().slice(0, 10);
var dateRaw = (qp.get("date") || "").trim();
var date = /^\d{4}-\d{2}-\d{2}$/.test(dateRaw) ? dateRaw : today;
var isPast = date < today;
var isToday = date === today;
var endpoint = isPast ? "/api/om/archive" : "/api/om/forecast";
var query = [
"latitude=" + encodeURIComponent(lat),
"longitude=" + encodeURIComponent(lon),
"daily=temperature_2m_max,temperature_2m_min,weather_code",
"hourly=temperature_2m",
"timezone=UTC",
"temperature_unit=celsius",
"start_date=" + encodeURIComponent(date),
"end_date=" + encodeURIComponent(date)
].join("&");
var requestPath = endpoint + "?" + query;
document.title = "Weather · " + place + " · " + date;
/* ------------------------------------------------------------------ *
* Weather codes and themes
* ------------------------------------------------------------------ */
var WMO = {
0: ["Clear sky", "sun"],
1: ["Mainly clear", "sun-cloud"],
2: ["Partly cloudy", "sun-cloud"],
3: ["Overcast", "clouds"],
45: ["Fog", "fog"],
48: ["Depositing rime fog", "fog"],
51: ["Light drizzle", "drizzle"],
53: ["Drizzle", "drizzle"],
55: ["Dense drizzle", "drizzle"],
56: ["Light freezing drizzle", "sleet"],
57: ["Freezing drizzle", "sleet"],
61: ["Slight rain", "rain"],
63: ["Rain", "rain"],
65: ["Heavy rain", "rain"],
66: ["Light freezing rain", "sleet"],
67: ["Heavy freezing rain", "sleet"],
71: ["Slight snowfall", "snow"],
73: ["Snowfall", "snow"],
75: ["Heavy snowfall", "snow"],
77: ["Snow grains", "snow"],
80: ["Slight rain showers", "showers"],
81: ["Rain showers", "showers"],
82: ["Violent rain showers", "rain"],
85: ["Slight snow showers", "snow"],
86: ["Heavy snow showers", "snow"],
95: ["Thunderstorm", "storm"],
96: ["Thunderstorm with slight hail", "storm"],
99: ["Thunderstorm with heavy hail", "storm"]
};
var THEME = {
"sun": { p1: "#3b4a92", p2: "#1a2246", glow: "255,186,88", ic1: "#E7EEFA", ic2: "#FFC64B", accent: "#FFCB6B" },
"sun-cloud": { p1: "#33447f", p2: "#191f42", glow: "255,198,124", ic1: "#E3ECFA", ic2: "#FFC64B", accent: "#FFD189" },
"clouds": { p1: "#2c3757", p2: "#171d33", glow: "175,193,232", ic1: "#DFE8F7", ic2: "#A2B2D0", accent: "#BCCAE6" },
"fog": { p1: "#2b3348", p2: "#171c2c", glow: "186,199,218", ic1: "#DEE7F4", ic2: "#9FB0C9", accent: "#C6D1E0" },
"drizzle": { p1: "#233d63", p2: "#131f36", glow: "112,180,255", ic1: "#DCE7F7", ic2: "#6EC1FF", accent: "#86C6FF" },
"rain": { p1: "#1f3a63", p2: "#111c33", glow: "96,168,255", ic1: "#D8E3F5", ic2: "#5FA8FF", accent: "#7CB8FF" },
"showers": { p1: "#244265", p2: "#131f36", glow: "120,182,255", ic1: "#DCE7F7", ic2: "#63B6FF", accent: "#8AC6FF" },
"sleet": { p1: "#26405e", p2: "#141e34", glow: "154,204,255", ic1: "#DEE9F8", ic2: "#9FD8FF", accent: "#AFDDFF" },
"snow": { p1: "#2a4463", p2: "#15213a", glow: "176,218,255", ic1: "#E9F2FD", ic2: "#BFE6FF", accent: "#D2ECFF" },
"storm": { p1: "#342d69", p2: "#161331", glow: "170,142,255", ic1: "#DBE0F3", ic2: "#FFD166", accent: "#BCA4FF" },
"unknown": { p1: "#2a3350", p2: "#161c30", glow: "150,170,210", ic1: "#DCE6F6", ic2: "#A9B8D4", accent: "#B4C4E0" }
};
/* ------------------------------------------------------------------ *
* Helpers
* ------------------------------------------------------------------ */
var ENT = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
function esc(s) {
return String(s).replace(/[&<>"']/g, function (c) { return ENT[c]; });
}
function r2(n) { return Math.round(n * 100) / 100; }
function fmtN(v) {
if (v === null || v === undefined || !isFinite(v)) return "–";
return String(Number(v.toFixed(1)));
}
function fmtT(v) {
return v === null || v === undefined || !isFinite(v) ? "–" : fmtN(v) + "°";
}
function fmtCoord(v, pos, neg) {
return Math.abs(v).toFixed(2) + "° " + (v >= 0 ? pos : neg);
}
function fmtDate(iso) {
var p = iso.split("-");
var d = new Date(Date.UTC(+p[0], +p[1] - 1, +p[2]));
if (isNaN(d.getTime())) return iso;
try {
return d.toLocaleDateString("en-GB", {
weekday: "long", day: "numeric", month: "long", year: "numeric", timeZone: "UTC"
});
} catch (e) {
return iso;
}
}
function mix(a, b, t) {
t = Math.max(0, Math.min(1, t));
return [
Math.round(a[0] + (b[0] - a[0]) * t),
Math.round(a[1] + (b[1] - a[1]) * t),
Math.round(a[2] + (b[2] - a[2]) * t)
].join(",");
}
/* ------------------------------------------------------------------ *
* Icons (64 x 64)
* ------------------------------------------------------------------ */
function cloud(dx, dy, cls) {
return '<g transform="translate(' + dx + ',' + dy + ')">' +
'<circle class="' + cls + '" cx="23" cy="32" r="10"/>' +
'<circle class="' + cls + '" cx="38" cy="28" r="13"/>' +
'<rect class="' + cls + '" x="13" y="33" width="38" height="13" rx="6.5"/></g>';
}
function rays(cx, cy, rIn, rOut, angles) {
return angles.map(function (a) {
var rad = a * Math.PI / 180, c = Math.cos(rad), s = Math.sin(rad);
return '<line class="c2" x1="' + r2(cx + c * rIn) + '" y1="' + r2(cy + s * rIn) +
'" x2="' + r2(cx + c * rOut) + '" y2="' + r2(cy + s * rOut) + '"/>';
}).join("");
}
function drop(x, y, len) {
return '<line class="c2" x1="' + x + '" y1="' + y + '" x2="' + (x - 3) + '" y2="' + (y + len) + '"/>';
}
function flake(cx, cy, rr) {
var a = r2(0.866 * rr), b = r2(0.5 * rr);
return '<g class="c2" stroke-width="2.5">' +
'<line x1="' + cx + '" y1="' + (cy - rr) + '" x2="' + cx + '" y2="' + (cy + rr) + '"/>' +
'<line x1="' + (cx - a) + '" y1="' + (cy - b) + '" x2="' + (cx + a) + '" y2="' + (cy + b) + '"/>' +
'<line x1="' + (cx - a) + '" y1="' + (cy + b) + '" x2="' + (cx + a) + '" y2="' + (cy - b) + '"/></g>';
}
function iconBody(key) {
switch (key) {
case "sun":
return '<circle class="c2f" cx="32" cy="31" r="13"/>' +
rays(32, 31, 19.5, 26, [0, 45, 90, 135, 180, 225, 270, 315]);
case "sun-cloud":
return '<circle class="c2f" cx="23" cy="23" r="9"/>' +
rays(23, 23, 13.5, 18.5, [135, 180, 225, 270, 315]) +
cloud(6, 8, "c1");
case "clouds":
return '<g opacity=".5" transform="translate(14,2) scale(.72)">' +
'<circle class="c2f" cx="23" cy="32" r="10"/>' +
'<circle class="c2f" cx="38" cy="28" r="13"/>' +
'<rect class="c2f" x="13" y="33" width="38" height="13" rx="6.5"/></g>' +
cloud(0, 10, "c1");
case "fog":
return cloud(0, -4, "c1") +
'<line class="c2" x1="12" y1="49" x2="40" y2="49"/>' +
'<line class="c2" x1="46" y1="49" x2="53" y2="49"/>' +
'<line class="c2" x1="19" y1="57" x2="52" y2="57"/>';
case "drizzle":
return cloud(0, -6, "c1") + drop(22, 45, 6) + drop(32, 47, 6) + drop(42, 45, 6);
case "rain":
case "showers":
return cloud(0, -6, "c1") + drop(22, 44, 10) + drop(32, 46, 10) + drop(42, 44, 10);
case "sleet":
return cloud(0, -6, "c1") + drop(21, 44, 9) + flake(32, 51, 4.6) + drop(45, 44, 9);
case "snow":
return cloud(0, -6, "c1") + flake(22, 47, 4.6) + flake(32, 55, 4.6) + flake(42, 47, 4.6);
case "storm":
return cloud(0, -6, "c1") +
'<path class="c2f" d="M34 41 L25 54 L31 54 L29 62 L40 48 L33 48 Z"/>';
case "alert":
return cloud(0, -6, "c1") +
'<line class="c2" x1="32" y1="45" x2="32" y2="54"/>' +
'<circle class="c2f" cx="32" cy="60" r="2.3"/>';
default:
return cloud(0, 0, "c1");
}
}
function iconSvg(key, label, size) {
return '<svg class="icon" viewBox="0 0 64 64" width="' + size + '" height="' + size +
'" role="img" aria-label="' + esc(label) + '">' + iconBody(key) + "</svg>";
}
/* ------------------------------------------------------------------ *
* Parsing
* ------------------------------------------------------------------ */
function pick(arr, i) {
if (!Array.isArray(arr)) return null;
var v = arr[i];
return typeof v === "number" && isFinite(v) ? v : null;
}
function parse(data) {
if (!data || typeof data !== "object") throw new Error("The API returned an unexpected response.");
var daily = data.daily || {};
var idx = Array.isArray(daily.time) ? daily.time.indexOf(date) : -1;
if (idx < 0) idx = 0;
var code = pick(daily.weather_code || daily.weathercode, idx);
var hourly = data.hourly || {};
var times = Array.isArray(hourly.time) ? hourly.time : [];
var temps = Array.isArray(hourly.temperature_2m) ? hourly.temperature_2m : [];
var hours = [];
for (var i = 0; i < times.length; i++) {
var ts = String(times[i]);
if (ts.slice(0, 10) !== date) continue;
var v = temps[i];
hours.push({
label: ts.slice(11, 16) || "",
hour: parseInt(ts.slice(11, 13), 10) || 0,
t: typeof v === "number" && isFinite(v) ? v : null
});
}
var vals = hours.map(function (h) { return h.t; }).filter(function (t) { return t !== null; });
var tmax = pick(daily.temperature_2m_max, idx);
var tmin = pick(daily.temperature_2m_min, idx);
if (tmax === null && vals.length) tmax = Math.max.apply(null, vals);
if (tmin === null && vals.length) tmin = Math.min.apply(null, vals);
if (tmax === null && tmin === null && !vals.length) {
throw new Error("The API returned no temperature data for " + date + ".");
}
var lo = vals.length ? Math.min.apply(null, vals) : null;
var hi = vals.length ? Math.max.apply(null, vals) : null;
var maxIdx = -1, minIdx = -1;
hours.forEach(function (h, j) {
if (h.t === null) return;
if (h.t === hi && maxIdx < 0) maxIdx = j;
if (h.t === lo && minIdx < 0) minIdx = j;
});
var avg = null;
if (vals.length) {
avg = vals.reduce(function (a, b) { return a + b; }, 0) / vals.length;
}
var known = WMO[code];
return {
code: code,
label: known ? known[0] : (code === null ? "Condition unavailable" : "Weather code " + code),
icon: known ? known[1] : "unknown",
tmax: tmax,
tmin: tmin,
avg: avg,
hours: hours,
readings: vals.length,
lo: lo,
hi: hi,
spread: hi !== null && lo !== null ? hi - lo : 0,
maxIdx: maxIdx,
minIdx: minIdx
};
}
/* ------------------------------------------------------------------ *
* Chart
* ------------------------------------------------------------------ */
function niceStep(raw) {
if (!(raw > 0)) return 1;
var p = Math.pow(10, Math.floor(Math.log10(raw)));
var m = raw / p;
var f = m <= 1 ? 1 : m <= 2 ? 2 : m <= 2.5 ? 2.5 : m <= 5 ? 5 : 10;
return f * p;
}
function smoothPath(pts) {
if (pts.length === 1) return "M" + r2(pts[0].x) + " " + r2(pts[0].y);
var d = "M" + r2(pts[0].x) + " " + r2(pts[0].y);
for (var i = 0; i < pts.length - 1; i++) {
var p0 = pts[i - 1] || pts[i];
var p1 = pts[i];
var p2 = pts[i + 1];
var p3 = pts[i + 2] || pts[i + 1];
var t = 0.19;
var c1x = p1.x + (p2.x - p0.x) * t;
var c1y = p1.y + (p2.y - p0.y) * t;
var c2x = p2.x - (p3.x - p1.x) * t;
var c2y = p2.y - (p3.y - p1.y) * t;
var lo = Math.min(p1.y, p2.y), hi = Math.max(p1.y, p2.y);
c1y = Math.min(hi, Math.max(lo, c1y));
c2y = Math.min(hi, Math.max(lo, c2y));
d += " C" + r2(c1x) + " " + r2(c1y) + " " + r2(c2x) + " " + r2(c2y) +
" " + r2(p2.x) + " " + r2(p2.y);
}
return d;
}
function chartSvg(w, h, model) {
var hs = model.hours;
var n = hs.length;
var padL = 44, padR = 18, padT = 36, padB = 30;
var iw = w - padL - padR;
var ih = h - padT - padB;
var X = function (i) { return padL + (n > 1 ? i / (n - 1) : 0.5) * iw; };
var pts = [];
hs.forEach(function (p, i) {
if (p.t !== null) pts.push({ x: X(i), v: p.t, i: i, label: p.label });
});
if (!pts.length) return "";
var lo = model.lo, hi = model.hi;
var step = niceStep(Math.max(hi - lo, 1) / 3);
var dLo = Math.floor((lo - step * 0.45) / step) * step;
var dHi = Math.ceil((hi + step * 0.45) / step) * step;
if (dHi - dLo < step) dHi = dLo + step;
var Y = function (v) { return padT + (1 - (v - dLo) / (dHi - dLo)) * ih; };
pts.forEach(function (p) { p.y = Y(p.v); });
var baseY = h - padB;
var line = smoothPath(pts);
var area = line + " L" + r2(pts[pts.length - 1].x) + " " + baseY +
" L" + r2(pts[0].x) + " " + baseY + " Z";
var svg = '<svg width="' + w + '" height="' + h + '" viewBox="0 0 ' + w + " " + h +
'" role="img" aria-label="Hourly temperature chart in degrees Celsius">' +
"<defs>" +
'<linearGradient id="wLine" gradientUnits="userSpaceOnUse" x1="0" y1="' + padT + '" x2="0" y2="' + baseY + '">' +
'<stop offset="0" stop-color="#FF8F57"/><stop offset=".42" stop-color="#FFC46B"/>' +
'<stop offset=".74" stop-color="#7FD2EA"/><stop offset="1" stop-color="#56B6F0"/></linearGradient>' +
'<linearGradient id="wArea" gradientUnits="userSpaceOnUse" x1="0" y1="' + padT + '" x2="0" y2="' + baseY + '">' +
'<stop offset="0" stop-color="#FF9057" stop-opacity=".34"/>' +
'<stop offset=".55" stop-color="#8CB9F0" stop-opacity=".13"/>' +
'<stop offset="1" stop-color="#56B6F0" stop-opacity="0"/></linearGradient>' +
'<filter id="wGlow" x="-15%" y="-40%" width="130%" height="190%">' +
'<feGaussianBlur stdDeviation="6"/></filter>' +
"</defs>";
var k = Math.round((dHi - dLo) / step);
for (var j = 0; j <= k; j++) {
var gv = dLo + j * step;
var gy = r2(Y(gv));
svg += '<line class="grid" x1="' + padL + '" y1="' + gy + '" x2="' + r2(w - padR) + '" y2="' + gy + '"/>' +
'<text class="ylab" x="' + (padL - 12) + '" y="' + r2(gy + 3.8) + '" text-anchor="end">' +
fmtN(gv) + "°</text>";
}
hs.forEach(function (p, i) {
if (p.hour % 3 !== 0) return;
svg += '<text class="xlab" x="' + r2(X(i)) + '" y="' + (h - 9) + '" text-anchor="middle">' +
esc(p.label) + "</text>";
});
if (isToday) {
var now = new Date();
var frac = now.getUTCHours() + now.getUTCMinutes() / 60;
var bi = -1;
for (var q = 0; q < hs.length; q++) {
if (hs[q].hour === Math.floor(frac)) { bi = q; break; }
}
if (bi >= 0) {
var nx = r2(X(bi + (frac - Math.floor(frac))));
if (nx >= padL && nx <= w - padR) {
svg += '<line class="nowline" x1="' + nx + '" y1="' + (padT - 14) + '" x2="' + nx + '" y2="' + baseY + '"/>' +
'<text class="nowlab" x="' + nx + '" y="' + (padT - 20) + '" text-anchor="middle">NOW</text>';
}
}
}
svg += '<path d="' + area + '" fill="url(#wArea)"/>' +
'<path d="' + line + '" fill="none" stroke="url(#wLine)" stroke-width="7" ' +
'stroke-linecap="round" stroke-linejoin="round" opacity=".28" filter="url(#wGlow)"/>' +
'<path d="' + line + '" fill="none" stroke="url(#wLine)" stroke-width="2.6" ' +
'stroke-linecap="round" stroke-linejoin="round"/>';
pts.forEach(function (p) {
if (p.i === model.maxIdx || p.i === model.minIdx) return;
svg += '<circle class="dot" cx="' + r2(p.x) + '" cy="' + r2(p.y) + '" r="2.1" opacity=".6"/>';
});
function marker(target, color, above) {
if (target < 0) return "";
var p = null;
for (var z = 0; z < pts.length; z++) { if (pts[z].i === target) { p = pts[z]; break; } }
if (!p) return "";
var tx = Math.max(padL + 16, Math.min(w - padR - 16, p.x));
var ty = above ? p.y - 14 : p.y + 22;
return '<circle class="mark" cx="' + r2(p.x) + '" cy="' + r2(p.y) + '" r="4.6" fill="' + color + '"/>' +
'<text class="mlab" x="' + r2(tx) + '" y="' + r2(ty) + '" text-anchor="middle" fill="' + color + '">' +
fmtT(p.v) + "</text>";
}
svg += marker(model.maxIdx, "#FFA871", true);
svg += marker(model.minIdx, "#6FC4F5", false);
return svg + "</svg>";
}
/* ------------------------------------------------------------------ *
* Rendering
* ------------------------------------------------------------------ */
var card = document.getElementById("card");
var head = document.getElementById("head");
var panelBody = document.getElementById("panelBody");
var chartModel = null;
var lastChartWidth = 0;
function renderHead() {
var badge = isPast ? "Archive" : isToday ? "Today" : "Forecast";
head.innerHTML =
'<div class="place">' +
'<h1 class="name">' + esc(place) + "</h1>" +
'<p class="meta">' + fmtCoord(lat, "N", "S") + " · " + fmtCoord(lon, "E", "W") + " · UTC</p>" +
"</div>" +
'<div class="when">' +
'<span class="badge">' + badge + "</span>" +
'<p class="date">' + esc(fmtDate(date)) + "</p>" +
'<p class="iso">' + esc(date) + " · " + esc(endpoint) + "</p>" +
"</div>";
}
function renderLoading() {
card.setAttribute("data-state", "loading");
panelBody.innerHTML =
'<div class="state"><span class="spinner"></span>' +
"<p>Loading weather for " + esc(place) + " …</p></div>";
}
function renderError(message) {
card.setAttribute("data-state", "error");
panelBody.innerHTML =
'<div class="state err" role="alert" style="--ic1:#3d4560;--ic2:#FF9A9A">' +
iconSvg("alert", "Error", 76) +
"<h2>Weather data could not be loaded</h2>" +
'<p class="err-msg">' + esc(message) + "</p>" +
'<p class="err-url">' + esc(requestPath) + "</p>" +
'<button class="btn" type="button" id="retry">Try again</button>' +
"</div>";
var btn = document.getElementById("retry");
if (btn) btn.addEventListener("click", load);
}
function stripCells(model) {
var cool = [86, 182, 240], warm = [255, 144, 87];
return model.hours.map(function (h, i) {
var cls = "hcell", style = "";
if (h.t === null) {
cls += " is-null";
} else {
var norm = model.spread > 0 ? (h.t - model.lo) / model.spread : 0.5;
style = "background:rgba(" + mix(cool, warm, norm) + "," +
(0.1 + 0.17 * norm).toFixed(3) + ")";
if (i === model.maxIdx) cls += " is-max";
if (i === model.minIdx) cls += " is-min";
}
return '<div class="' + cls + '" style="' + style + '">' +
'<span class="h">' + esc(h.label) + "</span>" +
'<span class="t">' + fmtT(h.t) + "</span></div>";
}).join("");
}
function renderChart() {
var box = document.getElementById("chart");
if (!box || !chartModel) return;
if (!chartModel.readings) {
box.innerHTML = '<div class="chart-empty">No hourly temperatures were returned for this date.</div>';
return;
}
var w = Math.max(360, Math.round(box.clientWidth || 660));
lastChartWidth = w;
box.innerHTML = chartSvg(w, 262, chartModel);
}
function renderReady(model) {
chartModel = model;
card.setAttribute("data-state", "ready");
var th = THEME[model.icon] || THEME.unknown;
card.style.setProperty("--p1", th.p1);
card.style.setProperty("--p2", th.p2);
card.style.setProperty("--ic1", th.ic1);
card.style.setProperty("--ic2", th.ic2);
card.style.setProperty("--accent", th.accent);
card.style.setProperty("--glow", th.glow);
document.documentElement.style.setProperty("--glow", th.glow);
panelBody.innerHTML =
'<section class="sky"><div class="sky-inner">' +
iconSvg(model.icon, model.label, 128) +
'<p class="cond">' + esc(model.label) + "</p>" +
'<p class="hi-label">Daily high</p>' +
'<p class="hi">' + fmtN(model.tmax) + '<span class="deg">°</span></p>' +
'<div class="chips">' +
'<span class="chip"><i>Low</i><b>' + fmtT(model.tmin) + "</b></span>" +
'<span class="chip"><i>Avg</i><b>' + fmtT(model.avg) + "</b></span>" +
"</div>" +
'<p class="note">Celsius · ' + model.readings + " hourly readings</p>" +
"</div></section>" +
'<section class="panel">' +
'<div class="panel-head"><h2>Hourly temperature</h2><span class="unit">°C · UTC</span></div>' +
'<div class="chart" id="chart"></div>' +
'<div class="strip">' + stripCells(model) + "</div>" +
"</section>";
renderChart();
}
/* ------------------------------------------------------------------ *
* Data loading
* ------------------------------------------------------------------ */
function load() {
renderLoading();
var controller = null, timer = null;
var opts = { cache: "no-store", headers: { "Accept": "application/json" } };
if (typeof AbortController === "function") {
controller = new AbortController();
opts.signal = controller.signal;
timer = setTimeout(function () { controller.abort(); }, 15000);
}
fetch(requestPath, opts).then(function (res) {
return res.text().then(function (text) {
var data = null;
try { data = JSON.parse(text); } catch (e) { data = null; }
if (!res.ok) {
var why = data && (data.reason || data.error_message || data.message);
throw new Error("The weather API responded with HTTP " + res.status +
(why ? " — " + why : "") + ".");
}
if (data === null) throw new Error("The weather API response was not valid JSON.");
if (data.error) throw new Error(data.reason || "The weather API reported an error.");
return data;
});
}).then(function (data) {
var model = parse(data);
if (timer) clearTimeout(timer);
renderReady(model);
}).catch(function (err) {
if (timer) clearTimeout(timer);
var msg = err && err.name === "AbortError"
? "The request to the weather API timed out after 15 seconds."
: (err && err.message ? err.message : "The weather data could not be reached.");
renderError(msg);
});
}
window.addEventListener("resize", function () {
var box = document.getElementById("chart");
if (!box || !chartModel) return;
if (Math.abs((box.clientWidth || 0) - lastChartWidth) > 2) renderChart();
});
renderHead();
load();
})();
</script>
</body>
</html>L1 —— 廉价的确定性描述量
| bytes 总计 | 35,050 | html / css / js | 534 / 11,253 / 23,263 |
|---|---|---|---|
| dom 节点 | 13 | dom 深度 | 5 |
| css 规则 | 72 | 含 js | 是 |
| brightness | 29.7 | contrast | 25.0 |
| colorfulness | 20.2 | 留白 | 80.5% |
该 slot 的 telemetry
| prompt tokens | 12 | completion tokens | 73,981 |
|---|---|---|---|
| total tokens | 73,993 | wall | 833.2 s |
| cost | — | request id | — |
config.json569 B
{
"N": 2,
"auth": {
"credential_ref": "WCB_NONE",
"method": "oauth-login"
},
"billing": "plan",
"config_id": "claude-opus-5-eff-max--cli--claude-code--dev",
"effort": "max",
"family": "claude",
"m": {
"min": 2,
"q": 2
},
"model_id": "claude-opus-5",
"protocol": "cli",
"served_model": "claude-opus-5",
"telemetry": {
"completion_tokens": 210754,
"cost_usd": null,
"prompt_tokens": 42,
"total_tokens": 210796,
"wall_ms": 2407451
},
"transport": "claude-code-cli-headless",
"vendor_sanction_ref": null
}send-log2.5 KB
{
"N": 2,
"batch_id": "2026-07-25--cc-opus5",
"config_id": "claude-opus-5-eff-max--cli--claude-code--dev",
"positions": [
{
"attempts": [
{
"attempt_index": 0,
"backoff_ms": null,
"charged": true,
"ended_at": "2026-07-24T17:43:48.132919+00:00",
"http_status": null,
"outcome": "valid",
"reached_model": true,
"reason": "ok",
"request_id": null,
"started_at": "2026-07-24T17:30:31.660800+00:00"
}
],
"block_index": 0,
"model_reaching_attempt_index": 0,
"slot_index": 0,
"terminal_state": "valid",
"variant": "P-min"
},
{
"attempts": [
{
"attempt_index": 0,
"backoff_ms": null,
"charged": true,
"ended_at": "2026-07-24T17:57:44.478534+00:00",
"http_status": null,
"outcome": "valid",
"reached_model": true,
"reason": "ok",
"request_id": null,
"started_at": "2026-07-24T17:43:51.289343+00:00"
}
],
"block_index": 0,
"model_reaching_attempt_index": 0,
"slot_index": 0,
"terminal_state": "valid",
"variant": "P-q"
},
{
"attempts": [
{
"attempt_index": 0,
"backoff_ms": null,
"charged": true,
"ended_at": "2026-07-24T18:08:19.067782+00:00",
"http_status": null,
"outcome": "valid",
"reached_model": true,
"reason": "ok",
"request_id": null,
"started_at": "2026-07-24T17:57:48.969328+00:00"
}
],
"block_index": 1,
"model_reaching_attempt_index": 0,
"slot_index": 1,
"terminal_state": "valid",
"variant": "P-q"
},
{
"attempts": [
{
"attempt_index": 0,
"backoff_ms": null,
"charged": true,
"ended_at": "2026-07-24T18:10:50.194482+00:00",
"http_status": null,
"outcome": "valid",
"reached_model": true,
"reason": "ok",
"request_id": null,
"started_at": "2026-07-24T18:08:22.508560+00:00"
}
],
"block_index": 1,
"model_reaching_attempt_index": 0,
"slot_index": 1,
"terminal_state": "valid",
"variant": "P-min"
}
],
"retry_policy": {
"max_unreachable_retries": 5,
"rate_limit_backoff": {
"max_attempts": 4,
"max_total_ms": 60000
}
}
}