提交 edd350fc 编写于 作者: M Mr.doob

Design: Pulled latest changes from gh-pages.

上级 abe8031a
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>three.js / documentation</title>
<title>three.js docs</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="../files/favicon.ico" />
<link rel="stylesheet" type="text/css" href="../files/main.css">
......@@ -17,23 +17,23 @@
<div id="sections">
<span class="selected">docs</span>
<a href="../examples/">examples</a>
<a href="../examples/#webgl_animation_cloth">examples</a>
</div>
<img id="expandButton" src="../files/ic_menu_black_24dp.svg">
<div id="expandButton"></div>
</div>
<div id="panelScrim"></div>
<div id="contentWrapper">
<input placeholder="Search" type="text" id="filter" autocorrect="off" autocapitalize="off" spellcheck="false" />
<div id="exitSearchButton"></div>
<select id="language">
<option value="en">en</option>
<option value="zh">zh</option>
</select>
<div id="inputWrapper">
<input placeholder="" type="text" id="filter" autocorrect="off" autocapitalize="off" spellcheck="false" />
<div id="exitSearchButton"></div>
<select id="language">
<option value="en">en</option>
<option value="zh">zh</option>
</select>
</div>
<div id="content"></div>
</div>
......@@ -417,7 +417,7 @@
if(hash) {
iframe.src = splitHash[ 0 ] + '.html' + splitHash[ 1 ];
subtitle = titles[ splitHash[ 0 ] ] + splitHash[ 1 ] + ' - ';
subtitle = titles[ splitHash[ 0 ] ] + splitHash[ 1 ] + ' ';
} else {
......@@ -429,6 +429,7 @@
document.body.replaceChild( iframe, oldIframe );
document.title = subtitle + 'three.js docs';
}
function decomposePageName( pageName, oldDelimiter, newDelimiter ) {
......
:root {
--color-blue: #049EF4;
--text-color: #444;
--border-style: 1px solid #EEE;
--header-height: 56px;
--font-size: 16px;
--line-height: 24px;
--font-size-sanserif: 1.128rem;
--line-height-sanserif: 1.74rem;
--border-style: 1px solid #E8E8E8;
--header-height: 48px;
--panel-width: 300px;
--panel-padding: 1.143rem;
--page-padding: 1.75rem;
--max-width: 760px;
--icon-size: 1.428rem;
}
@font-face {
font-family: 'Roboto Mono';
src: local('Roboto Mono'), url('../files/RobotoMono-Regular.woff2') format('woff2');
font-weight: normal;
src: local('Roboto Mono'), local('RobotoMono-Regular'), url('../files/RobotoMono-Regular.woff2') format('woff2');
font-style: normal;
font-weight: 400;
}
@font-face {
......@@ -19,15 +30,22 @@
font-style: normal;
}
html {
font-size: var(--font-size);
line-height: var(--line-height);
}
body {
padding: 20px 24px 40px 24px;
margin: 0;
color: var(--text-color);
font-family: 'SF-Pro-Text', sans-serif;
font-size: 16px;
line-height: 24px;
color: var(--text-color);
tab-size: 4;
overflow: auto;
max-width: var(--max-width);
margin: 0 auto;
padding-top: var(--page-padding);
padding-bottom: var(--page-padding);
padding-right: var(--page-padding);
padding-left: calc(var(--page-padding) + var(--panel-width));
}
a {
......@@ -38,160 +56,153 @@ a {
h1 {
color: var(--color-blue);
font-size: 2.4em;
font-size: 2.8rem;
line-height: 3.4rem;
font-weight: normal;
line-height: 1.36em;
margin-top: 16px;
margin-bottom: -16px;
text-indent: -2px;
margin-top: 1rem;
margin-bottom: -0.4rem;
margin-left: -2px;
}
h2 {
color: var(--color-blue);
font-size: 1.8em;
line-height: 1.32em;
font-size: 2rem;
line-height: 2.6rem;
font-weight: normal;
margin-top: 40px;
margin-bottom: 12px;
text-indent: -1px;
margin-top: 2rem;
margin-bottom: -0.4rem;
}
h3 {
font-size: 1.32em;
line-height: 1.48em;
color: var(--color-blue);
font-size: 1.32rem;
line-height: 2rem;
font-weight: normal;
text-indent: -1px;
margin-top: 24px;
margin-bottom: 12px;
margin-top: 1.8rem;
margin-bottom: 1rem;
}
p,
div,
table,
ol,
ul {
font-size: var(--font-size-sanserif);
line-height: var(--line-height-sanserif);
margin-top: .8rem;
margin-bottom: .8rem;
}
p {
margin-top: 24px;
margin-bottom: 24px;
padding-right: 1rem;
}
ul, ol {
box-sizing: border-box;
padding-left: 20px;
padding-left: 24px;
}
ul li,
ol li {
padding-left: 4px;
margin-bottom: 4px;
padding-left: 0.25rem;
margin-bottom: 0.25rem;
}
li ul,
li ol {
margin-top: 4px;
margin-top: 0.25rem;
}
body {
max-width: 760px;
margin-left: auto;
margin-right: auto;
pre,
code {
margin: 1.2rem calc(-1 * var(--page-padding));
font-size: calc(var(--font-size) - 2px);
line-height: calc(var(--line-height) - 2px);
}
table,
pre,
code:not(.inline) {
margin-left: -24px;
margin-right: -24px;
margin-top: 20px;
margin-bottom: 20px;
ol code,
ul code {
margin: 1.2rem 0;
}
div {
margin-bottom: 20px;
table {
width: 100%;
border-collapse: collapse;
}
.desc {
padding-left: 0px;
}
br {
display: none;
}
table {
border-spacing: 24px 4px;
}
table,
table tr,
table th,
table td {
text-align: left;
vertical-align: top;
padding: .6rem .4rem;
border-bottom: var(--border-style);
}
table th {
text-decoration: none;
padding: 2px 0;
}
table th:first-child,
table td:first-child {
padding-left: 0;
}
code {
display: block;
padding: 20px 24px;
padding: 1.5rem var(--page-padding);
white-space: pre-wrap;
overflow: auto;
box-sizing: border-box;
}
code.inline {
display: inline-block;
vertical-align: middle;
border-radius: 4px;
padding: 2px 5px;
}
iframe {
width: 100%;
height: 420px;
border:0;
}
th {
padding: 10px;
text-decoration: underline;
}
td {
text-align: center;
}
table code {
padding: 2px;
padding: 0px;
margin: 0px;
width: auto;
}
strong {
color: #000;
font-weight: normal;
font-weight: bold;
}
/* TODO: Duplicate styles in main.css. Needed here cause button is inside the iframe */
#button {
position: fixed;
bottom: 12px;
right: 12px;
bottom: 1rem;
right: 1rem;
padding: 8px;
border-radius: 50%;
padding: 0.75rem;
border-radius: 2rem;
margin-bottom: 0px;
background-color: #E5E5E5;
background-color: #FFF;
opacity: .9;
}
z-index: 999;
box-shadow: 0 0 4px rgba(0,0,0,.15);
}
#button:hover {
cursor: pointer;
opacity: 1;
}
#button img {
display: block;
width: 20px;
width: calc(1.125 * var(--icon-size));
}
a.permalink {
float: right;
margin-left: 5px;
display: none;
}
a.param,
......@@ -200,35 +211,41 @@ span.param {
}
a.param:hover {
color: #777;
color: var(--text-color);
}
sup, sub {
/* prevent superscript and subscript elements from affecting line-height */
vertical-align: baseline;
position: relative;
top: -0.4em;
}
sub {
top: 0.4em;
@media all and ( min-width: 1700px ) {
:root {
--panel-width: 360px;
--font-size: 18px;
--line-height: 28px;
--header-height: 56px;
--max-width: 1160px;
}
}
/* mobile */
@media all and ( max-width: 640px ) {
:root {
--page-padding: var(--panel-padding);
}
body {
padding: 16px 20px;
padding: var(--page-padding);
}
h1 {
font-size: 2rem;
line-height: 2.6rem;
padding-right: 2rem;
margin-top: 0;
font-size: 26px;
}
h2 {
margin-top: 20px;
font-size: 18px;
line-height: 25px;
font-size: 1.6rem;
line-height: 2.2rem;
margin-top: 1.6rem;
}
}
......@@ -12,6 +12,4 @@ pre .dec, code .dec { color: #22c0c4; } /* decimal */
pre.prettyprint, code.prettyprint {
background-color: #F5F5F5;
font-family: 'Roboto Mono', monospace;
font-size: 14px;
line-height: 24px;
}
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>three.js / examples</title>
<title>three.js examples</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="../files/favicon.ico" />
<link rel="stylesheet" type="text/css" href="../files/main.css">
......@@ -10,28 +10,6 @@
#panel #content .link {
display: block;
}
#button {
position: fixed;
bottom: 12px;
right: 12px;
padding: 8px;
border-radius: 50%;
margin-bottom: 0px; /* TODO div sets it to 20px */
background-color: #E5E5E5;
opacity: .9;
}
#button:hover {
cursor: pointer;
opacity: 1;
}
#button img {
display: block;
width: 20px;
}
</style>
</head>
<body>
......@@ -42,18 +20,21 @@
<h1><a href="http://threejs.org">three.js</a></h1>
<div id="sections">
<a href="../docs/">docs</a>
<a href="../docs/index.html#manual/introduction/Creating-a-scene">docs</a>
<span class="selected">examples</span>
</div>
<img id="expandButton" src="../files/ic_menu_black_24dp.svg">
<div id="expandButton"></div>
</div>
<div id="panelScrim"></div>
<div id="contentWrapper">
<input placeholder="Search" type="text" id="filter" autocorrect="off" autocapitalize="off" spellcheck="false" />
<div id="exitSearchButton"></div>
<div id="inputWrapper">
<input placeholder="" type="text" id="filter" autocorrect="off" autocapitalize="off" spellcheck="false" />
<div id="exitSearchButton"></div>
</div>
<div id="content"></div>
</div>
......@@ -275,7 +256,7 @@
var name = file.split( '_' );
name.shift();
return name.join( ' / ' );
return name.join( '<span class="spacer">/</span>' );
}
......
:root {
--color-blue: #049EF4;
--text-color: #444;
--border-style: 1px solid #EEE;
--secondary-text-color: #9e9e9e;
--font-size: 14px;
--line-height: 24px;
--font-size-sanserif: 1.128rem;
--line-height-sanserif: 1.74rem;
--border-style: 1px solid #E8E8E8;
--header-height: 48px;
--panel-padding: 16px;
--panel-width: 300px;
--panel-padding: 1.143rem;
--page-padding: 1.5rem;
--max-width: 760px;
--icon-size: 20px;
--thumbnail-width: 200px;
}
@font-face {
font-family: 'Roboto Mono';
src: local('Roboto Mono'), url('../files/RobotoMono-Regular.woff2') format('woff2');
font-weight: normal;
src: local('Roboto Mono'), local('RobotoMono-Regular'), url('../files/RobotoMono-Regular.woff2') format('woff2');
font-style: normal;
font-weight: 400;
}
@font-face {
font-family: 'Roboto Mono';
src: local('Roboto Mono Medium'), local('RobotoMono-Medium'), url('../files/RobotoMono-Medium.woff2') format('woff2');
font-style: normal;
font-weight: 500;
}
* {
box-sizing: border-box; /* don't let padding modify width */
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
html, body {
height: 100%;
}
html {
font-size: var(--font-size);
line-height: var(--line-height);
}
body {
font-family: 'Roboto Mono', monospace;
margin: 0px;
overflow: hidden;
font-family: 'Roboto Mono', monospace;
font-size: 14px;
line-height: 24px;
background-color: #ffffff;
color: var(--text-color);
background-color: #ffffff;
}
a {
......@@ -36,25 +60,26 @@ a {
}
h1 {
font-size: 18px;
font-size: 1.28rem;
line-height: 1.6rem;
font-weight: 500;
}
h2 {
padding: 8px 0;
margin: 6px 0 12px 0;
font-size: 14px;
font-weight: normal;
padding: 0;
margin: 1rem 0;
font-size: 1rem;
line-height: 1.52rem;
font-weight: 500;
color: var(--color-blue);
}
h3 {
margin: 4px 0;
font-size: 14px;
line-height: 23px;
margin: 0.25rem 0;
font-weight: 500;
text-transform: uppercase;
color: #9E9E9E;
font-size: 1rem;
line-height: 1.52rem;
color: var(--secondary-text-color);
}
h1 a {
......@@ -63,19 +88,32 @@ h1 a {
#header {
display: flex;
height: 48px;
height: var(--header-height);
border-bottom: var(--border-style);
align-items: center;
}
#header h1 {
margin-left: 15px;
padding-left: var(--panel-padding);
flex: 1;
display: flex;
align-items: center;
color: var(--color-blue);
}
#header #version {
border: 1px solid var(--color-blue);
color: var(--color-blue);
border-radius: 0.25rem;
line-height: 1.2rem;
padding: 0px 2px;
margin-left: 6px;
font-size: .9rem;
}
#panel {
position: fixed;
z-index: 100;
left: 0px;
width: 300px;
width: var(--panel-width);
height: 100%;
overflow: auto;
border-right: var(--border-style);
......@@ -85,18 +123,15 @@ h1 a {
}
#panel #exitSearchButton {
position: absolute;
width: 40px;
height: 40px;
top: 4px;
right: calc(var(--panel-padding) - 12px);
z-index: 1000;
width: 3rem;
height: 3rem;
display: none;
background-size: 20px 20px;
background-size: var(--icon-size);
background-position: 50% 50%;
background-repeat: no-repeat;
background-image: url(../files/ic_close_black_24dp.svg);
cursor: pointer;
margin-right: 2px;
}
#panel.searchFocused #exitSearchButton {
......@@ -109,76 +144,106 @@ h1 a {
#panel.searchFocused #filter {
background-image: none;
padding-left: var(--panel-padding);
padding-left: 0;
}
#panel #expandButton {
margin-right: 14px;
width: 3rem;
height: 3rem;
margin-right: 4px;
margin-left: 4px;
display: none;
cursor: pointer;
background-size: var(--icon-size);
background-position: 50% 50%;
background-repeat: no-repeat;
background-image: url(../files/ic_menu_black_24dp.svg);
}
#panel #sections {
font-weight: 500;
display: flex;
justify-content: center;
z-index: 1000;
position: relative;
height: 100%;
align-items: center;
font-weight: 500;
}
#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 black;
}
#panel #sections a {
color: #9E9E9E;
}
#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: "";
}
#panel #filter {
flex: 1;
width: 100%;
height: 48px;
padding: 0px 44px;
padding: 0 2.2rem;
font-size: 1rem;
font-weight: 500;
font-size: 14px;
color: var(--text-color);
outline: none;
border: 0px;
border-bottom: var(--border-style);
background-size: 20px 20px;
background-size: var(--icon-size);
background-image: url(../files/ic_search_black_24dp.svg);
background-position: 14px 50%;
background-position: 0 50%;
background-repeat: no-repeat;
font-family: 'Roboto Mono', monospace;
}
#panel #language {
font-family: 'Roboto Mono', monospace;
position: absolute;
top: 9px;
right: 8px;
border: 0px;
font-size: 14px;
font-size: 1rem;
line-height: 1rem;
font-weight: 500;
background: url(ic_arrow_drop_down_black_24dp.svg) no-repeat;
color: #444;
border: 0px;
background-image: url(ic_arrow_drop_down_black_24dp.svg);
background-size: var(--icon-size);
background-repeat: no-repeat;
background-position: right center;
background-color: white;
padding: 4px 24px 4px 8px;
padding: 4px 1.72rem;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
margin-right: 10px;
}
#panel #language:focus {
......@@ -195,16 +260,29 @@ h1 a {
#panel #content {
flex: 1;
overflow-y: scroll;
padding: 0 var(--panel-padding) 24px var(--panel-padding);
overflow-x: hidden;
padding: 0 var(--panel-padding) 1rem var(--panel-padding);
}
#panel #content ul {
list-style-type: none;
padding: 0px;
margin: 0px 0 24px 0;
margin: 0px 0 1.2rem 0;
}
#panel #content ul li {
margin: 2px 0;
margin: 1px 0;
}
#panel #content h2 {
margin-top: 2rem;
border-top: var(--border-style);
padding-top: .8rem;
}
#panel #content h2:first-child {
margin-top: 1rem !important;
border-top: none;
padding-top: 0;
}
#panel #content a {
......@@ -212,6 +290,7 @@ h1 a {
}
#panel #content a:hover,
#panel #content a:hover .spacer,
#panel #content .selected {
color: var(--color-blue);
}
......@@ -224,18 +303,150 @@ h1 a {
display: none !important;
}
body.home #panel #content h2 {
margin-bottom: 2px;
padding-bottom: 0px;
margin-top: 1.2rem;
border-top: none;
padding-top: .4rem;
}
.spacer {
color: var(--secondary-text-color);
margin-left: 2px;
padding-right: 2px;
}
#viewer,
iframe {
position: absolute;
border: 0px;
left: 300px;
width: calc(100% - 300px);
left: 0;
right: 0;
width: 100%;
height: 100%;
overflow: auto;
}
#viewer {
padding-left: var(--panel-width);
}
#button {
position: fixed;
bottom: 1rem;
right: 1rem;
padding: 0.75rem;
border-radius: 2rem;
margin-bottom: 0px;
background-color: #FFF;
opacity: .9;
z-index: 999;
box-shadow: 0 0 4px rgba(0,0,0,.15);
}
#button:hover {
cursor: pointer;
opacity: 1;
}
#button img {
display: block;
width: calc(1.125 * var(--icon-size));
}
#button.text {
padding-right: 1.2rem;
padding-left: 1.2rem;
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;
--font-size: 16px;
--line-height: 30px;
--header-height: 56px;
}
#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);
}
}
/* mobile */
@media all and ( max-width: 640px ) {
:root {
--header-height: 56px;
--icon-size: 24px;
}
#projects {
grid-template-columns: repeat(2, 1fr);
}
#panel #expandButton {
display: block;
}
......@@ -245,7 +456,7 @@ iframe {
top: 0;
width: 100%;
right: 0;
z-index: 100;
z-index: 1000;
overflow-x: hidden;
transition: 0s 0s height;
border: none;
......@@ -287,16 +498,19 @@ iframe {
transition: .25s transform;
overflow-x: hidden;
margin-right: -380px;
line-height: 2rem;
}
#panel.open #contentWrapper {
transform: translate3d(-380px, 0 ,0);
}
#viewer,
iframe {
position: absolute;
left: 0;
top: var(--header-height);
width: 100%;
height: calc(100% - var(--header-height));
}
#viewer {
padding-left: 0;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册