2
0

main.css 11 KB

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