main.css 8.2 KB

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