Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AI_BOOK_TOOL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
AI_BOOK_TOOL
Commits
96dc91e3
Commit
96dc91e3
authored
Jun 03, 2025
by
15011343103
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
parent
3c147b3b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
18 deletions
+20
-18
index.css
play/index.css
+6
-12
index.js
play/index.js
+14
-6
No files found.
play/index.css
View file @
96dc91e3
...
...
@@ -80,14 +80,7 @@ body {
padding
:
10px
20px
;
background
:
rgba
(
0
,
0
,
0
,
0.2
);
border-radius
:
4px
;
max-width
:
80%
;
}
.subtitle-text
{
color
:
#fff
;
font-size
:
1.2rem
;
text-align
:
center
;
line-height
:
1.5
;
width
:
80%
;
}
.fixed-btn-group
{
...
...
@@ -193,10 +186,11 @@ body::-webkit-scrollbar, html::-webkit-scrollbar {
}
.subtitle-text
{
font-size
:
18px
;
line-height
:
1.5
;
color
:
#333
;
color
:
#fff
;
font-size
:
2.4rem
;
font-weight
:
bold
;
text-align
:
center
;
line-height
:
1.5
;
}
.controls
{
...
...
play/index.js
View file @
96dc91e3
...
...
@@ -143,22 +143,30 @@ function initializeApp(data) {
break
;
}
}
// 更新当前页面的高亮
和字幕
// 更新当前页面的高亮
group
const
currentPage
=
this
.
pages
[
this
.
currentPage
];
if
(
currentPage
&&
currentPage
.
groups
)
{
for
(
let
idx
=
0
;
idx
<
currentPage
.
groups
.
length
;
idx
++
)
{
const
group
=
currentPage
.
groups
[
idx
];
if
(
group
.
start
!=
null
&&
group
.
end
!=
null
&&
currentTime
>=
group
.
start
&&
currentTime
<=
group
.
end
)
{
this
.
currentGroupIndex
=
idx
;
this
.
currentAudioText
=
group
.
sentence
;
this
.
isRectVisible
=
true
;
return
;
break
;
}
}
}
this
.
currentGroupIndex
=
-
1
;
this
.
currentAudioText
=
''
;
this
.
isRectVisible
=
false
;
// 字幕严格跟随 audio_points.points
let
subtitle
=
''
;
for
(
let
i
=
0
;
i
<
this
.
audioPoints
.
length
;
i
++
)
{
const
p
=
this
.
audioPoints
[
i
];
if
(
currentTime
>=
p
.
start
&&
currentTime
<=
p
.
end
)
{
subtitle
=
p
.
text
;
break
;
}
}
this
.
currentAudioText
=
subtitle
;
if
(
!
subtitle
)
this
.
isRectVisible
=
false
;
if
(
!
subtitle
)
this
.
currentGroupIndex
=
-
1
;
},
handleAudioEnded
()
{
this
.
isPlaying
=
false
;
...
...
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