lesson.css 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. /* TODO Use ../files/main.css instead */
  2. :root {
  3. color-scheme: light dark;
  4. --color-blue: #049EF4;
  5. --text-color: #444;
  6. --font-size: 16px;
  7. --line-height: 26px;
  8. --border-style: 1px solid #E8E8E8;
  9. --panel-width: 300px;
  10. --page-padding: 24px;
  11. --max-width: 760px;
  12. --icon-size: 20px;
  13. }
  14. @media (prefers-color-scheme: dark) {
  15. :root {
  16. --background-color: #222;
  17. --secondary-background-color: #2e2e2e;
  18. --text-color: #bbb;
  19. --secondary-text-color: #666;
  20. --border-style: 1px solid #444;
  21. }
  22. }
  23. @font-face {
  24. font-family: 'Roboto Mono';
  25. src: local('Roboto Mono'), local('RobotoMono-Regular'), url('../../files/RobotoMono-Regular.woff2') format('woff2');
  26. font-style: normal;
  27. font-weight: 400;
  28. }
  29. @font-face {
  30. font-family: 'Inter';
  31. font-style: normal;
  32. font-weight: 400;
  33. src: local('Inter-Regular'), url("../../files/Inter-Regular.woff2?v=3.6") format("woff2");
  34. }
  35. @font-face {
  36. font-family: 'Inter';
  37. font-style: normal;
  38. font-weight: 600;
  39. src: local('Inter-SemiBold'), url("../../files/Inter-SemiBold.woff2?v=3.6") format("woff2");
  40. }
  41. html {
  42. font-family: 'Inter', sans-serif;
  43. font-size: var(--font-size);
  44. line-height: var(--line-height);
  45. }
  46. body {
  47. color: var(--text-color);
  48. tab-size: 4;
  49. overflow: auto;
  50. max-width: var(--max-width);
  51. margin: 0 auto;
  52. padding-top: var(--page-padding);
  53. padding-bottom: var(--page-padding);
  54. padding-right: var(--page-padding);
  55. padding-left: calc(var(--page-padding) + var(--panel-width));
  56. word-break: break-word;
  57. }
  58. a {
  59. color: var(--color-blue);
  60. cursor: pointer;
  61. text-decoration: none;
  62. }
  63. h1 {
  64. font-size: 40px;
  65. line-height: 48px;
  66. font-weight: normal;
  67. margin-left: -2px;
  68. margin-top: 16px;
  69. margin-bottom: -8px;
  70. }
  71. p {
  72. margin-top: 16px;
  73. margin-bottom: 16px;
  74. padding-right: 16px;
  75. }
  76. li > p {
  77. width: calc(100% - 2em);
  78. }
  79. table {
  80. margin-top: 1em;
  81. margin-bottom: 1em;
  82. width: 100%;
  83. border-collapse: collapse;
  84. }
  85. .desc {
  86. padding-left: 0px;
  87. }
  88. table th,
  89. table td {
  90. text-align: left;
  91. vertical-align: top;
  92. padding: 8px 6px;
  93. border-bottom: var(--border-style);
  94. }
  95. table th {
  96. text-decoration: none;
  97. }
  98. table th:first-child,
  99. table td:first-child {
  100. padding-left: 0;
  101. }
  102. .warning {
  103. padding: 1em;
  104. background: red;
  105. }
  106. .footnote {
  107. font-size: smaller;
  108. vertical-align: baseline;
  109. position: relative;
  110. top: -0.4em;
  111. }
  112. .footnotes {
  113. font-size: smaller;
  114. }
  115. .deep-link {
  116. position: absolute;
  117. transform: translateX(-1em);
  118. }
  119. pre {
  120. background: rgb(143, 140, 140);
  121. padding: 1em;
  122. position: relative;
  123. }
  124. pre>code {
  125. white-space: inherit;
  126. background: none;
  127. }
  128. pre.prettyprint {
  129. margin-top: 2em !important;
  130. margin-bottom: 2em !important;
  131. position: relative;
  132. }
  133. pre.prettyprint li {
  134. white-space: pre;
  135. }
  136. pre.prettyprint code, .dos {
  137. color: #CCC;
  138. font-family: var(--code-block-font-family);
  139. display: block;
  140. }
  141. /* to handle long words in paragraph */
  142. p code {
  143. word-break: break-word;
  144. white-space: normal;
  145. }
  146. div[data-diagram] {
  147. height: 100%;
  148. }
  149. .spread {
  150. display: flex;
  151. text-align: center;
  152. margin: 2em auto 3em;
  153. }
  154. .spread div[data-diagram] {
  155. height: 150px;
  156. }
  157. .spread>div {
  158. flex: 1 1 100%;
  159. }
  160. .spread .code {
  161. font-family: var(--code-font-family);
  162. }
  163. .spread .code>div {
  164. text-align: left;
  165. }
  166. #c {
  167. position: absolute;
  168. top: 0;
  169. left: 0;
  170. width: 100%;
  171. height: 100%;
  172. z-index: -100;
  173. }
  174. .border {
  175. border: 1px solid black;
  176. }
  177. .lesson-comment-notes {
  178. padding: 1em;
  179. margin: 1em;
  180. background: #DDD;
  181. color: red;
  182. }
  183. .threejs_navbar>div,
  184. .lesson-comments,
  185. .lesson-comment-sep,
  186. .lesson-main>h1:not(:first-child),
  187. .lesson-main>h2:not(:first-child),
  188. .lesson-main>h3:not(:first-child),
  189. .lesson-main>h4:not(:first-child),
  190. .lesson-main>h5:not(:first-child),
  191. .lesson-main>h6:not(:first-child) {
  192. margin-top: 1.66em;
  193. }
  194. .lesson-main>.threejs_example_container {
  195. max-width: 90%;
  196. }
  197. .lesson-main>img {
  198. width: unset;
  199. }
  200. .threejs_example {
  201. width: 100%;
  202. height: 500px;
  203. }
  204. .color {
  205. padding: 0.25em;
  206. border-radius: 0.5em;
  207. color: black;
  208. }
  209. .dark-color {
  210. padding: 0.25em;
  211. border-radius: 0.5em;
  212. color: white;
  213. }
  214. .checkerboard {
  215. background-color: #404040;
  216. background-image:
  217. linear-gradient(45deg, #808080 25%, transparent 25%),
  218. linear-gradient(-45deg, #808080 25%, transparent 25%),
  219. linear-gradient(45deg, transparent 75%, #808080 75%),
  220. linear-gradient(-45deg, transparent 75%, #808080 75%);
  221. background-size: 20px 20px;
  222. background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  223. }
  224. .fullscreen {
  225. position: fixed !important;
  226. left: var(--panel-width);
  227. top: 0;
  228. width: calc(100% - var(--panel-width)) !important;
  229. height: 100% !important;
  230. z-index: 100;
  231. }
  232. .lesson-main>blockquote {
  233. background-color: #DEF;
  234. padding: 1em;
  235. }
  236. .lesson-sidebar {
  237. font-size: small;
  238. columns: 220px;
  239. padding: 1em;
  240. column-rule: dashed 1px #CCC;
  241. background: #eee;
  242. margin-bottom: 1em;
  243. }
  244. .lesson-sidebar>ul>li {
  245. line-height: 1.3em;
  246. }
  247. .lesson-sidebar ul {
  248. line-height: 1.3em;
  249. margin-bottom: 1em;
  250. }
  251. .lesson-sidebar ul {
  252. list-style-type: none;
  253. padding-left: 1em;
  254. text-indent: -1em;
  255. }
  256. code {
  257. color: black;
  258. background-color: #ddd;
  259. padding: 0.1em 0.2em 0.1em 0.2em;
  260. white-space: nowrap;
  261. }
  262. .threejs_table_div_center {
  263. text-align: center;
  264. }
  265. .threejs_table_center {
  266. margin-left: auto;
  267. margin-right: auto;
  268. }
  269. .threejs_center {
  270. margin-left: auto;
  271. margin-top: 1em;
  272. margin-bottom: 1em;
  273. margin-right: auto;
  274. display: block;
  275. text-align: center;
  276. max-width: 95%;
  277. }
  278. .threejs_center>img,
  279. .threejs_center>object {
  280. max-width: 100%;
  281. }
  282. .threejs_image>img {
  283. width: 100%;
  284. display: block;
  285. }
  286. .threejs_math {
  287. margin-left: auto;
  288. margin-right: auto;
  289. display: inline-block;
  290. text-align: left;
  291. }
  292. .threejs_math_center {
  293. display: block;
  294. text-align: center;
  295. }
  296. .hcenter {
  297. display: -webkit-box;
  298. -webkit-box-orient: horizontal;
  299. -webkit-box-pack: center;
  300. -webkit-box-align: center;
  301. display: -moz-box;
  302. -moz-box-orient: horizontal;
  303. -moz-box-pack: center;
  304. -moz-box-align: center;
  305. display: box;
  306. box-orient: horizontal;
  307. box-pack: center;
  308. box-align: center;
  309. }
  310. table.vertex_table {
  311. border: 1px solid black;
  312. border-collapse: collapse;
  313. font-family: monospace;
  314. font-size: small;
  315. }
  316. table.vertex_table th {
  317. background-color: #88ccff;
  318. padding-right: 1em;
  319. padding-left: 1em;
  320. }
  321. table.vertex_table td {
  322. border: 1px solid black;
  323. text-align: right;
  324. padding-right: 1em;
  325. padding-left: 1em;
  326. }
  327. iframe {
  328. display: block;
  329. }
  330. iframe.body {
  331. height: 100%;
  332. }
  333. iframe.threejs_example, iframe.threejs_diagram {
  334. border: none;
  335. margin-left: auto;
  336. margin-right: auto;
  337. display: block;
  338. }
  339. iframe.threejs_example {
  340. background: black;
  341. }
  342. iframe.noborder {
  343. border: none !important;
  344. }
  345. .threejs_example_container>div {
  346. border: 1px solid black;
  347. margin: 0 auto;
  348. }
  349. iframe.external_diagram {
  350. border: none;
  351. margin-left: auto;
  352. margin-right: auto;
  353. display: block;
  354. }
  355. div.threejs_bottombar {
  356. background-color: #def;
  357. margin-top: var(--page-padding);
  358. outline: var(--page-padding) solid #def;
  359. }
  360. div.threejs_bottombar>h3 {
  361. font-size: x-large;
  362. font-weight: bold;
  363. margin-bottom: 1em;
  364. }
  365. div.threejs_bottombar code {
  366. background-color: #ccc;
  367. }
  368. .dos {
  369. color: var(--text-color);
  370. line-height: 1;
  371. }
  372. @media (max-width: 720px) {
  373. .threejs_example {
  374. max-height: 400px;
  375. }
  376. .threejs_example_container>div {
  377. max-width: 95%;
  378. }
  379. .threejs_diagram_container iframe {
  380. max-width: 95%;
  381. }
  382. iframe.background {
  383. max-width: 100%;
  384. }
  385. }
  386. @media all and ( min-width: 1700px ) {
  387. :root {
  388. --panel-width: 360px;
  389. --font-size: 18px;
  390. --line-height: 28px;
  391. --max-width: 880px;
  392. --page-padding: 28px;
  393. --icon-size: 24px;
  394. }
  395. h1 {
  396. font-size: 42px;
  397. line-height: 50px;
  398. }
  399. }
  400. @media all and ( max-width: 640px ) {
  401. :root {
  402. --page-padding: 16px;
  403. --icon-size: 24px;
  404. }
  405. body {
  406. padding: var(--page-padding);
  407. }
  408. h1 {
  409. font-size: 28px;
  410. line-height: 36px;
  411. padding-right: 20px;
  412. margin-top: 0;
  413. }
  414. }
  415. @media (prefers-color-scheme: dark) {
  416. html {
  417. scrollbar-color: hsl(0, 0%, 35%) hsl(0, 0%, 13%);
  418. }
  419. .warning {
  420. background: darkred;
  421. }
  422. code {
  423. background: #666;
  424. color: #CCC;
  425. }
  426. img {
  427. background: #DDD;
  428. }
  429. img[src$=".svg"] {
  430. filter: invert(1) hue-rotate(180deg);
  431. background: none;
  432. }
  433. .noinvertdark {
  434. filter: none !important;
  435. }
  436. .nobg {
  437. background: none;
  438. }
  439. .lesson-sidebar {
  440. background: #222;
  441. }
  442. .lesson-main>blockquote {
  443. background-color: #1b1b44;
  444. }
  445. div.threejs_bottombar {
  446. background-color: #1b1b44;
  447. outline: var(--page-padding) solid #1b1b44;
  448. }
  449. div.threejs_bottombar code {
  450. background-color: #348;
  451. }
  452. .lesson-comment-notes {
  453. background: #222;
  454. }
  455. input[type=text] {
  456. background: #444;
  457. color: white;
  458. border: none;
  459. padding: 3px;
  460. }
  461. }
粤ICP备19079148号