Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
f60dc5b3
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f60dc5b3
编写于
7月 20, 2020
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Refactored previews toggler code.
上级
e90fcf20
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
97 addition
and
69 deletion
+97
-69
examples/files/thumbnails.svg
examples/files/thumbnails.svg
+63
-0
examples/index.html
examples/index.html
+21
-24
files/main.css
files/main.css
+13
-45
未找到文件。
examples/files/thumbnails.svg
0 → 100644
浏览文件 @
f60dc5b3
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:sodipodi=
"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape=
"http://www.inkscape.org/namespaces/inkscape"
inkscape:version=
"1.0 (4035a4f, 2020-05-01)"
sodipodi:docname=
"thumbnails.svg"
id=
"svg18"
viewBox=
"0 0 512 512"
version=
"1.1"
>
<metadata
id=
"metadata24"
>
<rdf:RDF>
<cc:Work
rdf:about=
""
>
<dc:format>
image/svg+xml
</dc:format>
<dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id=
"defs22"
/>
<sodipodi:namedview
inkscape:current-layer=
"g16"
inkscape:window-maximized=
"1"
inkscape:window-y=
"23"
inkscape:window-x=
"0"
inkscape:cy=
"256"
inkscape:cx=
"233.80568"
inkscape:zoom=
"1.3066406"
showgrid=
"false"
id=
"namedview20"
inkscape:window-height=
"855"
inkscape:window-width=
"1440"
inkscape:pageshadow=
"2"
inkscape:pageopacity=
"0"
guidetolerance=
"10"
gridtolerance=
"10"
objecttolerance=
"10"
borderopacity=
"1"
bordercolor=
"#666666"
pagecolor=
"#ffffff"
/>
<g
id=
"g16"
fill=
"none"
>
<path
sodipodi:nodetypes=
"cssccssc"
d=
"M 308.66797,108.63086 H 113.99023 c -27.699995,0 -49.999996,22.3 -49.999996,50 v 194.67773 m 142.656246,55.33203 h 194.59375 c 27.7,0 50,-22.3 50,-50 V 164.04688"
style=
"stroke:#000000;stroke-width:35;stroke-linecap:round"
id=
"rect10"
/>
<path
id=
"path14"
stroke-width=
"35"
stroke-linecap=
"round"
stroke=
"#000"
d=
"m66.583 449.71 379.6-379.6"
/>
</g>
</svg>
examples/index.html
浏览文件 @
f60dc5b3
...
...
@@ -31,16 +31,10 @@
<div
id=
"exitSearchButton"
></div>
</div>
<div
id=
"previewToggle"
>
<h2>
Previews
</h2>
<div
id=
"toggles"
>
<h3
id=
"toggleOn"
class=
"selected"
>
On
</h3>
<h3
id=
"toggleOff"
>
Off
</h3>
<div
id=
"content"
>
<img
id=
"previewsToggler"
src=
"./files/thumbnails.svg"
width=
"20"
height=
"20"
/>
</div>
</div>
<div
id=
"content"
></div>
</div>
</div>
...
...
@@ -60,9 +54,9 @@
var
expandButton
=
document
.
getElementById
(
'
expandButton
'
);
var
viewSrcButton
=
document
.
getElementById
(
'
button
'
);
var
panelScrim
=
document
.
getElementById
(
'
panelScrim
'
);
var
toggleOn
=
document
.
getElementById
(
'
toggleOn
'
);
var
toggleOff
=
document
.
getElementById
(
'
toggleOff
'
);
var
previews
=
document
.
getElementsByClassName
(
'
cover
'
)
;
var
previewsToggler
=
document
.
getElementById
(
'
previewsToggler
'
);
var
previews
Visible
=
true
;
var
links
=
{};
var
selected
=
null
;
...
...
@@ -161,23 +155,26 @@
};
toggleOn
.
onclick
=
function
(
event
)
{
previewsToggler
.
onclick
=
function
(
event
)
{
event
.
preventDefault
();
toggleOff
.
classList
.
remove
(
'
selected
'
);
toggleOn
.
classList
.
add
(
'
selected
'
);
for
(
i
=
0
;
i
<
previews
.
length
;
i
++
){
previews
[
i
].
style
.
display
=
'
block
'
;
}
};
toggleOff
.
onclick
=
function
(
event
)
{
var
styles
=
document
.
styleSheets
[
0
];
if
(
previewsVisible
)
{
styles
.
insertRule
(
'
.cover { display: none }
'
,
0
);
previewsToggler
.
style
.
opacity
=
1
;
previewsVisible
=
false
;
}
else
{
styles
.
deleteRule
(
0
);
previewsToggler
.
style
.
opacity
=
0.25
;
previewsVisible
=
true
;
event
.
preventDefault
();
toggleOn
.
classList
.
remove
(
'
selected
'
);
toggleOff
.
classList
.
add
(
'
selected
'
);
for
(
i
=
0
;
i
<
previews
.
length
;
i
++
){
previews
[
i
].
style
.
display
=
'
none
'
;
}
};
...
...
files/main.css
浏览文件 @
f60dc5b3
...
...
@@ -30,6 +30,10 @@
--border-style
:
1px
solid
#444
;
}
#previewsToggler
{
filter
:
invert
(
100%
);
}
}
@font-face
{
...
...
@@ -121,19 +125,6 @@ h1 a {
margin-left
:
6px
;
font-size
:
.9rem
;
}
#previewToggle
{
display
:
flex
;
height
:
var
(
--header-height
);
border-bottom
:
var
(
--border-style
);
align-items
:
center
;
}
#previewToggle
h2
{
padding-left
:
var
(
--panel-padding
);
flex
:
1
;
display
:
flex
;
align-items
:
center
;
color
:
var
(
--color-blue
);
}
#panel
{
position
:
fixed
;
z-index
:
100
;
...
...
@@ -294,8 +285,16 @@ h1 a {
overflow
:
hidden
;
display
:
flex
;
flex-direction
:
column
;
transform
:
translate3d
(
0
,
0
,
0
);
}
#previewsToggler
{
cursor
:
pointer
;
float
:
right
;
margin-top
:
18px
;
margin-bottom
:
-18px
;
opacity
:
0.25
;
}
#panel
#content
{
flex
:
1
;
overflow-y
:
auto
;
...
...
@@ -352,37 +351,6 @@ h1 a {
padding-top
:
6px
;
}
#panel
#toggles
{
display
:
flex
;
justify-content
:
center
;
z-index
:
1000
;
position
:
relative
;
height
:
100%
;
align-items
:
center
;
font-weight
:
500
;
}
#panel
#toggles
*
{
padding
:
0
var
(
--panel-padding
);
height
:
100%
;
position
:
relative
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
#panel
#toggles
.selected
:after
{
content
:
""
;
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
-1px
;
border-bottom
:
1px
solid
var
(
--text-color
);
}
#panel
#toggles
:hover
,
#panel
#toggles
.selected
{
color
:
var
(
--color-blue
);
}
.spacer
{
color
:
var
(
--secondary-text-color
);
margin-left
:
2px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录