瀏覽代碼

First commit. Layout change in page.css & main.css

Yuin Chien 6 年之前
父節點
當前提交
9d45a1ff37
共有 6 個文件被更改,包括 245 次插入116 次删除
  1. 21 4
      docs/index.html
  2. 87 32
      docs/page.css
  3. 2 2
      docs/prettify/threejs.css
  4. 135 78
      files/main.css
  5. 二進制
      files/screenshot1.png
  6. 二進制
      files/screenshot2.png

+ 21 - 4
docs/index.html

@@ -10,7 +10,7 @@
 		<script src="../build/three.min.js" async defer></script>
 	</head>
 	<body>
-
+		<!-- <img src="../files/screenshot2.png" width="1280" style="opacity:.5;position:fixed;z-index:100000;pointer-events:none;"/> -->
 		<div id="panel" class="collapsed">
 
 			<div id="header">
@@ -22,18 +22,21 @@
 				<div id="sections">
 					<span class="selected">docs</span> <a href="../examples/">examples</a>
 				</div>
+			</div>
+
+			<div id="panelScrim"></div>
 
-				<input type="text" id="filter" autocorrect="off" autocapitalize="off" spellcheck="false">
+			<div id="contentWrapper">
+				<input type="text" id="filter" autocorrect="off" autocapitalize="off" spellcheck="false" />
 
 				<select id="language">
 					<option value="en">en</option>
 					<option value="zh">zh</option>
 				</select>
 
+				<div id="content"></div>
 			</div>
 
-			<div id="content"></div>
-
 		</div>
 
 		<iframe name="viewer"></iframe>
@@ -89,6 +92,7 @@
 			var panel = document.getElementById( 'panel' );
 			var content = document.getElementById( 'content' );
 			var expandButton = document.getElementById( 'expandButton' );
+			var panelScrim = document.getElementById( 'panelScrim' );
 			var filterInput = document.getElementById( 'filter' );
 			var iframe = document.querySelector( 'iframe' );
 
@@ -108,6 +112,13 @@
 
 			};
 
+			panelScrim.onclick = function ( event ) {
+
+				event.preventDefault();
+				panel.classList.toggle( 'collapsed' );
+
+			};
+
 
 			// Functionality for search/filter input field
 
@@ -141,6 +152,12 @@
 					window.location.hash = pageURL;
 					panel.classList.add( 'collapsed' );
 
+
+					content.querySelectorAll('a').forEach((item) => {
+						item.classList.remove('selected');
+					});
+					link.classList.add('selected');
+
 				} );
 
 				return link;

+ 87 - 32
docs/page.css

@@ -1,6 +1,14 @@
+:root {
+	--color-blue: #049EF4;
+
+	--text-color: #444;
+	--border-style: 1px solid #EEE;
+	--header-height: 80px;
+}
+
 @font-face {
-	font-family: 'RobotoMono';
-	src: local('RobotoMono'), url('../files/RobotoMono-Regular.woff2') format('woff2');
+	font-family: 'Roboto Mono';
+	src: local('Roboto Mono'), url('../files/RobotoMono-Regular.woff2') format('woff2');
 	font-weight: normal;
 	font-style: normal;
 }
@@ -13,54 +21,89 @@
 }
 
 body {
-	margin: 78px auto;
-	padding: 0px 24px;
-	max-width: 780px;
-	color: #555;
+	padding: 20px 24px 40px 24px;
+	margin: 0;
+	color: var(--text-color);
 	font-family: 'SF-Pro-Text', sans-serif;
 	font-size: 16px;
-	line-height: 23px;
+	line-height: 24px;
 	tab-size: 4;
 	overflow: auto;
 }
 
 a {
-	color: #1184CE;
+	color: var(--color-blue);
 	cursor: pointer;
-	text-decoration: underline;
+	text-decoration: none;
 }
 
 h1 {
-	color: #049EF4;
-	font-size: 32px;
+	color: var(--color-blue);
+	font-size: 2.4em;
 	font-weight: normal;
-	line-height: 42px;
+	line-height: 1.36em;
+	margin-top: 16px;
+	margin-bottom: -16px;
+	text-indent: -2px;
 }
 
 h2 {
-	color: #4B0;
-
-	font-size: 22px;
+	color: var(--color-blue);
+	font-size: 1.8em;
+	line-height: 1.32em;
 	font-weight: normal;
-	line-height: 31px;
+	margin-top: 40px;
+	margin-bottom: 16px;
+	text-indent: -1px;
 }
 
 h3 {
 	color: #000;
 	font-size: 16px;
 	font-weight: normal;
-
+	text-indent: -1px;
 	margin-top: 40px;
 }
 
-p, ul, ol {
-	margin-top: 0;
+p {
+	margin-top: 24px;
+	margin-bottom: 24px;
+}
+ul, ol {
+	box-sizing: border-box;
+	padding-left: 20px;
+}
+ul li,
+ol li {
+	padding-left: 4px;
+	margin-bottom: 4px;
+}
+
+li ul,
+li ol {
+	margin-top: 4px;
+}
+
+body {
+	max-width: 760px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+table,
+pre,
+code {
+	margin-left: -24px;
+	margin-right: -24px;
+	margin-top: 20px;
 	margin-bottom: 20px;
-	max-width: 780px;
+}
+
+h2 + p {
+	margin-top: -12px;
 }
 
 div {
-	/* padding-left: 30px; */
 	margin-bottom: 20px;
 }
 
@@ -68,17 +111,30 @@ div {
 	padding-left: 0px;
 }
 
-pre, code {
-	margin-top: 20px;
-	margin-bottom: 20px;
+br {
+	display: none;
+}
+
+table {
+  border-spacing: 24px 4px;
+}
+table,
+table tr,
+table td {
+	text-align: left;
+}
+
+table th {
+	text-decoration: none;
+	padding: 2px 0;
 }
 
 code {
 	display: block;
-	padding: 20px;
+	padding: 20px 24px;
 	white-space: pre-wrap;
-	background-color: #f9f9f9;
 	overflow: auto;
+	box-sizing: border-box;
 }
 
 iframe {
@@ -116,8 +172,8 @@ strong {
 	border-radius: 50%;
 	margin-bottom: 0px; /* TODO div sets it to 20px */
 
-	background-color: #dddddd;
-	opacity: 0.4;
+	background-color: #E5E5E5;
+	opacity: .9;
 }
 
 	#button:hover {
@@ -159,17 +215,16 @@ sub {
 @media all and ( max-width: 640px ) {
 
 	body {
-		margin: 14px auto;
-		padding: 0px 14px;
-		font-size: 14px;
-		line-height: 22px;
+		padding: 16px 20px;
 	}
 
 	h1 {
+		margin-top: 0;
 		font-size: 26px;
 	}
 
 	h2 {
+		margin-top: 20px;
 		font-size: 18px;
 		line-height: 25px;
 	}

+ 2 - 2
docs/prettify/threejs.css

@@ -11,7 +11,7 @@ pre .dec, code .dec { color: #22c0c4; } /* decimal */
 
 pre.prettyprint, code.prettyprint {
 	background-color: #F5F5F5;
-	font-family: 'RobotoMono', monospace;
+	font-family: 'Roboto Mono', monospace;
 	font-size: 14px;
-	line-height: 21px;
+	line-height: 24px;
 }

+ 135 - 78
files/main.css

@@ -1,6 +1,14 @@
+:root {
+	--color-blue: #049EF4;
+
+	--text-color: #444;
+	--border-style: 1px solid #EEE;
+	--header-height: 80px;
+}
+
 @font-face {
-	font-family: 'RobotoMono';
-	src: local('RobotoMono'), url('../files/RobotoMono-Regular.woff2') format('woff2');
+	font-family: 'Roboto Mono';
+	src: local('Roboto Mono'), url('../files/RobotoMono-Regular.woff2') format('woff2');
 	font-weight: normal;
 	font-style: normal;
 }
@@ -17,12 +25,12 @@ body {
 	margin: 0px;
 	overflow: hidden;
 
-	font-family: 'RobotoMono', monospace;
+	font-family: 'Roboto Mono', monospace;
 	font-size: 14px;
-	line-height: 23px;
+	line-height: 24px;
 
 	background-color: #ffffff;
-	color: #555;
+	color: var(--text-color);
 }
 
 a {
@@ -32,28 +40,33 @@ a {
 h1 {
 	margin-top: 0px; /* reset */
 	margin-left: 15px;
-	margin-bottom: 20px;
-	padding-top: 13px;
+	margin-bottom: 0px;
+	padding-top: 12px;
 
 	font-size: 18px;
-	font-weight: normal;
+	font-weight: 500;
 }
 
 h1 a {
-	color: #049EF4;
+	color: var(--color-blue);
 }
 
 h2 {
-	margin-top: 20px;
+	padding: 8px 0;
+	margin: 6px 0 12px 0;
+	position: sticky;
+	top: 0;
+	background: white;
 
 	font-size: 14px;
 	font-weight: normal;
 
-	color: #049EF4;
+	color: var(--color-blue);
+  border-bottom: var(--border-style);
 }
 
 h3 {
-	margin: 20px 0 0 0;
+	margin: 4px 0;
 
 	font-size: 14px;
 	line-height: 23px;
@@ -70,98 +83,123 @@ h3 {
 	height: 100%;
 	overflow: auto;
 
-	background: white;
-	border-right: 1px solid #f2f2f2;
-}
-
-	#panel #header {
-		position: -webkit-sticky;
-		position: sticky;
-		top: 0;
+	border-right: var(--border-style);
 
-		background: white;
-	}
+	display: flex;
+	flex-direction: column;
+}
 
 	#panel #expandButton {
 		position: absolute;
 		right: 14px;
 		top: 14px;
+		z-index: 1000;
 		display: none;
 	}
 
 	#panel #sections {
-		font-size: 14px;
-		padding: 0px 16px;
+		font-weight: 500;
+		height: 44px;
+		display: flex;
+		align-items: center;
+		z-index: 1000;
+		position: relative;
 	}
+		#panel #sections:after {
+			position: absolute;
+			bottom: 0px;
+			content: "";
+			left: 0;
+			right: 0;
+			border-bottom: var(--border-style);
+			z-index: -1;
+		}
 
 		#panel #sections * {
-			display: inline-block;
-			margin-right: 35px;
-			margin-bottom: 12px;
-
-			font-weight: 500;
-
-			color: #333333;
+			padding: 0 16px;
+	    height: 100%;
+	    line-height: 44px;
+		}
+		#panel #sections .selected {
+			border-bottom: 1px solid black;
 		}
-
 		#panel #sections a {
 			color: #9E9E9E;
 		}
 
 	#panel #filter {
 		width: 100%;
-		height: 40px;
-		padding: 0px 48px;
-		font-size: 15px;
+		height: 44px;
+		padding: 0px 44px;
+		font-weight: 500;
+		font-size: 14px;
+		color: var(--text-color);
 		outline: none;
-		border: 0px; /* reset */
-		border-top: 1px solid #f2f2f2;
-		border-bottom: 1px solid #f2f2f2;
-		background: url( "../files/ic_search_black_24dp.svg" ) no-repeat;
-		background-position: 14px center;
+		border: 0px;
+		border-bottom: var(--border-style);
+		background-size: 20px 20px;
+		background-image: url(../files/ic_search_black_24dp.svg);
+		background-position: 14px 50%;
+		background-repeat: no-repeat;
 	}
 
 	#panel #language {
+    font-family: 'Roboto Mono', monospace;
 		position: absolute;
-		top: 98px;
-		right: 14px;
-		border: 0px;
-		font-size: 14px;
-		background: url( "ic_arrow_drop_down_black_24dp.svg" ) no-repeat;
-		background-position: right center;
-		background-color: white;
-		padding: 4px 26px 4px 8px;
-		-webkit-appearance: none;
-		-moz-appearance: none;
-		appearance: none;
+    top: 8px;
+    right: 8px;
+    border: 0px;
+    font-size: 14px;
+		font-weight: 500;
+    background: url(ic_arrow_drop_down_black_24dp.svg) no-repeat;
+    background-position: right center;
+    background-color: white;
+    padding: 4px 24px 4px 8px;
+    -webkit-appearance: none;
+    -moz-appearance: none;
+    appearance: none;
 	}
 
 		#panel #language:focus {
 			outline: none;
 		}
 
+	#contentWrapper {
+		flex: 1;
+    overflow: hidden;
+		display: flex;
+		flex-direction: column;
+		transform: translate3d(0,0,0);
+	}
 	#panel #content {
-		margin: 0px 16px;
+		flex: 1;
+		overflow: scroll;
+		padding: 0 16px 24px 16px;
 	}
 
 		#panel #content ul {
 			list-style-type: none;
 			padding: 0px;
-			margin: 0px;
+			margin: 0px 0 24px 0;
+		}
+		#panel #content ul li {
+			margin: 2px 0;
 		}
 
 		#panel #content a {
-			color: #222222;
+			color: var(--text-color);
 		}
 
-			#panel #content a:hover {
-				text-decoration: underline;
-			}
+		#panel #content a:hover,
+		#panel #content .selected {
+			color: var(--color-blue);
+		}
 
 		#panel #content .selected {
-			color: #ff0000;
+	    text-decoration: line-through;
 		}
 
+
 		#panel #content .hidden {
 			display: none !important;
 		}
@@ -187,36 +225,55 @@ iframe {
 		width: 100%;
 		right: 0;
 		z-index: 100;
-		border-bottom: 1px solid #dedede;
+		overflow-x: hidden;
+		transition: 0s 0s height;
+		border: none;
 	}
-
-		#panel #expandButton {
-			display: block;
-		}
-
-	/*
-	#navigation {
+	#panelScrim {
+		background: black;
 		position: absolute;
 		left: 0;
-		top: 90px;
 		right: 0;
+		top: 0;
 		bottom: 0;
-		font-size: 17px;
-		line-height: 22px;
-		overflow: auto;
+		z-index: 1000;
+		opacity: .6;
+		pointer-events: auto;
+		transition: .2s opacity;
+	}
+	#panel.collapsed {
+		height: var(--header-height);
+		transition: 0s .2s height;
+	}
+	#panel.collapsed #panelScrim {
+		opacity: 0;
+		pointer-events: auto;
+	}
+
+	#panel #expandButton {
+		display: block;
+	}
+	#contentWrapper {
+		position: absolute;
+		right: 0;
+		top: 0;
+		bottom: 0;
+		background: white;
+		box-shadow: 0 0 8px rgba(0,0,0,.1);
+		width: 300px;
+		z-index: 10000;
+		transition: .25s transform;
+		overflow-x: hidden;
+	}
+	#panel.collapsed #contentWrapper {
+		transform: translate3d(120%,0,0);
 	}
-	*/
 
 	iframe {
 		position: absolute;
 		left: 0;
-		top: 92px;
+		top: var(--header-height);
 		width: 100%;
-		height: calc(100% - 92px);
-	}
-
-	#panel.collapsed {
-		height: 92px;
+		height: calc(100% - var(--header-height));
 	}
-
 }

二進制
files/screenshot1.png


二進制
files/screenshot2.png