{"version":3,"file":"BalanceProblem.DSO2qKkw.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","_e","init_jsx_runtime","c","p","init_framer_DKgW_P28","addPropertyControls","BalanceProblem","props","on","setOn","green","byproduct","style","CSS","BLOCKS","b","TOTAL","GT_REGULAR","GT_BOLD","HEAP","COLS","__FramerMetadata__","init_BalanceProblem","a","h","i0","ControlType","\"exports\"","\"default\"","\"type\"","\"name\"","\"slots\"","\"annotations\"","\"framerContractVersion\"","\"framerSupportedLayoutWidth\"","\"framerIntrinsicHeight\"","\"framerIntrinsicWidth\"","\"framerSupportedLayoutHeight\"","\"__FramerMetadata__\""],"sources":["https:/framerusercontent.com/modules/DdiJpf8BqXmzThGGxlc4/GSwS7uVlfhgAIt8Oy1tg/BalanceProblem.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";// How much byproduct does one tonne of terbium produce? The question fills the field in large\n// type. The reader clicks Find out, and the question gives way to the answer: one square is one\n// tonne of rare earth oxide, one green square of terbium and the heap that comes up with it.\n//\n// Terbium is 0.2 per cent of an average rock (relative abundance in ores, average of 51 deposits,\n// Binnemans, Jones, Muller and Yurramendi 2018, Table 2), so one tonne of terbium means about 500\n// tonnes of rare earths dug. The table's shares add up to 99.8 per cent, so the heap is 498 tonnes:\n// cerium 216, lanthanum 125, neodymium 81, yttrium 25, praseodymium 23, samarium 11,\n// gadolinium 7, holmium to lutetium together 4, dysprosium 4, europium 1, erbium 1.\n// Half tonnes (lanthanum, yttrium, dysprosium, europium at x.5) are rounded so the heap adds up.\n//\n// Terbium is green because its light is green: it is the green in a fluorescent lamp's phosphor.\n// The whole heap is one colour, bleu outremer 59 (Le Corbusier 4320K), because it is all byproduct;\n// terbium is the only green. The metals are told apart by form, not colour: each metal is its own\n// block, starting on a new row with a gap before the next, and named beside its first row. Eleven\n// colours made a toy of it, and two alternating tones said different metals were the same.\nconst GT_REGULAR=\"https://framerusercontent.com/assets/fEtXBGKHzXt5I1r6Xu6Sif74qQ.woff2\";const GT_BOLD=\"https://framerusercontent.com/assets/Rp1S0GKIuHA3NGtqFhdsnbpnqDs.woff2\";const HEAP=[{name:\"Cerium\",t:216},{name:\"Lanthanum\",t:125},{name:\"Neodymium\",t:81},{name:\"Yttrium\",t:25},{name:\"Praseodymium\",t:23},{name:\"Samarium\",t:11},{name:\"Gadolinium\",t:7},{name:\"Holmium to lutetium\",t:4},{name:\"Dysprosium\",t:4},{name:\"Europium\",t:1},{name:\"Erbium\",t:1}];const TOTAL=HEAP.reduce((a,h)=>a+h.t,0)// 498\n;const COLS=25;// blocks: terbium first, then each metal; i0 is the running index of a block's first square\nconst BLOCKS=[];{let i0=0;for(const h of[{name:\"Terbium\",t:1},...HEAP]){BLOCKS.push({name:h.name,t:h.t,tb:h.name===\"Terbium\",i0});i0+=h.t;}}// No quotation marks, greater-than, less-than or ampersand in this string:\n// Framer's server escapes them inside a style element (runbook Part 12).\nconst CSS=`\n@font-face { font-family: HomaGT; src: url(${GT_REGULAR}); font-weight: 400; font-style: normal; font-display: swap; }\n@font-face { font-family: HomaGT; src: url(${GT_BOLD}); font-weight: 700; font-style: normal; font-display: swap; }\n.tb { position: relative; container-type: inline-size; width: 100%; color: rgb(10, 10, 10); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }\n.tb-field { position: relative; border-top: 1px solid rgba(10, 10, 10, .38); padding-top: clamp(40px, 7cqi, 56px); padding-right: 150px; }\n.tb-q { position: absolute; left: 0; right: 0; z-index: 1; top: clamp(28px, 5cqi, 40px); bottom: 0; margin: 0; font-family: HomaGT, Georgia, serif; font-weight: 700; font-size: clamp(44px, 12.4cqi, 104px); line-height: .98; letter-spacing: -.035em; color: rgb(10, 10, 10); transition: opacity 400ms linear; }\n.tb-q em { font-style: normal; color: var(--tb-green); }\n.tb.on .tb-q { opacity: 0; pointer-events: none; }\n.tb-blk { position: relative; margin-top: clamp(5px, 1.2cqi, 8px); }\n.tb-blk:first-child { margin-top: 0; }\n.tb-grid { display: grid; grid-template-columns: repeat(${COLS}, minmax(0, 1fr)); gap: 2px; }\n.tb-c { aspect-ratio: 1; background: var(--tb-heap); opacity: 0; transform: translateY(-14px); transition: opacity 160ms linear, transform 240ms ease-out; }\n.tb-c.tb0 { background: var(--tb-green); }\n.tb.on .tb-c { opacity: 1; transform: none; }\n.tb-name { position: absolute; left: calc(100% + 12px); top: 0; font-size: 12.5px; line-height: 1.1; white-space: nowrap; color: rgba(10, 10, 10, .78); opacity: 0; transition: opacity 400ms linear 1500ms; }\n.tb-name b { font-weight: 400; color: rgba(10, 10, 10, .42); margin-left: .35em; }\n.tb-blk.tb .tb-name { color: var(--tb-green); font-weight: 600; }\n.tb.on .tb-name { opacity: 1; }\n.tb-foot { position: relative; height: clamp(96px, 22cqi, 170px); margin-top: clamp(18px, 4cqi, 28px); }\n.tb-go { position: absolute; left: 0; top: 0; appearance: none; border: none; background: none; padding: 0 0 3px; cursor: pointer; font: inherit; font-size: clamp(15px, 2.7cqi, 18px); font-weight: 600; color: var(--tb-green); border-bottom: 2px solid var(--tb-green); transition: opacity 300ms linear; }\n.tb-go:hover { color: rgb(10, 10, 10); border-bottom-color: rgb(10, 10, 10); }\n.tb.on .tb-go { opacity: 0; pointer-events: none; }\n.tb-nudge { position: absolute; right: -26px; top: 6px; width: 0; height: 0; pointer-events: none; animation: tb-press 2400ms ease-in-out infinite; }\n.tb-nudge path { fill: rgb(10, 10, 10); stroke: rgb(255, 255, 255); stroke-width: 1.5; stroke-linejoin: round; }\n@keyframes tb-press { 0%, 20% { transform: translate(20px, 14px); } 50%, 58% { transform: translate(0, 0) scale(.9); } 66% { transform: translate(0, 0) scale(1); } 100% { transform: translate(20px, 14px); } }\n.tb-ans { position: absolute; left: 0; bottom: 0; display: flex; align-items: flex-end; gap: 0 18px; opacity: 0; transition: opacity 500ms linear 1600ms; }\n.tb.on .tb-ans { opacity: 1; }\n.tb-big { font-family: HomaGT, Georgia, serif; font-weight: 700; font-size: clamp(80px, 20cqi, 160px); line-height: .82; letter-spacing: -.04em; white-space: nowrap; }\n.tb-big small { font-size: .22em; letter-spacing: 0; margin-left: .12em; }\n.tb-what { font-size: clamp(14px, 2.6cqi, 17px); line-height: 1.35; color: rgba(10, 10, 10, .6); padding-bottom: .3em; max-width: 13em; }\n.tb-again { appearance: none; border: none; background: none; padding: 0 0 2px; margin-top: 10px; cursor: pointer; font: inherit; font-size: 9.5px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--tb-green); border-bottom: 1px solid var(--tb-green); }\n.tb-src { margin-top: clamp(20px, 4cqi, 30px); font-size: 12px; line-height: 1.6; color: rgba(10, 10, 10, .42); border-top: 1px solid rgba(10, 10, 10, .15); padding-top: 10px; }\n.tb-src i { font-style: italic; }\n@media (prefers-reduced-motion: reduce) { .tb-c, .tb-q, .tb-ans, .tb-name, .tb-go { transition: none; } .tb-nudge { animation: none; } }\n@container (max-width: 520px) {\n  .tb-field { padding-right: 124px; }\n  .tb-grid { gap: 1px; }\n  .tb-name { left: calc(100% + 8px); font-size: 10.5px; }\n}\n`;/**\n * How much by-product does one tonne of terbium produce?\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 760\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function BalanceProblem(props){const{green=\"#3E8E5E\",byproduct=\"#395A8E\",style}=props;const[on,setOn]=useState(false);const vars={\"--tb-green\":green,\"--tb-heap\":byproduct};return /*#__PURE__*/_jsxs(\"div\",{className:\"tb\"+(on?\" on\":\"\"),style:{...vars,...style},children:[/*#__PURE__*/_jsx(\"style\",{children:CSS}),/*#__PURE__*/_jsxs(\"div\",{className:\"tb-field\",children:[/*#__PURE__*/_jsx(\"div\",{role:\"img\",\"aria-label\":on?\"One green square of terbium, then 498 squares of by-product, one block per metal: cerium 216, lanthanum 125, neodymium 81, yttrium 25, praseodymium 23, samarium 11, gadolinium 7, holmium to lutetium 4, dysprosium 4, europium 1, erbium 1\":\"Hidden until Find out is pressed\",children:BLOCKS.map(b=>/*#__PURE__*/_jsxs(\"div\",{className:\"tb-blk\"+(b.tb?\" tb\":\"\"),children:[/*#__PURE__*/_jsx(\"div\",{className:\"tb-grid\",children:Array.from({length:b.t},(_,n)=>/*#__PURE__*/_jsx(\"div\",{className:\"tb-c\"+(b.tb?\" tb0\":\"\"),style:{transitionDelay:on?(b.i0+n)*3+\"ms\":\"0ms\"}},n))}),/*#__PURE__*/_jsxs(\"span\",{className:\"tb-name\",\"aria-hidden\":\"true\",children:[b.name,/*#__PURE__*/_jsx(\"b\",{children:b.t})]})]},b.name))}),/*#__PURE__*/_jsxs(\"p\",{className:\"tb-q\",children:[\"How much by-product does one tonne of \",/*#__PURE__*/_jsx(\"em\",{children:\"terbium\"}),\" produce?\"]})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"tb-foot\",children:[/*#__PURE__*/_jsxs(\"button\",{className:\"tb-go\",onClick:()=>setOn(true),children:[\"Find out\",/*#__PURE__*/_jsx(\"span\",{className:\"tb-nudge\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 14 21\",width:\"18\",height:\"27\",style:{overflow:\"visible\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M1 1 L1 17.4 L5.3 13.4 L8.2 19.8 L10.8 18.6 L8 12.4 L13.4 12.4 Z\"})})})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"tb-ans\",\"aria-live\":\"polite\",children:[/*#__PURE__*/_jsx(\"div\",{children:/*#__PURE__*/_jsxs(\"div\",{className:\"tb-big\",children:[on?TOTAL:\"\",on&&/*#__PURE__*/_jsx(\"small\",{children:\"t\"})]})}),/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"div\",{className:\"tb-what\",children:on?\"of by-product\":\"\"}),on&&/*#__PURE__*/_jsx(\"button\",{className:\"tb-again\",onClick:()=>setOn(false),children:\"Try again\"})]})]})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"tb-src\",children:[\"One square is one tonne of rare earth oxide; the green one is terbium. Terbium is 0.2 per cent of an average rock, so getting one tonne of it means digging about 500 tonnes. Shares from Binnemans, Jones, M\\xfcller and Yurramendi, \",/*#__PURE__*/_jsx(\"i\",{children:\"Journal of Sustainable Metallurgy\"}),\" (2018), Table 2, average of 51 deposits. That 0.2 is rounded, so the real heap could be from about 400 to 670 tonnes.\"]})]});}addPropertyControls(BalanceProblem,{green:{type:ControlType.Color,title:\"Terbium green\",defaultValue:\"#3E8E5E\"},byproduct:{type:ControlType.Color,title:\"By-product\",defaultValue:\"#395A8E\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BalanceProblem\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"760\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BalanceProblem.map"],"mappings":"A,4KAmEG,SAAwBS,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,UAAU,YAAU,UAAU,SAAOC,EAAW,CAACC,EAAGC,GAAOZ,EAAS,EAAK,EAAwD,MAAoB,gBAAM,MAAM,CAAC,UAAU,MAAMW,EAAG,MAAM,IAAI,MAAM,CAA9G,aAAaE,EAAM,YAAYC,EAAwF,GAAGC,CAAK,EAAE,SAAS,CAAc,gBAAK,QAAQ,CAAC,SAASC,CAAG,CAAC,EAAe,gBAAM,MAAM,CAAC,UAAU,WAAW,SAAS,CAAc,gBAAK,MAAM,CAAC,KAAK,MAAM,aAAaL,EAAG,+OAA+O,mCAAmC,SAASM,EAAO,IAAI,GAAgB,gBAAM,MAAM,CAAC,UAAU,UAAUC,EAAE,GAAG,MAAM,IAAI,SAAS,CAAc,gBAAK,MAAM,CAAC,UAAU,UAAU,SAAS,MAAM,K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