1
0

main.css 11 KB

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