main.css 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  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 #content ul {
  269. list-style-type: none;
  270. padding: 0px;
  271. margin: 0px 0 20px 0;
  272. }
  273. #panel #content ul li {
  274. margin: 1px 0;
  275. }
  276. #panel #content h2:not(.hidden) {
  277. margin-top: 16px;
  278. border-top: none;
  279. padding-top: 0;
  280. }
  281. #panel #content h2:not(.hidden) ~ h2 {
  282. margin-top: 32px;
  283. border-top: var(--border-style);
  284. padding-top: 12px;
  285. }
  286. #panel #content h3 {
  287. color: var(--text-color);
  288. font-weight: 900;
  289. }
  290. #panel #content a {
  291. position: relative;
  292. color: var(--text-color);
  293. }
  294. #panel #content a:hover,
  295. #panel #content a:hover .spacer,
  296. #panel #content .selected {
  297. color: var(--color-blue);
  298. }
  299. #panel #content .selected {
  300. text-decoration: underline;
  301. }
  302. #panel #content .hidden {
  303. display: none !important;
  304. }
  305. #panel #content #previewsToggler {
  306. cursor: pointer;
  307. float: right;
  308. margin-top: 18px;
  309. margin-bottom: -18px;
  310. opacity: 0.25;
  311. }
  312. #panel #content.minimal .card {
  313. background-color: transparent;
  314. margin-bottom: 4px;
  315. }
  316. #panel #content.minimal .cover {
  317. display: none;
  318. }
  319. #panel #content.minimal .title {
  320. padding: 0;
  321. }
  322. #panel #content.minimal #previewsToggler {
  323. opacity: 1;
  324. }
  325. body.home #panel #content h2 {
  326. margin-bottom: 2px;
  327. padding-bottom: 0px;
  328. margin-top: 18px;
  329. border-top: none;
  330. padding-top: 6px;
  331. }
  332. .spacer {
  333. color: var(--secondary-text-color);
  334. margin-left: 2px;
  335. padding-right: 2px;
  336. }
  337. #viewer,
  338. iframe {
  339. position: absolute;
  340. border: 0px;
  341. left: 0;
  342. right: 0;
  343. width: 100%;
  344. height: 100%;
  345. overflow: auto;
  346. }
  347. iframe#viewer {
  348. display: none; /* Workaround: The iframe has white background in Chrome for some reason */
  349. }
  350. #viewer {
  351. padding-left: var(--panel-width);
  352. }
  353. #button {
  354. position: fixed;
  355. bottom: 16px;
  356. right: 16px;
  357. padding: 12px;
  358. border-radius: 50%;
  359. margin-bottom: 0px;
  360. background-color: #FFF;
  361. opacity: .9;
  362. z-index: 999;
  363. box-shadow: 0 0 4px rgba(0,0,0,.15);
  364. }
  365. #button:hover {
  366. cursor: pointer;
  367. opacity: 1;
  368. }
  369. #button img {
  370. display: block;
  371. width: var(--icon-size);
  372. }
  373. #button.text {
  374. border-radius: 25px;
  375. padding-right: 20px;
  376. padding-left: 20px;
  377. color: var(--color-blue);
  378. opacity: 1;
  379. font-weight: 500;
  380. }
  381. #projects {
  382. display: grid;
  383. grid-template-columns: repeat(6, 1fr);
  384. line-height: 0;
  385. }
  386. #projects a {
  387. overflow: hidden;
  388. }
  389. #projects a img {
  390. width: 100%;
  391. transform: scale(1.0);
  392. transition: 0.15s transform;
  393. }
  394. #projects a:hover img {
  395. transform: scale(1.08);
  396. }
  397. @media all and ( min-width: 1500px ) {
  398. #projects {
  399. grid-template-columns: repeat(7, 1fr);
  400. }
  401. }
  402. @media all and ( min-width: 1700px ) {
  403. :root {
  404. --panel-width: 360px;
  405. --font-size: 18px;
  406. --line-height: 28px;
  407. --header-height: 56px;
  408. --icon-size: 24px;
  409. }
  410. #projects {
  411. grid-template-columns: repeat(8, 1fr);
  412. }
  413. }
  414. @media all and ( min-width: 1900px ) {
  415. #projects {
  416. grid-template-columns: repeat(9, 1fr);
  417. }
  418. }
  419. @media all and ( max-width: 1300px ) {
  420. #projects {
  421. grid-template-columns: repeat(6, 1fr);
  422. }
  423. }
  424. @media all and ( max-width: 1100px ) {
  425. #projects {
  426. grid-template-columns: repeat(5, 1fr);
  427. }
  428. }
  429. @media all and ( max-width: 900px ) {
  430. #projects {
  431. grid-template-columns: repeat(4, 1fr);
  432. }
  433. }
  434. @media all and ( max-width: 700px ) {
  435. #projects {
  436. grid-template-columns: repeat(3, 1fr);
  437. }
  438. }
  439. .card {
  440. border-radius: 3px;
  441. overflow: hidden;
  442. background-color: var(--secondary-background-color);
  443. padding-bottom: 6px;
  444. margin-bottom: 16px;
  445. }
  446. .card.selected {
  447. box-shadow: 0 0 0 3px var(--color-blue);
  448. text-decoration: none !important;
  449. }
  450. .card .cover {
  451. padding-bottom: 56.25%; /* 16:9 aspect ratio */
  452. position: relative;
  453. overflow: hidden;
  454. }
  455. .card .cover img {
  456. position: absolute;
  457. width: 100%;
  458. top: 50%;
  459. left: 50%;
  460. transform: translate(-50%, -50%);
  461. }
  462. .card .title {
  463. padding: 8px 12px 4px;
  464. font-size: calc(var(--font-size) - 1px);
  465. font-weight: 500;
  466. line-height: calc(var(--line-height) - 6px);
  467. }
  468. .card .tag {
  469. background-color: var(--background-color);
  470. color: var(--color-blue);
  471. margin-left: 6px;
  472. padding: 1px 6px 2px;
  473. border-radius: 2px;
  474. font-size: calc(var(--font-size) - 2px);
  475. line-height: calc(var(--line-height) - 6px);
  476. }
  477. /* mobile */
  478. @media all and ( max-width: 640px ) {
  479. :root {
  480. --header-height: 56px;
  481. --icon-size: 24px;
  482. }
  483. #projects {
  484. grid-template-columns: repeat(2, 1fr);
  485. }
  486. #panel #expandButton {
  487. display: block;
  488. }
  489. #panel {
  490. position: absolute;
  491. left: 0;
  492. top: 0;
  493. width: 100%;
  494. right: 0;
  495. z-index: 1000;
  496. overflow-x: hidden;
  497. transition: 0s 0s height;
  498. border: none;
  499. height: var(--header-height);
  500. transition: 0s 0.2s height;
  501. }
  502. #panel.open {
  503. height: 100%;
  504. transition: 0s 0s height;
  505. }
  506. #panelScrim {
  507. pointer-events: none;
  508. background-color: rgba(0,0,0,0);
  509. position: absolute;
  510. left: 0;
  511. right: 0;
  512. top: 0;
  513. bottom: 0;
  514. z-index: 1000;
  515. pointer-events: none;
  516. transition: .2s background-color;
  517. }
  518. #panel.open #panelScrim {
  519. pointer-events: auto;
  520. background-color: rgba(0,0,0,0.4);
  521. }
  522. #contentWrapper {
  523. position: absolute;
  524. right: 0;
  525. top: 0;
  526. bottom: 0;
  527. background: var(--background-color);
  528. box-shadow: 0 0 8px rgba(0,0,0,.1);
  529. width: calc(100vw - 60px);
  530. max-width: 360px;
  531. z-index: 10000;
  532. transition: .25s transform;
  533. overflow-x: hidden;
  534. margin-right: -380px;
  535. line-height: 2rem;
  536. }
  537. #panel.open #contentWrapper {
  538. transform: translate3d(-380px, 0 ,0);
  539. }
  540. #viewer,
  541. iframe {
  542. left: 0;
  543. top: var(--header-height);
  544. width: 100%;
  545. height: calc(100% - var(--header-height));
  546. }
  547. #viewer {
  548. padding-left: 0;
  549. }
  550. }
粤ICP备19079148号