main.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. :root {
  2. color-scheme: light dark;
  3. --background-color: #fff;
  4. --secondary-background-color: #f7f7f7;
  5. --color-blue: #049EF4;
  6. --text-color: #444;
  7. --secondary-text-color: #9e9e9e;
  8. --font-size: 16px;
  9. --line-height: 26px;
  10. --border-color: #E8E8E8;
  11. --border-style: 1px solid var(--border-color);
  12. --header-height: 48px;
  13. --panel-width: 300px;
  14. --panel-padding: 16px;
  15. --icon-size: 20px;
  16. }
  17. @media (prefers-color-scheme: dark) {
  18. :root {
  19. --background-color: #222;
  20. --secondary-background-color: #2e2e2e;
  21. --text-color: #bbb;
  22. --secondary-text-color: #666;
  23. --border-color: #444;
  24. --border-style: 1px solid var(--border-color);
  25. }
  26. #previewsToggler {
  27. filter: invert(100%);
  28. }
  29. }
  30. @font-face {
  31. font-family: 'Roboto Mono';
  32. src: local('Roboto Mono'), local('RobotoMono-Regular'), url('../files/RobotoMono-Regular.woff2') format('woff2');
  33. font-style: normal;
  34. font-weight: 400;
  35. }
  36. @font-face {
  37. font-family: 'Roboto Mono';
  38. src: local('Roboto Mono Medium'), local('RobotoMono-Medium'), url('../files/RobotoMono-Medium.woff2') format('woff2');
  39. font-style: normal;
  40. font-weight: 500;
  41. }
  42. * {
  43. box-sizing: border-box;
  44. -webkit-font-smoothing: antialiased;
  45. -moz-osx-font-smoothing: grayscale;
  46. }
  47. html, body {
  48. height: 100%;
  49. }
  50. html {
  51. font-size: calc(var(--font-size) - 1px);
  52. line-height: calc(var(--line-height) - 1px);
  53. }
  54. body {
  55. font-family: 'Roboto Mono', monospace;
  56. margin: 0px;
  57. color: var(--text-color);
  58. background-color: var(--background-color);
  59. }
  60. a {
  61. text-decoration: none;
  62. }
  63. h1 {
  64. font-size: 18px;
  65. line-height: 24px;
  66. font-weight: 500;
  67. }
  68. h2 {
  69. padding: 0;
  70. margin: 16px 0;
  71. font-size: calc(var(--font-size) - 1px);
  72. line-height: var(--line-height);
  73. font-weight: 500;
  74. color: var(--color-blue);
  75. }
  76. h3 {
  77. margin: 0;
  78. font-weight: 500;
  79. font-size: calc(var(--font-size) - 1px);
  80. line-height: var(--line-height);
  81. color: var(--secondary-text-color);
  82. }
  83. h1 a {
  84. color: var(--color-blue);
  85. }
  86. hr {
  87. border: 0;
  88. height: 1px;
  89. background-color: var(--border-color);
  90. margin: 16px 0;
  91. }
  92. #header {
  93. display: flex;
  94. height: var(--header-height);
  95. border-bottom: var(--border-style);
  96. align-items: center;
  97. }
  98. #header h1 {
  99. padding-left: var(--panel-padding);
  100. flex: 1;
  101. display: flex;
  102. align-items: center;
  103. color: var(--color-blue);
  104. }
  105. #header #version {
  106. border: 1px solid var(--color-blue);
  107. color: var(--color-blue);
  108. border-radius: 4px;
  109. line-height: 16px;
  110. padding: 0px 2px;
  111. margin-left: 6px;
  112. font-size: .9rem;
  113. }
  114. #panel {
  115. position: fixed;
  116. z-index: 100;
  117. left: 0px;
  118. width: var(--panel-width);
  119. height: 100%;
  120. overflow: auto;
  121. border-right: var(--border-style);
  122. display: flex;
  123. flex-direction: column;
  124. transition: 0s 0s height;
  125. }
  126. #panel #clearSearchButton {
  127. width: 48px;
  128. height: 48px;
  129. display: none;
  130. background-color: var(--text-color);
  131. background-size: var(--icon-size);
  132. -webkit-mask-image: url(../files/ic_close_black_24dp.svg);
  133. -webkit-mask-position: 50% 50%;
  134. -webkit-mask-repeat: no-repeat;
  135. mask-image: url(../files/ic_close_black_24dp.svg);
  136. mask-position: 50% 50%;
  137. mask-repeat: no-repeat;
  138. cursor: pointer;
  139. margin-right: 0px;
  140. }
  141. #panel.searchFocused #clearSearchButton {
  142. display: block;
  143. }
  144. #panel.searchFocused #language {
  145. display: none;
  146. }
  147. #panel.searchFocused #filterInput {
  148. -webkit-mask-image: none;
  149. mask-image: none;
  150. background-color: inherit;
  151. padding-left: 0;
  152. }
  153. #panel #expandButton {
  154. width: 48px;
  155. height: 48px;
  156. margin-right: 4px;
  157. margin-left: 4px;
  158. display: none;
  159. cursor: pointer;
  160. background-color: var(--text-color);
  161. background-size: var(--icon-size);
  162. -webkit-mask-image: url(../files/ic_menu_black_24dp.svg);
  163. -webkit-mask-position: 50% 50%;
  164. -webkit-mask-repeat: no-repeat;
  165. mask-image: url(../files/ic_menu_black_24dp.svg);
  166. mask-position: 50% 50%;
  167. mask-repeat: no-repeat;
  168. }
  169. #panel #sections {
  170. display: flex;
  171. justify-content: center;
  172. z-index: 1000;
  173. position: relative;
  174. height: 100%;
  175. align-items: center;
  176. font-weight: 500;
  177. }
  178. #panel #sections * {
  179. padding: 0 var(--panel-padding);
  180. height: 100%;
  181. position: relative;
  182. display: flex;
  183. justify-content: center;
  184. align-items: center;
  185. }
  186. #panel #sections .selected:after {
  187. content: "";
  188. position: absolute;
  189. left: 0;
  190. right: 0;
  191. bottom: -1px;
  192. border-bottom: 1px solid var(--text-color);
  193. }
  194. #panel #sections a {
  195. color: var(--secondary-text-color);
  196. }
  197. body.home #panel #sections {
  198. display: none;
  199. }
  200. #panel #inputWrapper {
  201. display: flex;
  202. align-items: center;
  203. height: var(--header-height);
  204. padding: 0 0 0 var(--panel-padding);
  205. position: relative;
  206. background: var(--background-color);
  207. }
  208. #panel #inputWrapper:after {
  209. position: absolute;
  210. left: 0;
  211. right: 0;
  212. bottom: 0;
  213. border-bottom: var(--border-style);
  214. content: "";
  215. }
  216. #panel #filterInput {
  217. flex: 1;
  218. width: 100%;
  219. font-size: 1rem;
  220. font-weight: 500;
  221. color: var(--text-color);
  222. outline: none;
  223. border: 0px;
  224. background-color: var(--text-color);
  225. background-size: var(--icon-size);
  226. -webkit-mask-image: url(../files/ic_search_black_24dp.svg);
  227. -webkit-mask-position: 0 50%;
  228. -webkit-mask-repeat: no-repeat;
  229. mask-image: url(../files/ic_search_black_24dp.svg);
  230. mask-position: 0 50%;
  231. mask-repeat: no-repeat;
  232. font-family: 'Roboto Mono', monospace;
  233. }
  234. #panel #language {
  235. font-family: 'Roboto Mono', monospace;
  236. font-size: 1rem;
  237. font-weight: 500;
  238. color: var(--text-color);
  239. border: 0px;
  240. background-image: url(ic_arrow_drop_down_black_24dp.svg);
  241. background-size: var(--icon-size);
  242. background-repeat: no-repeat;
  243. background-position: right center;
  244. background-color: var(--background-color);
  245. padding: 2px 24px 4px 24px;
  246. -webkit-appearance: none;
  247. -moz-appearance: none;
  248. appearance: none;
  249. margin-right: 10px;
  250. text-align-last: right;
  251. }
  252. #panel #language:focus {
  253. outline: none;
  254. }
  255. #contentWrapper {
  256. flex: 1;
  257. overflow: hidden;
  258. display: flex;
  259. flex-direction: column;
  260. }
  261. #panel #content {
  262. flex: 1;
  263. overflow-y: auto;
  264. overflow-x: hidden;
  265. -webkit-overflow-scrolling: touch;
  266. padding: 0 var(--panel-padding) var(--panel-padding) var(--panel-padding);
  267. }
  268. #panel #searchResults {
  269. flex: 1;
  270. overflow-y: auto;
  271. overflow-x: hidden;
  272. -webkit-overflow-scrolling: touch;
  273. padding: 0 var(--panel-padding) var(--panel-padding) var(--panel-padding);
  274. }
  275. #panel #searchResults .search-result-group {
  276. margin-bottom: 12px;
  277. }
  278. #panel #searchResults .search-result-class {
  279. display: block;
  280. color: var(--text-color);
  281. font-weight: 500;
  282. margin-bottom: 2px;
  283. }
  284. #panel #searchResults .search-result-class:hover {
  285. color: var(--color-blue);
  286. }
  287. #panel #searchResults .search-result-member {
  288. display: block;
  289. color: var(--text-color);
  290. margin-left: 16px;
  291. margin-bottom: 1px;
  292. }
  293. #panel #searchResults .search-result-member:hover {
  294. color: var(--color-blue);
  295. }
  296. #panel #searchResults .search-result-class.selected,
  297. #panel #searchResults .search-result-member.selected {
  298. color: var(--color-blue);
  299. text-decoration: underline;
  300. }
  301. #panel #searchResults strong {
  302. font-weight: 600;
  303. }
  304. #panel #content ul {
  305. list-style-type: none;
  306. padding: 0px;
  307. margin: 0px 0 20px 0;
  308. }
  309. #panel #content ul li {
  310. margin: 1px 0;
  311. }
  312. #panel #content h2:not(.hidden) {
  313. margin-top: 16px;
  314. border-top: none;
  315. padding-top: 0;
  316. }
  317. #panel #content h2:not(.hidden) ~ h2 {
  318. margin-top: 32px;
  319. border-top: var(--border-style);
  320. padding-top: 12px;
  321. }
  322. #panel #content h3 {
  323. color: var(--text-color);
  324. font-weight: 900;
  325. }
  326. #panel #content a {
  327. position: relative;
  328. color: var(--text-color);
  329. }
  330. #panel #content a:hover,
  331. #panel #content a:hover .spacer,
  332. #panel #content .selected {
  333. color: var(--color-blue);
  334. }
  335. #panel #content .selected {
  336. text-decoration: underline;
  337. }
  338. #panel #content .hidden {
  339. display: none !important;
  340. }
  341. #panel #content #previewsToggler {
  342. cursor: pointer;
  343. float: right;
  344. margin-top: 18px;
  345. margin-bottom: -18px;
  346. opacity: 0.25;
  347. }
  348. #panel #content.minimal .card {
  349. background-color: transparent;
  350. margin-bottom: 4px;
  351. }
  352. #panel #content.minimal .cover {
  353. display: none;
  354. }
  355. #panel #content.minimal .title {
  356. padding: 0;
  357. }
  358. #panel #content.minimal #previewsToggler {
  359. opacity: 1;
  360. }
  361. body.home #panel #content h2 {
  362. margin-bottom: 2px;
  363. padding-bottom: 0px;
  364. margin-top: 18px;
  365. border-top: none;
  366. padding-top: 6px;
  367. }
  368. .spacer {
  369. color: var(--secondary-text-color);
  370. margin-left: 2px;
  371. padding-right: 2px;
  372. }
  373. #viewer,
  374. iframe {
  375. position: absolute;
  376. border: 0px;
  377. left: 0;
  378. right: 0;
  379. width: 100%;
  380. height: 100%;
  381. overflow: auto;
  382. }
  383. iframe#viewer {
  384. display: none; /* Workaround: The iframe has white background in Chrome for some reason */
  385. }
  386. #viewer {
  387. padding-left: var(--panel-width);
  388. }
  389. #button {
  390. position: fixed;
  391. bottom: 16px;
  392. right: 16px;
  393. padding: 12px;
  394. border-radius: 50%;
  395. margin-bottom: 0px;
  396. background-color: #FFF;
  397. opacity: .9;
  398. z-index: 999;
  399. box-shadow: 0 0 4px rgba(0,0,0,.15);
  400. }
  401. #button:hover {
  402. cursor: pointer;
  403. opacity: 1;
  404. }
  405. #button img {
  406. display: block;
  407. width: var(--icon-size);
  408. }
  409. #button.text {
  410. border-radius: 25px;
  411. padding-right: 20px;
  412. padding-left: 20px;
  413. color: var(--color-blue);
  414. opacity: 1;
  415. font-weight: 500;
  416. }
  417. #projects {
  418. display: grid;
  419. grid-template-columns: repeat(6, 1fr);
  420. line-height: 0;
  421. }
  422. #projects a {
  423. overflow: hidden;
  424. }
  425. #projects a img {
  426. width: 100%;
  427. transform: scale(1.0);
  428. transition: 0.15s transform;
  429. }
  430. #projects a:hover img {
  431. transform: scale(1.08);
  432. }
  433. @media all and ( min-width: 1500px ) {
  434. #projects {
  435. grid-template-columns: repeat(7, 1fr);
  436. }
  437. }
  438. @media all and ( min-width: 1700px ) {
  439. :root {
  440. --panel-width: 360px;
  441. --font-size: 18px;
  442. --line-height: 28px;
  443. --header-height: 56px;
  444. --icon-size: 24px;
  445. }
  446. #projects {
  447. grid-template-columns: repeat(8, 1fr);
  448. }
  449. }
  450. @media all and ( min-width: 1900px ) {
  451. #projects {
  452. grid-template-columns: repeat(9, 1fr);
  453. }
  454. }
  455. @media all and ( max-width: 1300px ) {
  456. #projects {
  457. grid-template-columns: repeat(6, 1fr);
  458. }
  459. }
  460. @media all and ( max-width: 1100px ) {
  461. #projects {
  462. grid-template-columns: repeat(5, 1fr);
  463. }
  464. }
  465. @media all and ( max-width: 900px ) {
  466. #projects {
  467. grid-template-columns: repeat(4, 1fr);
  468. }
  469. }
  470. @media all and ( max-width: 700px ) {
  471. #projects {
  472. grid-template-columns: repeat(3, 1fr);
  473. }
  474. }
  475. .card {
  476. border-radius: 3px;
  477. overflow: hidden;
  478. background-color: var(--secondary-background-color);
  479. padding-bottom: 6px;
  480. margin-bottom: 16px;
  481. }
  482. .card.selected {
  483. box-shadow: 0 0 0 3px var(--color-blue);
  484. text-decoration: none !important;
  485. }
  486. .card .cover {
  487. padding-bottom: 56.25%; /* 16:9 aspect ratio */
  488. position: relative;
  489. overflow: hidden;
  490. }
  491. .card .cover img {
  492. position: absolute;
  493. width: 100%;
  494. top: 50%;
  495. left: 50%;
  496. transform: translate(-50%, -50%);
  497. }
  498. .card .title {
  499. padding: 8px 12px 4px;
  500. font-size: calc(var(--font-size) - 1px);
  501. font-weight: 500;
  502. line-height: calc(var(--line-height) - 6px);
  503. }
  504. .card .tag {
  505. position: absolute;
  506. top: 8px;
  507. right: 8px;
  508. background-color: var(--background-color);
  509. color: var(--color-blue);
  510. padding: 1px 6px 2px;
  511. border-radius: 2px;
  512. font-size: calc(var(--font-size) - 2px);
  513. line-height: calc(var(--line-height) - 6px);
  514. }
  515. /* mobile */
  516. @media all and ( max-width: 640px ) {
  517. :root {
  518. --header-height: 56px;
  519. --icon-size: 24px;
  520. }
  521. #projects {
  522. grid-template-columns: repeat(2, 1fr);
  523. }
  524. #panel #expandButton {
  525. display: block;
  526. }
  527. #panel {
  528. position: absolute;
  529. left: 0;
  530. top: 0;
  531. width: 100%;
  532. right: 0;
  533. z-index: 1000;
  534. overflow-x: hidden;
  535. transition: 0s 0s height;
  536. border: none;
  537. height: var(--header-height);
  538. transition: 0s 0.2s height;
  539. }
  540. #panel.open {
  541. height: 100%;
  542. transition: 0s 0s height;
  543. }
  544. #panelScrim {
  545. pointer-events: none;
  546. background-color: rgba(0,0,0,0);
  547. position: absolute;
  548. left: 0;
  549. right: 0;
  550. top: 0;
  551. bottom: 0;
  552. z-index: 1000;
  553. pointer-events: none;
  554. transition: .2s background-color;
  555. }
  556. #panel.open #panelScrim {
  557. pointer-events: auto;
  558. background-color: rgba(0,0,0,0.4);
  559. }
  560. #contentWrapper {
  561. position: absolute;
  562. right: 0;
  563. top: 0;
  564. bottom: 0;
  565. background: var(--background-color);
  566. box-shadow: 0 0 8px rgba(0,0,0,.1);
  567. width: calc(100vw - 60px);
  568. max-width: 360px;
  569. z-index: 10000;
  570. transition: .25s transform;
  571. overflow-x: hidden;
  572. margin-right: -380px;
  573. line-height: 2rem;
  574. }
  575. #panel.open #contentWrapper {
  576. transform: translate3d(-380px, 0 ,0);
  577. }
  578. #viewer,
  579. iframe {
  580. left: 0;
  581. top: var(--header-height);
  582. width: 100%;
  583. height: calc(100% - var(--header-height));
  584. }
  585. #viewer {
  586. padding-left: 0;
  587. }
  588. }
粤ICP备19079148号