main.css 8.8 KB
Newer Older
1 2 3
:root {
	--color-blue: #049EF4;
	--text-color: #444;
4 5
	--secondary-text-color: #9e9e9e;

6
	--font-size: 16px;
Y
Yuin Chien 已提交
7
	--line-height: 26px;
8 9

	--border-style: 1px solid #E8E8E8;
Y
Yuin Chien 已提交
10
	--header-height: 48px;
11
	--panel-width: 300px;
12
	--panel-padding: 16px;
13
	--icon-size: 20px;
14 15
}

M
Mr.doob 已提交
16
@font-face {
17
	font-family: 'Roboto Mono';
18 19 20 21 22
	src: local('Roboto Mono'), local('RobotoMono-Regular'), url('../files/RobotoMono-Regular.woff2') format('woff2');
	font-style: normal;
	font-weight: 400;
}
@font-face {
M
Mr.doob 已提交
23 24
	font-family: 'Roboto Mono';
	src: local('Roboto Mono Medium'), local('RobotoMono-Medium'), url('../files/RobotoMono-Medium.woff2') format('woff2');
M
Mr.doob 已提交
25
	font-style: normal;
M
Mr.doob 已提交
26
	font-weight: 500;
M
Mr.doob 已提交
27 28 29
}

* {
30 31
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
M
Mr.doob 已提交
32
	-moz-osx-font-smoothing: grayscale;
M
Mr.doob 已提交
33 34 35 36 37 38
}

html, body {
	height: 100%;
}

39
html {
40
	font-size: calc(var(--font-size) - 1px);
Y
Yuin Chien 已提交
41
	line-height: calc(var(--line-height) - 1px);
42 43
}

M
Mr.doob 已提交
44
body {
45
	font-family: 'Roboto Mono', monospace;
M
Mr.doob 已提交
46
	margin: 0px;
47
	color: var(--text-color);
48
	background-color: #ffffff;
M
Mr.doob 已提交
49 50 51 52 53 54 55
}

a {
	text-decoration: none;
}

h1 {
56 57
	font-size: 18px;
	line-height: 24px;
58
	font-weight: 500;
M
Mr.doob 已提交
59 60 61
}

h2 {
62
	padding: 0;
63 64
	margin: 16px 0;
	font-size: calc(var(--font-size) - 1px);
Y
Yuin Chien 已提交
65
	line-height: var(--line-height);
66
	font-weight: 500;
67
	color: var(--color-blue);
M
Mr.doob 已提交
68 69 70
}

h3 {
Y
Yuin Chien 已提交
71
	margin: 0;
M
Mr.doob 已提交
72
	font-weight: 500;
73
	font-size: calc(var(--font-size) - 1px);
Y
Yuin Chien 已提交
74
	line-height: var(--line-height);
75
	color: var(--secondary-text-color);
M
Mr.doob 已提交
76 77
}

Y
Yuin Chien 已提交
78 79 80 81 82 83
h1 a {
	color: var(--color-blue);
}

#header {
	display: flex;
84
	height: var(--header-height);
M
Mr.doob 已提交
85 86
	border-bottom: var(--border-style);
	align-items: center;
Y
Yuin Chien 已提交
87 88
}
#header h1 {
89
	padding-left: var(--panel-padding);
Y
Yuin Chien 已提交
90
	flex: 1;
91 92 93 94 95 96 97
	display: flex;
	align-items: center;
	color: var(--color-blue);
}
#header #version {
	border: 1px solid var(--color-blue);
	color: var(--color-blue);
98 99
	border-radius: 4px;
	line-height: 16px;
100 101 102
	padding: 0px 2px;
	margin-left: 6px;
	font-size: .9rem;
Y
Yuin Chien 已提交
103 104
}

M
Mr.doob 已提交
105 106
#panel {
	position: fixed;
107
	z-index: 100;
M
Mr.doob 已提交
108
	left: 0px;
109
	width: var(--panel-width);
M
Mr.doob 已提交
110 111
	height: 100%;
	overflow: auto;
112 113 114
	border-right: var(--border-style);
	display: flex;
	flex-direction: column;
Y
Yuin Chien 已提交
115
	transition: 0s 0s height;
116
}
M
Mr.doob 已提交
117

Y
Yuin Chien 已提交
118
	#panel #exitSearchButton {
119 120
		width: 48px;
		height: 48px;
Y
Yuin Chien 已提交
121
		display: none;
122
		background-size: var(--icon-size);
Y
Yuin Chien 已提交
123 124 125 126
		background-position: 50% 50%;
		background-repeat: no-repeat;
		background-image: url(../files/ic_close_black_24dp.svg);
		cursor: pointer;
127
		margin-right: 0px;
Y
Yuin Chien 已提交
128 129 130 131 132 133 134 135 136 137 138 139
	}

	#panel.searchFocused #exitSearchButton {
		display: block;
	}

	#panel.searchFocused #language {
		display: none;
	}

	#panel.searchFocused #filter {
		background-image: none;
140
		padding-left: 0;
Y
Yuin Chien 已提交
141 142
	}

M
Mr.doob 已提交
143
	#panel #expandButton {
144 145
		width: 48px;
		height: 48px;
146
		margin-right: 4px;
Y
Yuin Chien 已提交
147
		margin-left: 4px;
M
Mr.doob 已提交
148
		display: none;
149 150 151 152 153
		cursor: pointer;
		background-size: var(--icon-size);
		background-position: 50% 50%;
		background-repeat: no-repeat;
		background-image: url(../files/ic_menu_black_24dp.svg);
M
Mr.doob 已提交
154 155 156
	}

	#panel #sections {
157
		display: flex;
Y
Yuin Chien 已提交
158
		justify-content: center;
159 160
		z-index: 1000;
		position: relative;
Y
Yuin Chien 已提交
161 162
		height: 100%;
		align-items: center;
163
		font-weight: 500;
M
Mr.doob 已提交
164 165
	}

166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
	#panel #sections * {
		padding: 0 var(--panel-padding);
		height: 100%;
		position: relative;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	#panel #sections .selected:after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: -1px;
		border-bottom: 1px solid var(--text-color);
	}
	#panel #sections a {
		color: var(--secondary-text-color);
	}

	body.home #panel #sections {
		display: none;
	}

#panel #inputWrapper {
	display: flex;
	align-items: center;
	height: var(--header-height);
	padding: 0 0 0 var(--panel-padding);
	position: relative;
	background: white;
}
#panel #inputWrapper:after {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	border-bottom: var(--border-style);
	content: "";
}
M
Mr.doob 已提交
206 207

	#panel #filter {
208
		flex: 1;
M
Mr.doob 已提交
209
		width: 100%;
210
		padding: 0 36px;
211
		font-size: 1rem;
212 213
		font-weight: 500;
		color: var(--text-color);
M
Mr.doob 已提交
214
		outline: none;
215
		border: 0px;
216
		background-size: var(--icon-size);
217
		background-image: url(../files/ic_search_black_24dp.svg);
218
		background-position: 0 50%;
219
		background-repeat: no-repeat;
220
		font-family: 'Roboto Mono', monospace;
M
Mr.doob 已提交
221 222 223
	}

	#panel #language {
M
Mr.doob 已提交
224
		font-family: 'Roboto Mono', monospace;
225 226
		font-size: 1rem;
		line-height: 1rem;
227
		font-weight: 500;
228 229 230 231 232
		color: #444;
		border: 0px;
		background-image: url(ic_arrow_drop_down_black_24dp.svg);
		background-size: var(--icon-size);
		background-repeat: no-repeat;
M
Mr.doob 已提交
233 234
		background-position: right center;
		background-color: white;
235
		padding: 2px 24px 4px 24px;
M
Mr.doob 已提交
236 237 238
		-webkit-appearance: none;
		-moz-appearance: none;
		appearance: none;
239
		margin-right: 10px;
M
Mr.doob 已提交
240 241 242 243 244 245
	}

		#panel #language:focus {
			outline: none;
		}

246 247
	#contentWrapper {
		flex: 1;
M
Mr.doob 已提交
248
		overflow: hidden;
249 250 251 252
		display: flex;
		flex-direction: column;
		transform: translate3d(0,0,0);
	}
M
Mr.doob 已提交
253
	#panel #content {
254
		flex: 1;
M
Mr.doob 已提交
255
		overflow-y: auto;
256
		overflow-x: hidden;
257
		padding: 0 var(--panel-padding) var(--panel-padding) var(--panel-padding);
M
Mr.doob 已提交
258 259 260 261 262
	}

		#panel #content ul {
			list-style-type: none;
			padding: 0px;
263
			margin: 0px 0 20px 0;
264 265
		}
		#panel #content ul li {
266 267 268 269
			margin: 1px 0;
		}

		#panel #content h2 {
270
			margin-top: 32px;
271
			border-top: var(--border-style);
M
Mr.doob 已提交
272
			padding-top: 12px;
273 274 275
		}

		#panel #content h2:first-child {
276
			margin-top: 16px !important;
277 278
			border-top: none;
			padding-top: 0;
M
Mr.doob 已提交
279 280 281
		}

		#panel #content a {
M
Mr.doob 已提交
282
			position: relative;
283
			color: var(--text-color);
M
Mr.doob 已提交
284 285
		}

286
		#panel #content a:hover,
287
		#panel #content a:hover .spacer,
288 289 290
		#panel #content .selected {
			color: var(--color-blue);
		}
M
Mr.doob 已提交
291

292 293 294 295
		#panel #content .selected {
			text-decoration: underline;
		}

M
Mr.doob 已提交
296 297 298 299
		#panel #content .hidden {
			display: none !important;
		}

300 301 302
		body.home #panel #content h2 {
			margin-bottom: 2px;
			padding-bottom: 0px;
303
			margin-top: 18px;
304
			border-top: none;
305
			padding-top: 6px;
306 307 308 309 310 311 312 313
		}

.spacer {
	color: var(--secondary-text-color);
	margin-left: 2px;
	padding-right: 2px;
}

314
#viewer,
315
iframe {
316
	position: absolute;
317
	border: 0px;
318 319 320
	left: 0;
	right: 0;
	width: 100%;
M
Mr.doob 已提交
321 322 323 324
	height: 100%;
	overflow: auto;
}

325 326 327 328 329 330
#viewer {
	padding-left: var(--panel-width);
}

#button {
	position: fixed;
331 332 333 334 335
	bottom: 16px;
	right: 16px;

	padding: 12px;
	border-radius: 50%;
336
	margin-bottom: 0px;
337

338 339 340
	background-color: #FFF;
	opacity: .9;
	z-index: 999;
341

342 343 344 345 346 347 348 349
	box-shadow: 0 0 4px rgba(0,0,0,.15);
}
	#button:hover {
		cursor: pointer;
		opacity: 1;
	}
	#button img {
		display: block;
350
		width: var(--icon-size);
351 352 353
	}

	#button.text {
M
Mr.doob 已提交
354
		border-radius: 25px;
355
		padding-right: 20px;
M
Mr.doob 已提交
356
		padding-left: 20px;
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390
		color: var(--color-blue);
		opacity: 1;
		font-weight: 500;
	}


#projects {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	line-height: 0;
}
#projects a {
	overflow: hidden;
}
#projects a img {
	width: 100%;
	transform: scale(1.0);
	transition: 0.15s transform;
}
#projects a:hover img {
	transform: scale(1.08);
}



@media all and ( min-width: 1500px ) {
	#projects {
		grid-template-columns: repeat(7, 1fr);
	}
}

@media all and ( min-width: 1700px ) {
	:root {
		--panel-width: 360px;
391
		--font-size: 18px;
Y
Yuin Chien 已提交
392
		--line-height: 28px;
393
		--header-height: 56px;
394
		--icon-size: 24px;
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
	}
	#projects {
		grid-template-columns: repeat(8, 1fr);
	}
}

@media all and ( min-width: 1900px ) {

	#projects {
		grid-template-columns: repeat(9, 1fr);
	}

}

@media all and ( max-width: 1300px ) {
	#projects {
		grid-template-columns: repeat(6, 1fr);
	}
}

@media all and ( max-width: 1100px ) {
	#projects {
		grid-template-columns: repeat(5, 1fr);
	}
}

@media all and ( max-width: 900px ) {
	#projects {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media all and ( max-width: 700px ) {
	#projects {
		grid-template-columns: repeat(3, 1fr);
	}
}


M
Mr.doob 已提交
434 435 436
/* mobile */

@media all and ( max-width: 640px ) {
437 438 439 440 441 442 443 444 445 446

	:root {
		--header-height: 56px;
		--icon-size: 24px;
	}

	#projects {
		grid-template-columns: repeat(2, 1fr);
	}

447 448 449
	#panel #expandButton {
		display: block;
	}
M
Mr.doob 已提交
450 451 452 453 454 455
	#panel {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		right: 0;
456
		z-index: 1000;
457 458 459
		overflow-x: hidden;
		transition: 0s 0s height;
		border: none;
460 461
		height: var(--header-height);
		transition: 0s 0.2s height;
M
Mr.doob 已提交
462
	}
463 464 465 466 467
	#panel.open {
		height: 100%;
		transition: 0s 0s height;
	}

468
	#panelScrim {
469 470
		pointer-events: none;
		background-color: rgba(0,0,0,0);
M
Mr.doob 已提交
471 472 473
		position: absolute;
		left: 0;
		right: 0;
474
		top: 0;
M
Mr.doob 已提交
475
		bottom: 0;
476
		z-index: 1000;
Y
Yuin Chien 已提交
477
		pointer-events: none;
478
		transition: .2s background-color;
479
	}
480 481
	#panel.open #panelScrim {
		pointer-events: auto;
Y
Yuin Chien 已提交
482
		background-color: rgba(0,0,0,0.4);
483
	}
484

485 486 487 488 489 490 491
	#contentWrapper {
		position: absolute;
		right: 0;
		top: 0;
		bottom: 0;
		background: white;
		box-shadow: 0 0 8px rgba(0,0,0,.1);
492 493
		width: calc(100vw - 60px);
		max-width: 360px;
494 495 496
		z-index: 10000;
		transition: .25s transform;
		overflow-x: hidden;
497
		margin-right: -380px;
498
		line-height: 2rem;
499
	}
500
	#panel.open #contentWrapper {
501
		transform: translate3d(-380px, 0 ,0);
M
Mr.doob 已提交
502
	}
503
	#viewer,
504
	iframe {
M
Mr.doob 已提交
505
		left: 0;
506
		top: var(--header-height);
M
Mr.doob 已提交
507
		width: 100%;
508
		height: calc(100% - var(--header-height));
M
Mr.doob 已提交
509
	}
510 511 512
	#viewer {
		padding-left: 0;
	}
M
Mr.doob 已提交
513
}