Files

9 lines
315 KiB
HTML
Raw Permalink Normal View History

<!doctype html><html lang="zh-CN"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>齿轮章节闪卡</title><style>BODY{margin:0;background:#eef2f6;color:#152b40;font:17px/1.7 system-ui,"Microsoft YaHei",sans-serif}main{max-width:940px;margin:35px auto;padding:20px}h1{font-size:29px;margin:0}p{color:#53697e}nav,.actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}button,select{font:inherit;border:1px solid #bdcddd;border-radius:10px;background:white;padding:9px 15px;color:inherit;cursor:pointer}button:hover{background:#dceaf5}#card{background:white;border:1px solid #d0dce7;border-radius:22px;padding:32px;min-height:270px;box-shadow:0 12px 35px #1232}#q{font-size:24px;font-weight:650}#a{border-top:1px dashed #ccd9e4;margin-top:25px;padding-top:25px;overflow:auto;font-size:20px}.tag{color:#176d82;font-size:15px}#count{font-variant-numeric:tabular-nums}.katex-display{margin:10px 0}.empty{padding:45px}footer{font-size:14px;color:#53697e}button:focus-visible,select:focus-visible{outline:3px solid #087fbc} @media(max-width:600px){main{margin:0;padding:16px}#card{padding:22px}#q{font-size:21px}.katex{font-size:1em}}</style><style>@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSe
</style><main><h1>齿轮章节 · 三层闪卡</h1><p>先回忆,再翻面。公式要连同适用条件一起记。</p><nav><select id="topic" aria-label="筛选主题"><option value="">全部主题</option></select><select id="layer" aria-label="筛选层级"><option value="">全部层级</option><option value="L1">L1 记忆</option><option value="L2">L2 理解</option><option value="L3">L3 边界判断</option></select><button id="only">只看星标</button><button id="shuffle">打乱顺序</button></nav><div id="count" aria-live="polite"></div><section id="card"><div id="meta" class="tag"></div><div id="q"></div><div id="a" hidden></div></section><div class="actions"><button id="prev">← 上一张</button><button id="flip">显示答案 · 空格</button><button id="next">下一张 →</button><button id="star">☆ 标星</button></div><footer>方向键切换 · 空格翻面 · 星标自动保存在本浏览器。<br>来源:本章知识点整合与背诵版;多步计算请配合本章练习卷。</footer></main><script>!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return Yn}});class r{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;let n,o,s="KaTeX parse error: "+e;const i=t&&t.loc;if(i&&i.start<=i.end){const e=i.lexer.input;n=i.start,o=i.end,n===e.length?s+=" at end of input: ":s+=" at position "+(n+1)+": ";const t=e.slice(n,o).replace(/[^]/g,"$&\u0332");let r,a;r=n>15?"\u2026"+e.slice(n-15,n):e.slice(0,n),a=o+15<e.length?e.slice(o,o+15)+"\u2026":e.slice(o),s+=r+t+a}const a=new Error(s);return a.name="ParseError",a.__proto__=r.prototype,a.position=n,null!=n&&null!=o&&(a.length=o-n),a.rawMessage=e,a}}r.prototype.__proto__=Error.prototype;var n=r;const o=/([A-Z])/g,s={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},i=/[&><"']/g;const a=function(e){return"ordgroup"===e.type||"color"===e.type?1===e.body.length?a(e.body[0]):e:"font"===e.type?a(e.body):e};var l={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(i,(e=>s[e]))},hyphenate:function(e){return e.replace(o,"-$1").toLowerCase()},getBaseElem:a,isCharacterBox:function(e){const t=a(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){const t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}};const h={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefau
const $=id=>document.getElementById(id); let stars;try{stars=new Set(JSON.parse(localStorage.getItem('gear-cards-stars-v1')||'[]'))}catch{stars=new Set()}let list=[],pos=0,only=false,reveal=false;
Object.entries(payload.topics).forEach(([k,v])=>{let o=document.createElement('option');o.value=k;o.textContent=v;$('topic').append(o)});
function filter(){list=payload.cards.filter(c=>(!$('topic').value||c.topic===$('topic').value)&&(!$('layer').value||c.layer===$('layer').value)&&(!only||stars.has(c.id)));pos=0;draw()}
function draw(){reveal=false;$('a').hidden=true;$('flip').textContent='显示答案 · 空格';let c=list[pos];$('count').textContent=list.length?`${pos+1} / ${list.length} 张 · 全套 ${payload.cards.length} 张`:'当前筛选没有卡片';$('q').textContent=c?c.q:'试试调整主题、层级,或关闭“只看星标”。';$('meta').textContent=c?`${payload.topics[c.topic]} · ${c.layer} · 编号 ${c.id}`:'';$('star').textContent=c&&stars.has(c.id)?'★ 已标星':'☆ 标星';['flip','prev','next','star'].forEach(id=>$(id).disabled=!c);$('only').textContent=only?'★ 正在看星标':'只看星标'}
function flip(){let c=list[pos];if(!c)return;reveal=!reveal;$('a').hidden=!reveal;$('flip').textContent=reveal?'隐藏答案 · 空格':'显示答案 · 空格';if(reveal){if(c.a.includes('\\'))katex.render(c.a,$('a'),{displayMode:true,throwOnError:true});else $('a').textContent=c.a}}
function move(d){if(list.length){pos=(pos+d+list.length)%list.length;draw()}}
$('topic').onchange=$('layer').onchange=filter;$('flip').onclick=flip;$('prev').onclick=()=>move(-1);$('next').onclick=()=>move(1);$('only').onclick=()=>{only=!only;filter()};$('shuffle').onclick=()=>{for(let i=list.length-1;i>0;i--){let j=Math.floor(Math.random()*(i+1));[list[i],list[j]]=[list[j],list[i]]}pos=0;draw()};$('star').onclick=()=>{let c=list[pos];if(!c)return;stars.has(c.id)?stars.delete(c.id):stars.add(c.id);try{localStorage.setItem('gear-cards-stars-v1',JSON.stringify([...stars]))}catch{}if(only)filter();else{$('star').textContent=stars.has(c.id)?'★ 已标星':'☆ 标星'}};document.addEventListener('keydown',e=>{if(['SELECT','INPUT','TEXTAREA','BUTTON'].includes(e.target.tagName))return;if(e.code==='Space'){e.preventDefault();flip()}else if(e.code==='ArrowRight')move(1);else if(e.code==='ArrowLeft')move(-1)});filter();</script></html>