Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
teddi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
teddi
Commits
b96bf7cf
Commit
b96bf7cf
authored
Nov 13, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
1581a7ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
gulpfile.js
gulpfile.js
+2
-2
package.json
package.json
+2
-2
countdown.ts
src/time/countdown.ts
+3
-3
No files found.
gulpfile.js
View file @
b96bf7cf
...
@@ -7,7 +7,6 @@ const runTypeDoc = () => gulp
...
@@ -7,7 +7,6 @@ const runTypeDoc = () => gulp
.
pipe
(
typedoc
({
.
pipe
(
typedoc
({
out
:
'./docs'
,
out
:
'./docs'
,
mode
:
'file'
,
mode
:
'file'
,
// 这个文件里都是 export * from '...' 就没必要导出文档了
exclude
:
'**/*/index.ts'
,
exclude
:
'**/*/index.ts'
,
tsconfig
:
'tsconfig.json'
,
tsconfig
:
'tsconfig.json'
,
}))
}))
...
@@ -31,4 +30,5 @@ const watch = () => gulp.watch(
...
@@ -31,4 +30,5 @@ const watch = () => gulp.watch(
gulp
.
series
(
runTypeDoc
,
reload
)
gulp
.
series
(
runTypeDoc
,
reload
)
)
)
gulp
.
task
(
'default'
,
gulp
.
series
(
runTypeDoc
,
runBrowserSync
,
watch
))
gulp
.
task
(
'watch'
,
gulp
.
series
(
runTypeDoc
,
runBrowserSync
,
watch
))
\ No newline at end of file
gulp
.
task
(
'build'
,
gulp
.
series
(
runTypeDoc
))
\ No newline at end of file
package.json
View file @
b96bf7cf
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
"types"
:
"dist/index.d.ts"
,
"types"
:
"dist/index.d.ts"
,
"scripts"
:
{
"scripts"
:
{
"build"
:
"tsc"
,
"build"
:
"tsc"
,
"
buildDoc"
:
"jsdoc
"
,
"
doc"
:
"gulp build
"
,
"watch
Doc"
:
"gulp
"
,
"watch
"
:
"gulp watch
"
,
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
},
"repository"
:
{
"repository"
:
{
...
...
src/time/countdown.ts
View file @
b96bf7cf
import
{
EventEmitter
}
from
"../event"
;
import
{
EventEmitter
}
from
"../event"
;
function
getNum
(
n
:
any
)
{
function
get
Time
Num
(
n
:
any
)
{
return
n
>=
10
?
`
${
n
}
`
:
`0
${
n
}
`
;
return
n
>=
10
?
`
${
n
}
`
:
`0
${
n
}
`
;
}
}
...
@@ -31,14 +31,14 @@ export class Countdown extends EventEmitter<any> {
...
@@ -31,14 +31,14 @@ export class Countdown extends EventEmitter<any> {
const
hours
=
Math
.
floor
(
left
/
3600
);
const
hours
=
Math
.
floor
(
left
/
3600
);
const
minutes
=
Math
.
floor
((
left
%
3600
)
/
60
);
const
minutes
=
Math
.
floor
((
left
%
3600
)
/
60
);
const
seconds
=
left
-
hours
*
3600
-
minutes
*
60
;
const
seconds
=
left
-
hours
*
3600
-
minutes
*
60
;
return
`
${
get
Num
(
hours
)}
:
${
getNum
(
minutes
)}
:
${
get
Num
(
seconds
)}
`
;
return
`
${
get
TimeNum
(
hours
)}
:
${
getTimeNum
(
minutes
)}
:
${
getTime
Num
(
seconds
)}
`
;
}
}
private
getMMSS
()
{
private
getMMSS
()
{
const
left
=
this
.
_seconds
-
this
.
_counter
;
const
left
=
this
.
_seconds
-
this
.
_counter
;
const
minutes
=
Math
.
floor
(
left
/
60
);
const
minutes
=
Math
.
floor
(
left
/
60
);
const
seconds
=
left
%
60
;
const
seconds
=
left
%
60
;
return
`
${
get
Num
(
minutes
)}
:
${
get
Num
(
seconds
)}
`
;
return
`
${
get
TimeNum
(
minutes
)}
:
${
getTime
Num
(
seconds
)}
`
;
}
}
private
getText
()
{
private
getText
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment