main.css 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  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. font-size: 1rem;
  209. font-weight: 500;
  210. color: var(--text-color);
  211. outline: none;
  212. border: 0px;
  213. background-color: var(--text-color);
  214. background-size: var(--icon-size);
  215. -webkit-mask-image: url(../files/ic_search_black_24dp.svg);
  216. -webkit-mask-position: 0 50%;
  217. -webkit-mask-repeat: no-repeat;
  218. mask-image: url(../files/ic_search_black_24dp.svg);
  219. mask-position: 0 50%;
  220. mask-repeat: no-repeat;
  221. font-family: 'Roboto Mono', monospace;
  222. }
  223. #panel #language {
  224. font-family: 'Roboto Mono', monospace;
  225. font-size: 1rem;
  226. font-weight: 500;
  227. color: var(--text-color);
  228. border: 0px;
  229. background-image: url(ic_arrow_drop_down_black_24dp.svg);
  230. background-size: var(--icon-size);
  231. background-repeat: no-repeat;
  232. background-position: right center;
  233. background-color: var(--background-color);
  234. padding: 2px 24px 4px 24px;
  235. -webkit-appearance: none;
  236. -moz-appearance: none;
  237. appearance: none;
  238. margin-right: 10px;
  239. text-align-last: right;
  240. }
  241. #panel #language:focus {
  242. outline: none;
  243. }
  244. #contentWrapper {
  245. flex: 1;
  246. overflow: hidden;
  247. display: flex;
  248. flex-direction: column;
  249. transform: translate3d(0,0,0);
  250. }
  251. #panel #content {
  252. flex: 1;
  253. overflow-y: auto;
  254. overflow-x: hidden;
  255. -webkit-overflow-scrolling: touch;
  256. padding: 0 var(--panel-padding) var(--panel-padding) var(--panel-padding);
  257. }
  258. #panel #content ul {
  259. list-style-type: none;
  260. padding: 0px;
  261. margin: 0px 0 20px 0;
  262. }
  263. #panel #content ul li {
  264. margin: 1px 0;
  265. }
  266. #panel #content h2 {
  267. margin-top: 32px;
  268. border-top: var(--border-style);
  269. padding-top: 12px;
  270. }
  271. #panel #content h2:first-child {
  272. margin-top: 16px !important;
  273. border-top: none;
  274. padding-top: 0;
  275. }
  276. #panel #content a {
  277. position: relative;
  278. color: var(--text-color);
  279. }
  280. #panel #content a:hover,
  281. #panel #content a:hover .spacer,
  282. #panel #content .selected {
  283. color: var(--color-blue);
  284. }
  285. #panel #content .selected {
  286. text-decoration: underline;
  287. }
  288. #panel #content .hidden {
  289. display: none !important;
  290. }
  291. body.home #panel #content h2 {
  292. margin-bottom: 2px;
  293. padding-bottom: 0px;
  294. margin-top: 18px;
  295. border-top: none;
  296. padding-top: 6px;
  297. }
  298. .spacer {
  299. color: var(--secondary-text-color);
  300. margin-left: 2px;
  301. padding-right: 2px;
  302. }
  303. #viewer,
  304. iframe {
  305. position: absolute;
  306. border: 0px;
  307. left: 0;
  308. right: 0;
  309. width: 100%;
  310. height: 100%;
  311. overflow: auto;
  312. }
  313. #viewer {
  314. padding-left: var(--panel-width);
  315. }
  316. #button {
  317. position: fixed;
  318. bottom: 16px;
  319. right: 16px;
  320. padding: 12px;
  321. border-radius: 50%;
  322. margin-bottom: 0px;
  323. background-color: #FFF;
  324. opacity: .9;
  325. z-index: 999;
  326. box-shadow: 0 0 4px rgba(0,0,0,.15);
  327. }
  328. #button:hover {
  329. cursor: pointer;
  330. opacity: 1;
  331. }
  332. #button img {
  333. display: block;
  334. width: var(--icon-size);
  335. }
  336. #button.text {
  337. border-radius: 25px;
  338. padding-right: 20px;
  339. padding-left: 20px;
  340. color: var(--color-blue);
  341. opacity: 1;
  342. font-weight: 500;
  343. }
  344. #projects {
  345. display: grid;
  346. grid-template-columns: repeat(6, 1fr);
  347. line-height: 0;
  348. }
  349. #projects a {
  350. overflow: hidden;
  351. }
  352. #projects a img {
  353. width: 100%;
  354. transform: scale(1.0);
  355. transition: 0.15s transform;
  356. }
  357. #projects a:hover img {
  358. transform: scale(1.08);
  359. }
  360. @media all and ( min-width: 1500px ) {
  361. #projects {
  362. grid-template-columns: repeat(7, 1fr);
  363. }
  364. }
  365. @media all and ( min-width: 1700px ) {
  366. :root {
  367. --panel-width: 360px;
  368. --font-size: 18px;
  369. --line-height: 28px;
  370. --header-height: 56px;
  371. --icon-size: 24px;
  372. }
  373. #projects {
  374. grid-template-columns: repeat(8, 1fr);
  375. }
  376. }
  377. @media all and ( min-width: 1900px ) {
  378. #projects {
  379. grid-template-columns: repeat(9, 1fr);
  380. }
  381. }
  382. @media all and ( max-width: 1300px ) {
  383. #projects {
  384. grid-template-columns: repeat(6, 1fr);
  385. }
  386. }
  387. @media all and ( max-width: 1100px ) {
  388. #projects {
  389. grid-template-columns: repeat(5, 1fr);
  390. }
  391. }
  392. @media all and ( max-width: 900px ) {
  393. #projects {
  394. grid-template-columns: repeat(4, 1fr);
  395. }
  396. }
  397. @media all and ( max-width: 700px ) {
  398. #projects {
  399. grid-template-columns: repeat(3, 1fr);
  400. }
  401. }
  402. .card {
  403. border-radius: 3px;
  404. overflow: hidden;
  405. background-color: var(--secondary-background-color);
  406. padding-bottom: 6px;
  407. margin-bottom: 16px;
  408. }
  409. .card.selected {
  410. box-shadow: 0 0 0 3px var(--color-blue);
  411. text-decoration: none !important;
  412. }
  413. .card .cover {
  414. padding-bottom: 56.25%; /* 16:9 aspect ratio */
  415. position: relative;
  416. overflow: hidden;
  417. }
  418. .card .cover img {
  419. position: absolute;
  420. width: 100%;
  421. top: 50%;
  422. left: 50%;
  423. transform: translate(-50%, -50%);
  424. }
  425. .card .title {
  426. padding: 8px 12px 4px;
  427. font-size: calc(var(--font-size) - 1px);
  428. font-weight: 500;
  429. line-height: calc(var(--line-height) - 6px);
  430. }
  431. /* mobile */
  432. @media all and ( max-width: 640px ) {
  433. :root {
  434. --header-height: 56px;
  435. --icon-size: 24px;
  436. }
  437. #projects {
  438. grid-template-columns: repeat(2, 1fr);
  439. }
  440. #panel #expandButton {
  441. display: block;
  442. }
  443. #panel {
  444. position: absolute;
  445. left: 0;
  446. top: 0;
  447. width: 100%;
  448. right: 0;
  449. z-index: 1000;
  450. overflow-x: hidden;
  451. transition: 0s 0s height;
  452. border: none;
  453. height: var(--header-height);
  454. transition: 0s 0.2s height;
  455. }
  456. #panel.open {
  457. height: 100%;
  458. transition: 0s 0s height;
  459. }
  460. #panelScrim {
  461. pointer-events: none;
  462. background-color: rgba(0,0,0,0);
  463. position: absolute;
  464. left: 0;
  465. right: 0;
  466. top: 0;
  467. bottom: 0;
  468. z-index: 1000;
  469. pointer-events: none;
  470. transition: .2s background-color;
  471. }
  472. #panel.open #panelScrim {
  473. pointer-events: auto;
  474. background-color: rgba(0,0,0,0.4);
  475. }
  476. #contentWrapper {
  477. position: absolute;
  478. right: 0;
  479. top: 0;
  480. bottom: 0;
  481. background: var(--background-color);
  482. box-shadow: 0 0 8px rgba(0,0,0,.1);
  483. width: calc(100vw - 60px);
  484. max-width: 360px;
  485. z-index: 10000;
  486. transition: .25s transform;
  487. overflow-x: hidden;
  488. margin-right: -380px;
  489. line-height: 2rem;
  490. }
  491. #panel.open #contentWrapper {
  492. transform: translate3d(-380px, 0 ,0);
  493. }
  494. #viewer,
  495. iframe {
  496. left: 0;
  497. top: var(--header-height);
  498. width: 100%;
  499. height: calc(100% - var(--header-height));
  500. }
  501. #viewer {
  502. padding-left: 0;
  503. }
  504. }