Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tianyazhichiC
algorithm-visualizer
提交
1740263a
A
algorithm-visualizer
项目概览
tianyazhichiC
/
algorithm-visualizer
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
algorithm-visualizer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1740263a
编写于
12月 05, 2018
作者:
J
Jason Park
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reverse speed bar
上级
e385ecdb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
9 deletion
+10
-9
src/frontend/components/Player/index.jsx
src/frontend/components/Player/index.jsx
+9
-8
src/frontend/components/Player/stylesheet.scss
src/frontend/components/Player/stylesheet.scss
+1
-1
未找到文件。
src/frontend/components/Player/index.jsx
浏览文件 @
1740263a
...
...
@@ -19,7 +19,7 @@ class Player extends React.Component {
super
(
props
);
this
.
state
=
{
interval
:
500
,
speed
:
2
,
playing
:
false
,
building
:
false
,
};
...
...
@@ -94,7 +94,8 @@ class Player extends React.Component {
resume
(
wrap
=
false
)
{
this
.
pause
();
if
(
this
.
next
()
||
wrap
&&
this
.
props
.
setCursor
(
1
))
{
this
.
timer
=
window
.
setTimeout
(()
=>
this
.
resume
(),
this
.
state
.
interval
);
const
interval
=
4000
/
Math
.
pow
(
Math
.
E
,
this
.
state
.
speed
);
this
.
timer
=
window
.
setTimeout
(()
=>
this
.
resume
(),
interval
);
this
.
setState
({
playing
:
true
});
}
}
...
...
@@ -115,8 +116,8 @@ class Player extends React.Component {
return
true
;
}
handleChange
Interval
(
interval
)
{
this
.
setState
({
interval
});
handleChange
Speed
(
speed
)
{
this
.
setState
({
speed
});
}
handleChangeProgress
(
progress
)
{
...
...
@@ -129,7 +130,7 @@ class Player extends React.Component {
render
()
{
const
{
className
,
file
}
=
this
.
props
;
const
{
chunks
,
cursor
}
=
this
.
props
.
player
;
const
{
interval
,
playing
,
building
}
=
this
.
state
;
const
{
speed
,
playing
,
building
}
=
this
.
state
;
return
(
<
div
className
=
{
classes
(
styles
.
player
,
className
)
}
>
...
...
@@ -148,7 +149,7 @@ class Player extends React.Component {
onChangeProgress
=
{
progress
=>
this
.
handleChangeProgress
(
progress
)
}
/>
<
Button
icon
=
{
faChevronRight
}
reverse
primary
disabled
=
{
!
this
.
isValidCursor
(
cursor
+
1
)
}
onClick
=
{
()
=>
this
.
next
()
}
/>
<
div
className
=
{
styles
.
interval
}
>
<
div
className
=
{
styles
.
speed
}
>
Speed
<
InputRange
classNames
=
{
{
...
...
@@ -156,8 +157,8 @@ class Player extends React.Component {
labelContainer
:
styles
.
range_label_container
,
slider
:
styles
.
range_slider
,
track
:
styles
.
range_track
,
}
}
m
axValue
=
{
2000
}
minValue
=
{
100
}
step
=
{
100
}
value
=
{
interval
}
onChange
=
{
interval
=>
this
.
handleChangeInterval
(
interval
)
}
/>
}
}
m
inValue
=
{
0
}
maxValue
=
{
4
}
step
=
{
.
5
}
value
=
{
speed
}
onChange
=
{
speed
=>
this
.
handleChangeSpeed
(
speed
)
}
/>
</
div
>
</
div
>
);
...
...
src/frontend/components/Player/stylesheet.scss
浏览文件 @
1740263a
...
...
@@ -5,7 +5,7 @@
width
:
160px
;
}
.
interval
{
.
speed
{
display
:
flex
;
align-items
:
center
;
padding
:
0
12px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录