main.css 10 KB

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