mathly / static /math.css
3v324v23's picture
Add the math path, photographed problems, math classes, backups and the mathly Space
69eaa4c
Raw History Blame Contribute Delete
10.6 kB
/* The math path (static/math.js). Layout: one narrow column like the Arabic path: progress, "go on here", then each
unit's skills as a winding trail of circles; a skill opens in a bottom sheet. It sits over the Arabic page, which
stays loaded underneath. The math class is black in either system theme, as its opening screen is: the path sets
the app's colour tokens itself, with a blue accent and a colour per unit. */
@import url("https://fonts.googleapis.com/css2?family=STIX+Two+Text:wght@400;600&display=swap");
#mathView{
color-scheme:dark;
--bg:#000000; --surface:#121413; --ink:#F4F2EC; --muted:#9EA7A0; --line:#2C312E;
--ok:#6CC08A; --ok-bg:#12291B; --sumac:#F08A96; --sumac-bg:#33161B; --amber:#E0B45A; --amber-bg:#2E2512;
--olive:#A6C77A; --olive-soft:#1E2618;
--mx-accent:#7FA6F0; --mx-accent-soft:#18243A; --mx-on-accent:#06101F;
--u-f:#A3AD9F; --u-t:#93B85F; --u-n:#5CC2B2; --u-q:#6FB3D2; --u-p:#E0B45A; --u-w:#D98AAE;
--mx-scrim:rgb(0 0 0 / .7);
--f-math:"STIX Two Text","Cambria Math","Times New Roman",serif;
}
html.math-on, html.math-on body{overflow:hidden}
#mathView{position:fixed;inset:0;z-index:60;overflow:auto;overscroll-behavior:contain;background:var(--bg);color:var(--ink);
padding-block:max(12px, env(safe-area-inset-top, 0px)) calc(32px + env(safe-area-inset-bottom, 0px));
padding-left:max(16px, env(safe-area-inset-left, 0px));padding-right:max(16px, env(safe-area-inset-right, 0px))}
#mathView[hidden]{display:none}
#mathView .u-f{--uc:var(--u-f)} #mathView .u-t{--uc:var(--u-t)} #mathView .u-n{--uc:var(--u-n)}
#mathView .u-q{--uc:var(--u-q)} #mathView .u-p{--uc:var(--u-p)} #mathView .u-w{--uc:var(--u-w)}
#mathView h1,#mathView h2,#mathView h3{font-family:var(--f-display);font-weight:400;margin:0;text-wrap:balance}
#mathView button{font-family:var(--f-body)}
#mathView button:focus-visible{outline:3px solid var(--mx-accent);outline-offset:2px}
#mathView .m{font-family:var(--f-math);direction:ltr;unicode-bidi:isolate;white-space:nowrap;font-size:1.05em}
.mx-wrap{max-width:680px;margin:0 auto;display:flex;flex-direction:column;gap:16px}
.mx-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.mx-top h1{font-size:28px;line-height:1.15;color:var(--mx-accent)}
.mx-sub{margin:2px 0 0;color:var(--muted);font-size:15px}
.mx-acts{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.mx-btn{border:1px solid var(--mx-accent);background:transparent;color:var(--mx-accent);font:700 14px/1 var(--f-body);padding:9px 14px;border-radius:999px;cursor:pointer}
.mx-btn.solid{background:var(--mx-accent);color:var(--mx-on-accent)}
.mx-note{margin:0;color:var(--muted);font-size:14px}
/* progress: a ring for the whole path, a bar per unit */
.mx-progress{display:flex;gap:16px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px}
.mx-ring{flex:none;width:92px;height:92px;border-radius:50%;display:grid;place-content:center;text-align:center;
background:radial-gradient(closest-side,var(--surface) 78%,transparent 80%),conic-gradient(var(--mx-accent) calc(var(--p)*1%),var(--line) 0)}
.mx-ring b{font:400 28px/1 var(--f-display);color:var(--mx-accent);font-variant-numeric:tabular-nums}
.mx-ring small{font-size:12px;color:var(--muted)}
.mx-units{flex:1;min-width:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px}
.mx-su{display:flex;flex-direction:column;gap:4px;min-width:0}
.mx-su b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mx-su small{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.mx-bar{height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.mx-bar i{display:block;height:100%;background:var(--uc)}
@media (max-width:480px){.mx-progress{flex-direction:column;align-items:stretch}.mx-ring{align-self:center}.mx-units{grid-template-columns:repeat(2,minmax(0,1fr))}}
.mx-next{display:flex;flex-direction:column;gap:2px;align-items:flex-start;text-align:start;border:0;border-radius:16px;padding:14px 16px;cursor:pointer;
background:var(--mx-accent);color:var(--mx-on-accent)}
.mx-next small{font-size:13px;opacity:.85}
.mx-next b{font-size:19px}
/* the trail */
.mx-unit{display:flex;flex-direction:column;gap:4px}
.mx-uhead{display:flex;align-items:baseline;gap:4px 10px;flex-wrap:wrap;border-bottom:2px solid var(--uc);padding-bottom:6px}
.mx-uhead h2{font-size:21px;color:var(--uc)}
.mx-uhead span{font-size:13px;color:var(--muted)}
.mx-trail{display:flex;flex-direction:column;gap:4px;padding-top:8px}
.mx-node{display:flex;align-items:center;gap:12px;width:min(76%,330px);padding:6px 8px;border:0;border-radius:14px;background:none;color:inherit;text-align:start;cursor:pointer}
.mx-node:hover{background:var(--surface)}
.mx-trail .mx-node:nth-child(4n+2){margin-inline-start:12%}
.mx-trail .mx-node:nth-child(4n+3){margin-inline-start:24%}
.mx-trail .mx-node:nth-child(4n+4){margin-inline-start:12%}
.mx-dot{flex:none;width:54px;height:54px;border-radius:50%;display:grid;place-items:center;background:var(--surface);border:3px solid var(--uc);color:var(--uc);font:400 20px/1 var(--f-display)}
.mx-lbl{display:flex;flex-direction:column;gap:3px;min-width:0}
.mx-lbl b{font-size:16px;line-height:1.25}
.mx-lbl small{display:flex;gap:6px;flex-wrap:wrap}
.st-done .mx-dot{background:var(--uc);color:var(--surface)}
.st-locked .mx-dot{border-style:dashed;border-color:var(--line);color:var(--muted)}
.st-locked .mx-lbl b{color:var(--muted)}
.mx-node.here .mx-dot{box-shadow:0 0 0 5px var(--mx-accent-soft)}
.mx-core,.mx-go{font:700 11px/1 var(--f-body);padding:4px 7px;border-radius:999px;white-space:nowrap}
.mx-core{background:var(--olive-soft);color:var(--olive)}
.mx-go{background:var(--mx-accent);color:var(--mx-on-accent)}
/* a skill's sheet */
.mx-layer[hidden]{display:none}
.mx-scrim{position:fixed;inset:0;z-index:61;background:var(--mx-scrim)}
.mx-sheet{position:fixed;inset:auto 0 0 0;z-index:62;max-height:88vh;overflow:auto;background:var(--surface);border-radius:20px 20px 0 0;
box-shadow:0 -6px 30px rgb(0 0 0/.2);display:flex;flex-direction:column;gap:14px;
padding-block:16px calc(24px + env(safe-area-inset-bottom, 0px));
padding-left:max(18px, env(safe-area-inset-left, 0px));padding-right:max(18px, env(safe-area-inset-right, 0px))}
@media (min-width:720px){.mx-sheet{inset:auto calc(50% - 330px) 0 calc(50% - 330px)}}
.mx-sheet>p{margin:0}
.mx-shtop{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.mx-shtop h3{font-size:24px;line-height:1.2;margin-top:8px}
.mx-uchip{display:inline-block;font:700 13px/1 var(--f-body);color:var(--uc);border:1px solid var(--uc);padding:5px 10px;border-radius:999px}
.mx-src{display:block;color:var(--muted);font-size:13px;margin-top:4px}
.mx-x{border:0;background:none;color:var(--muted);font-size:22px;line-height:1;padding:6px 10px;border-radius:8px;cursor:pointer}
.mx-hint{background:var(--amber-bg);color:var(--ink);border-radius:12px;padding:10px 12px;font-size:15px;display:flex;flex-direction:column;gap:6px}
.mx-q{background:var(--bg);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:10px}
.mx-q>p{margin:0;font-size:19px}
.mx-choices{display:grid;grid-template-columns:1fr 1fr;gap:8px}
@media (max-width:420px){.mx-choices{grid-template-columns:1fr}}
.mx-choices button{padding:12px;border-radius:12px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:600 17px/1.3 var(--f-body);cursor:pointer}
.mx-choices button:hover{border-color:var(--mx-accent)}
.mx-choices button.right{background:var(--ok-bg);border-color:var(--ok)}
.mx-choices button.wrong{background:var(--sumac-bg);border-color:var(--sumac)}
.mx-ok,.mx-bad{border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.mx-ok{background:var(--ok-bg);color:var(--ok)}
.mx-bad{background:var(--sumac-bg)}
.mx-bad b{color:var(--sumac)}
.mx-small{font-size:13px;color:var(--muted)}
.mx-sec h4{margin:0 0 6px;font:700 12px/1 var(--f-body);letter-spacing:.06em;color:var(--muted)}
.mx-chips{display:flex;gap:6px;flex-wrap:wrap}
.mx-chips em{font-style:normal;color:var(--muted);font-size:14px}
.mx-chip{border:1px solid var(--uc);background:var(--bg);color:var(--ink);font:600 14px/1 var(--f-body);padding:7px 10px;border-radius:999px;cursor:pointer}
.mx-chip.is-done{background:var(--uc);color:var(--surface)}
.mx-plot{direction:ltr;align-self:center;width:100%;max-width:340px}
.mx-plot svg{display:block;width:100%;height:auto}
.mx-plot .g{stroke:var(--line);stroke-width:1}
.mx-plot .a{stroke:var(--muted);stroke-width:1.5}
.mx-plot .c{fill:none;stroke:var(--uc);stroke-width:2.5}
.mx-plot circle{fill:var(--uc)}
.mx-plot text{font:11px var(--f-body);fill:var(--muted)}
/* a photographed problem */
.mx-photo{display:flex;flex-direction:column;gap:3px;align-items:flex-start;text-align:start;border:1.5px dashed var(--mx-accent);border-radius:16px;
padding:14px 16px;background:transparent;color:var(--ink);cursor:pointer}
.mx-photo b{font-size:18px;color:var(--mx-accent)}
.mx-photo small{font-size:14px;color:var(--muted)}
.mx-thumb{display:block;max-width:100%;max-height:180px;object-fit:contain;align-self:center;border-radius:10px;border:1px solid var(--line)}
.mx-pbody{display:flex;flex-direction:column;gap:12px}
.mx-wait{display:flex;flex-direction:column;align-items:center;gap:6px;padding:16px;text-align:center}
.mx-wait small{color:var(--muted)}
.mx-spin{width:26px;height:26px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--mx-accent);animation:mx-spin 1s linear infinite}
@keyframes mx-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.mx-spin{animation:none}}
.mx-read{background:var(--bg);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:2px;align-items:flex-start}
.mx-read small{color:var(--muted);font-size:13px}
.mx-read p{margin:0;font-size:20px}
.mx-link{border:0;background:none;padding:2px 0;color:var(--mx-accent);font:600 14px/1.3 var(--f-body);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.mx-steps{margin:0;padding-inline-start:22px;display:flex;flex-direction:column;gap:10px}
.mx-steps li{padding-inline-start:4px;line-height:1.5}
.mx-steps li::marker{color:var(--mx-accent);font-weight:700}
.mx-work{margin-top:6px;padding:8px 10px;border-radius:10px;background:var(--mx-accent-soft)}
.mx-row{display:flex;gap:8px;flex-wrap:wrap}
@media (prefers-reduced-motion:no-preference){.mx-sheet{animation:mx-up .22s ease-out}@keyframes mx-up{from{transform:translateY(30px);opacity:.4}}}