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
		-webkit-overflow-scrolling: touch;
258
		padding: 0 var(--panel-padding) var(--panel-padding) var(--panel-padding);
M
Mr.doob 已提交
259 260 261 262 263
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	#button.text {
M
Mr.doob 已提交
355
		border-radius: 25px;
356
		padding-right: 20px;
M
Mr.doob 已提交
357
		padding-left: 20px;
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 391
		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;
392
		--font-size: 18px;
Y
Yuin Chien 已提交
393
		--line-height: 28px;
394
		--header-height: 56px;
395
		--icon-size: 24px;
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 434
	}
	#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 已提交
435 436 437
/* mobile */

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

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

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

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

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

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