lesson.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. body {
  2. margin: 0;
  3. font-family: Georgia, serif;
  4. font-size: 19px;
  5. line-height: 150%;
  6. }
  7. p + p {
  8. margin-top: 1.5em;
  9. }
  10. li > p {
  11. width: calc(100% - 2em);
  12. }
  13. table {
  14. margin-top: 1em;
  15. margin-bottom: 1em;
  16. }
  17. .footnote {
  18. font-size: smaller;
  19. vertical-align: baseline;
  20. position: relative;
  21. top: -0.4em;
  22. }
  23. .footnotes {
  24. font-size: smaller;
  25. }
  26. pre {
  27. background: rgb(143, 140, 140);
  28. padding: 1em;
  29. }
  30. pre>code {
  31. white-space: inherit;
  32. background: none;
  33. }
  34. pre.prettyprint {
  35. margin-top: 2em !important;
  36. margin-bottom: 2em !important;
  37. }
  38. pre.prettyprint li {
  39. white-space: pre;
  40. }
  41. /* to handle long words in paragraph */
  42. p code {
  43. word-break: break-word;
  44. white-space: normal;
  45. }
  46. div[data-diagram] {
  47. height: 100%;
  48. }
  49. .spread {
  50. display: flex;
  51. text-align: center;
  52. margin: 2em auto 3em;
  53. }
  54. .spread div[data-diagram] {
  55. height: 150px;
  56. }
  57. .spread>div {
  58. flex: 1 1 100%;
  59. }
  60. .spread .code {
  61. font-family: monospace;
  62. }
  63. .spread .code>div {
  64. text-align: left;
  65. }
  66. #c {
  67. position: absolute;
  68. top: 0;
  69. left: 0;
  70. width: 100vw;
  71. height: 100vh;
  72. z-index: -100;
  73. }
  74. .border {
  75. border: 1px solid black;
  76. }
  77. .threejs_navbar>div,
  78. .lesson-title,
  79. .lesson-comments,
  80. .lesson-comment-sep,
  81. .lesson-main>* {
  82. margin: 0 auto 1em;
  83. max-width: 700px;
  84. width: calc(100% - 40px);
  85. }
  86. .lesson-main>h1:not(:first-child),
  87. .lesson-main>h2:not(:first-child),
  88. .lesson-main>h3:not(:first-child),
  89. .lesson-main>h4:not(:first-child),
  90. .lesson-main>h5:not(:first-child),
  91. .lesson-main>h6:not(:first-child) {
  92. margin-top: 1.66em;
  93. }
  94. .lesson-main>.threejs_example_container {
  95. max-width: 90%;
  96. }
  97. .lesson-main>img {
  98. width: unset;
  99. }
  100. .threejs_example {
  101. width: 100%;
  102. height: 500px;
  103. }
  104. .threejs_header {
  105. background-image: url(/threejs/lessons/resources/banner-00.jpg);
  106. background-size: cover;
  107. background-position: center, center;
  108. padding: 1em;
  109. text-align: center;
  110. }
  111. .threejs_header h1 {
  112. font-size: 5vw;
  113. margin: 0;
  114. background-image: url(/threejs/lessons/resources/logo.png);
  115. background-size: contain;
  116. background-position: center center;
  117. background-repeat: no-repeat;
  118. font-weight: bold;
  119. color: black;
  120. /*
  121. text-shadow: 0px 0px 15px #fff,
  122. 0px 0px 5px #fff,
  123. 0px 0px 10px #fff;
  124. */
  125. }
  126. .threejs_header a {
  127. color: rgba(0, 0, 0, 0);
  128. text-decoration: none;
  129. }
  130. .threejs_navbar {
  131. background: black;
  132. color: white;
  133. }
  134. .threejs_navbar a {
  135. color: white;
  136. }
  137. .threejs_navbar>div {
  138. margin: 0 auto;
  139. display: flex;
  140. justify-content: space-between;
  141. align-items: center;
  142. }
  143. .threejs_navbar>div>* {
  144. display: block;
  145. margin: .25em 0;
  146. }
  147. .threejs_navbar select {
  148. background: #444;
  149. border: none;
  150. font-size: large;
  151. color: white;
  152. }
  153. .home-lang select {
  154. font-size: large;
  155. }
  156. .checkerboard {
  157. background-color: #404040;
  158. background-image:
  159. linear-gradient(45deg, #808080 25%, transparent 25%),
  160. linear-gradient(-45deg, #808080 25%, transparent 25%),
  161. linear-gradient(45deg, transparent 75%, #808080 75%),
  162. linear-gradient(-45deg, transparent 75%, #808080 75%);
  163. background-size: 20px 20px;
  164. background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  165. }
  166. .fullscreen {
  167. position: fixed !important;
  168. left: 0;
  169. top: 0;
  170. width: 100vw !important;
  171. height: 100vh !important;
  172. z-index: 100;
  173. }
  174. .lesson-main>blockquote {
  175. background-color: #DEF;
  176. padding: 1em;
  177. }
  178. .lesson-title {
  179. margin-top: 3em;
  180. margin-bottom: 2em;
  181. }
  182. .lesson-sidebar {
  183. font-size: small;
  184. columns: 220px;
  185. padding: 1em;
  186. column-rule: dashed 1px #CCC;
  187. background: #eee;
  188. margin-bottom: 1em;
  189. }
  190. .lesson-sidebar>ul>li {
  191. line-height: 1.3em;
  192. }
  193. .lesson-sidebar ul {
  194. line-height: 1.3em;
  195. margin-bottom: 1em;
  196. }
  197. .lesson-sidebar ul {
  198. list-style-type: none;
  199. padding-left: 1em;
  200. text-indent: -1em;
  201. }
  202. h1, h2, h3, h4 {
  203. font-family: sans-serif;
  204. line-height: 1.2;
  205. }
  206. h3 {
  207. font-size: medium;
  208. }
  209. code {
  210. color: black;
  211. font-family: monospace;
  212. background-color: #ddd;
  213. padding: 0.1em 0.2em 0.1em 0.2em;
  214. border-radius: 0.5em;
  215. white-space: nowrap;
  216. }
  217. .threejs_table_div_center {
  218. text-align: center;
  219. }
  220. .threejs_table_center {
  221. margin-left: auto;
  222. margin-right: auto;
  223. }
  224. .threejs_center {
  225. margin-left: auto;
  226. margin-top: 1em;
  227. margin-bottom: 1em;
  228. margin-right: auto;
  229. display: block;
  230. text-align: center;
  231. max-width: 95%;
  232. }
  233. .threejs_center>img,
  234. .threejs_center>object {
  235. max-width: 100%;
  236. }
  237. .threejs_image>img {
  238. width: 100%;
  239. display: block;
  240. }
  241. .threejs_math {
  242. margin-left: auto;
  243. margin-right: auto;
  244. display: inline-block;
  245. text-align: left;
  246. }
  247. .threejs_math_center {
  248. display: block;
  249. text-align: center;
  250. }
  251. .hcenter {
  252. display: -webkit-box;
  253. -webkit-box-orient: horizontal;
  254. -webkit-box-pack: center;
  255. -webkit-box-align: center;
  256. display: -moz-box;
  257. -moz-box-orient: horizontal;
  258. -moz-box-pack: center;
  259. -moz-box-align: center;
  260. display: box;
  261. box-orient: horizontal;
  262. box-pack: center;
  263. box-align: center;
  264. }
  265. table.vertex_table {
  266. border: 1px solid black;
  267. border-collapse: collapse;
  268. font-family: monospace;
  269. font-size: small;
  270. }
  271. table.vertex_table th {
  272. background-color: #88ccff;
  273. padding-right: 1em;
  274. padding-left: 1em;
  275. }
  276. table.vertex_table td {
  277. border: 1px solid black;
  278. text-align: right;
  279. padding-right: 1em;
  280. padding-left: 1em;
  281. }
  282. iframe {
  283. display: block;
  284. }
  285. iframe.body {
  286. height: 100vh;
  287. }
  288. iframe.threejs_example, iframe.threejs_diagram {
  289. border: none;
  290. margin-left: auto;
  291. margin-right: auto;
  292. display: block;
  293. }
  294. iframe.threejs_example {
  295. background: black;
  296. }
  297. iframe.noborder {
  298. border: none !important;
  299. }
  300. .threejs_example_container>div {
  301. border: 1px solid black;
  302. margin: 0 auto;
  303. }
  304. iframe.external_diagram {
  305. border: none;
  306. margin-left: auto;
  307. margin-right: auto;
  308. display: block;
  309. }
  310. div.threejs_bottombar {
  311. border: 1px solid #000;
  312. background-color: #def;
  313. padding: 1em;
  314. width: calc(100% - 80px);
  315. }
  316. div.threejs_bottombar>h3 {
  317. font-size: x-large;
  318. font-weight: bold;
  319. margin-bottom: 1em;
  320. }
  321. div.threejs_bottombar code {
  322. background-color: #ccc;
  323. }
  324. /* --- Prettify --- */
  325. pre.prettyprint .nocode { background-color: none; color: #FFF }
  326. pre.prettyprint .str { color: #b9ca4a } /* string */
  327. pre.prettyprint .kwd { color: #c397d8 } /* keyword */
  328. pre.prettyprint .com { color: #f3efb2 } /* comment */
  329. pre.prettyprint .typ { color: #7aa6da } /* type */
  330. pre.prettyprint .lit { color: #45e7a6 } /* literal */
  331. pre.prettyprint .pun { color: #7ecce0 } /* punctuation */
  332. pre.prettyprint .pln { color: #eaeaea } /* plaintext */
  333. pre.prettyprint .tag { color: #d54e53 } /* html/xml tag */
  334. pre.prettyprint .atn { color: #e78c45 } /* attribute name */
  335. pre.prettyprint .atv { color: #70c0b1 } /* attribute value */
  336. pre.prettyprint .dec { color: #e78c45 } /* decimal */
  337. pre.prettyprint .var { color: #d54e53 } /* variable name */
  338. pre.prettyprint .fun { color: #7aa6da } /* function name */
  339. pre.prettyprint ul.modifiedlines {
  340. list-style-type: none;
  341. padding-left: 0;
  342. }
  343. pre.prettyprint ul.modifiedlines li.linemodified {
  344. list-style-type: none;
  345. background-color: #324840;
  346. }
  347. pre.prettyprint ul.modifiedlines li.linedeleted {
  348. list-style-type: none;
  349. background-color: #4c1414;
  350. text-decoration: line-through;
  351. }
  352. pre.prettyprint ul.modifiedlines li.lineadded {
  353. list-style-type: none;
  354. background-color: #3f4463;
  355. }
  356. pre.prettyprint, code.prettyprint {
  357. color: #FFF;
  358. background: #222;
  359. border: 1px solid #000;
  360. box-shadow: 10px 10px 0px #ccc;
  361. font-size: 9pt;
  362. font-family: "Lucida Console", Monaco, monospace;
  363. margin: auto;
  364. padding: 1em;
  365. text-align: left; /* override justify on body */
  366. /* this was disabled until 2016-08-26 but I don't know why */
  367. overflow: auto; /* allow scroll bar in case of long lines - goes together with white-space: nowrap! */
  368. white-space: pre; /* was nowrap, prevent line wrapping */
  369. line-height: 1.5em;
  370. width: calc(100% - 80px);
  371. }
  372. pre.prettyprint.lighttheme, code.prettyprint.lighttheme {
  373. color: #222;
  374. background: #fff;
  375. border: 1px solid #888;
  376. box-shadow: none;
  377. }
  378. pre.prettyprint.lighttheme .str { color: #183691; } /* string content */
  379. pre.prettyprint.lighttheme .kwd { color: #a71d5d; } /* keyword */
  380. pre.prettyprint.lighttheme .com { color: #969896; } /* comment */
  381. pre.prettyprint.lighttheme .typ { color: #0086b3; } /* type name */
  382. pre.prettyprint.lighttheme .lit { color: #0086b3; } /* literal value */
  383. pre.prettyprint.lighttheme .pun { color: #333; } /* punctuation */
  384. pre.prettyprint.lighttheme .opn { color: #333; } /* lisp open bracket */
  385. pre.prettyprint.lighttheme .clo { color: #333; } /* lisp close bracket */
  386. pre.prettyprint.lighttheme .tag { color: #000080; } /* markup tag name */
  387. pre.prettyprint.lighttheme .atn { color: #795da3; } /* markup attribute name */
  388. pre.prettyprint.lighttheme .atv { color: #183691; } /* markup attribute value */
  389. pre.prettyprint.lighttheme .dec { color: #333; } /* declaration */
  390. pre.prettyprint.lighttheme .var { color: #008080; } /* variable name */
  391. pre.prettyprint.lighttheme .fun { color: #900; } /* function name */
  392. @media print {
  393. pre.prettyprint .str, code.prettyprint .str{color:#060}
  394. pre.prettyprint .kwd, code.prettyprint .kwd{color:#006;font-weight:bold}
  395. pre.prettyprint .com, code.prettyprint .com{color:#600;font-style:italic}
  396. pre.prettyprint .typ, code.prettyprint .typ{color:#404;font-weight:bold}
  397. pre.prettyprint .lit, code.prettyprint .lit{color:#044}
  398. pre.prettyprint .pun, code.prettyprint .pun{color:#440}
  399. pre.prettyprint .pln, code.prettyprint .pln{color:#000}
  400. pre.prettyprint .tag, code.prettyprint .tag{color:#006;font-weight:bold}
  401. pre.prettyprint .atn, code.prettyprint .atn{color:#404}
  402. pre.prettyprint .atv, code.prettyprint .atv{color:#060}
  403. pre.prettyprint, code.prettyprint {
  404. color: #000;
  405. background: #EEE;
  406. font-size: 8pt;
  407. font-family: "Lucida Console", Monaco, monospace;
  408. width: 95%;
  409. margin: auto;
  410. padding: 1em;
  411. text-align: left; /* override justify on body */
  412. overflow: visible;
  413. white-space: pre; /* was nowrap, prevent line wrapping */
  414. line-height: 1.5;
  415. }
  416. pre.prettyprint ul.modifiedlines li.linemodified {
  417. list-style-type: none;
  418. background-color: #DDD;
  419. }
  420. pre.prettyprint ul.modifiedlines li.linedeleted {
  421. list-style-type: none;
  422. background-color: #CCC;
  423. text-decoration: line-through;
  424. }
  425. pre.prettyprint ul.modifiedlines li.lineadded {
  426. list-style-type: none;
  427. background-color: #EEE;
  428. }
  429. body {
  430. margin: 10mm;
  431. }
  432. .doubleSpace p {
  433. line-height: 2.5;
  434. font-size: x-large;
  435. }
  436. .doubleSpace pre.prettyprint {
  437. font-size: 14pt;
  438. }
  439. .threejs_navbar,
  440. .lesson-comment-sep,
  441. .lesson-sidebar,
  442. .lesson-comments {
  443. display: none;
  444. }
  445. }
  446. @media (max-width: 720px) {
  447. body {
  448. font-size: 16px;
  449. }
  450. h1 {
  451. font-size: 24px;
  452. }
  453. .threejs_example {
  454. max-height: 400px;
  455. }
  456. .threejs_example_container>div {
  457. max-width: 95%;
  458. }
  459. .threejs_diagram_container iframe {
  460. max-width: 95%;
  461. }
  462. }
  463. iframe.background {
  464. max-width: 100%;
  465. }
  466. }
  467. @media (prefers-color-scheme: dark) {
  468. body {
  469. background: #333;
  470. color: #CCC;
  471. }
  472. a {
  473. color: #56d3fd;
  474. }
  475. pre.prettyprint, code.prettyprint {
  476. box-shadow: 10px 10px 0px #292929;
  477. }
  478. code {
  479. background: #666;
  480. color: #CCC;
  481. }
  482. img {
  483. background: #DDD;
  484. }
  485. img[src$=".svg"] {
  486. filter: invert(1) hue-rotate(180deg);
  487. background: none;
  488. }
  489. .noinvertdark {
  490. filter: none !important;
  491. }
  492. .nobg {
  493. background: none;
  494. }
  495. .lesson-sidebar {
  496. background: #222;
  497. }
  498. .lesson-main>blockquote {
  499. background-color: #1b1b44;
  500. }
  501. div.threejs_bottombar {
  502. background-color: #1b1b44;
  503. }
  504. div.threejs_bottombar code {
  505. background-color: #348;
  506. }
  507. }
粤ICP备19079148号