main.css 10 KB

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