Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM5-6
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
YM5-6
Commits
80983b9b
Commit
80983b9b
authored
Jan 15, 2021
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix
parent
a5ffeaea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
15 deletions
+39
-15
play.component.scss
src/app/play/play.component.scss
+6
-0
play.component.ts
src/app/play/play.component.ts
+33
-15
futura-md-bt-bold.ttf
src/assets/font/futura-md-bt-bold.ttf
+0
-0
No files found.
src/app/play/play.component.scss
View file @
80983b9b
...
...
@@ -76,3 +76,9 @@
font-family
:
'MMTextBook-Italic'
;
src
:
url("../../assets/font/MMTextBook-Italic.otf")
;
}
@font-face
{
font-family
:
'futura-md-bt-bold'
;
src
:
url("../../assets/font/futura-md-bt-bold.ttf")
;
}
src/app/play/play.component.ts
View file @
80983b9b
...
...
@@ -117,6 +117,8 @@ export class PlayComponent implements OnInit, OnDestroy {
opend
=
[
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
];
wordLoad
:{[
key
:
string
]:{
loaded
:
boolean
;
letters
:{[
key
:
string
]:{
loaded
:
boolean
,
letter
:
Label
}}}}
=
{};
underLine
=
[];
setWordLoad
(
id
:
string
,
letterId
:
string
,
loaded
:
boolean
,
letter
:
Label
):
void
{
if
(
!
this
.
wordLoad
[
id
]){
...
...
@@ -751,23 +753,24 @@ export class PlayComponent implements OnInit, OnDestroy {
body_bg
;
initPic
()
{
this
.
body_bg
=
new
ShapeRoundRect
();
this
.
body_bg
.
setSize
(
1280
*
this
.
mapScale
,
555
*
this
.
mapScale
,
30
*
this
.
mapScale
)
;
this
.
body_bg
.
x
=
(
this
.
canvasWidth
-
this
.
body_bg
.
width
)
/
2
;
// - 100 * this.mapScale;
this
.
body_bg
.
y
=
this
.
canvasHeight
-
this
.
body_bg
.
height
-
(
this
.
canvasHeight
-
this
.
body_bg
.
height
)
/
3
;
// this.body_bg.setSize(1280*this.mapScale, 555*this.mapScale, 30*this.mapScale) ;
this
.
body_bg
.
setScaleXY
(
this
.
mapScale
)
this
.
body_bg
.
x
=
this
.
canvasWidth
/
2
-
610
*
this
.
mapScale
// (this.canvasWidth - this.body_bg.width) / 2; // - 100 * this.mapScale;
this
.
body_bg
.
y
=
this
.
canvasHeight
/
2
-
250
*
this
.
mapScale
// this.canvasHeight - this.body_bg.height - (this.canvasHeight - this.body_bg.height)/3 ;
this
.
renderArr
.
push
(
this
.
body_bg
);
let
colorBlock_left
=
new
ShapeRoundRect
()
colorBlock_left
.
x
=
0
;
colorBlock_left
.
y
=
0
;
colorBlock_left
.
fillColor
=
"
#eef1f3
"
// `#${this.saveData.blockColor}`;
colorBlock_left
.
setSize
(
6
20
*
this
.
mapScale
,
500
*
this
.
mapScale
,
30
)
colorBlock_left
.
setSize
(
6
00
,
500
,
30
)
this
.
body_bg
.
addChild
(
colorBlock_left
)
let
colorBlock_right
=
new
ShapeRoundRect
()
colorBlock_right
.
x
=
6
80
*
this
.
mapScale
;
colorBlock_right
.
x
=
6
20
;
colorBlock_right
.
y
=
0
;
colorBlock_right
.
fillColor
=
"
#eef1f3
"
// `#${this.saveData.blockColor}`;
colorBlock_right
.
setSize
(
6
20
*
this
.
mapScale
,
500
*
this
.
mapScale
,
30
);
colorBlock_right
.
setSize
(
6
00
,
500
,
30
);
this
.
body_bg
.
addChild
(
colorBlock_right
);
// 初始化单词显示
...
...
@@ -795,7 +798,7 @@ export class PlayComponent implements OnInit, OnDestroy {
words_content
.
text
=
num
;
words_content
.
textAlign
=
'
center
'
;
words_content
.
fontSize
=
36
;
words_content
.
fontName
=
'
MMTextBookB
old
'
;
words_content
.
fontName
=
'
futura-md-bt-b
old
'
;
words_content
.
fontWeight
=
600
;
words_content
.
fontColor
=
"
#FFFFFF
"
;
words_content
.
refreshSize
();
...
...
@@ -819,12 +822,12 @@ export class PlayComponent implements OnInit, OnDestroy {
let
letterFontSize
=
48
;
// 单词背景
let
word_bg_group
=
new
ShapeRoundRect
()
word_bg_group
.
width
=
6
2
0
;
word_bg_group
.
width
=
6
0
0
;
word_bg_group
.
height
=
57
;
word_bg_group
.
x
=
x
*
this
.
mapScale
;
word_bg_group
.
y
=
y
*
this
.
mapScale
;
word_bg_group
.
x
=
x
;
word_bg_group
.
y
=
y
;
word_bg_group
.
fillColor
=
"
#FFFF00
"
word_bg_group
.
alpha
=
0
;
word_bg_group
.
alpha
=
1
;
let
startWidth
=
80
;
//单词
...
...
@@ -856,6 +859,7 @@ export class PlayComponent implements OnInit, OnDestroy {
scale
=
0.8
}
let
allUnderLines
=
[]
for
(
let
i
=
0
;
i
<
len
;
++
i
)
{
//字母
let
letter
=
word_content
.
letters
[
i
];
...
...
@@ -893,6 +897,7 @@ export class PlayComponent implements OnInit, OnDestroy {
lts_
.
setSize
(
ltBounds
.
width
,
2
);
lts_
.
fillColor
=
"
#949494
"
// this.getColor(letter.letter_color);
word_bg
.
addChild
(
lts_
);
allUnderLines
.
push
(
lts_
)
}
height
=
letter_spr
.
height
;
...
...
@@ -904,11 +909,13 @@ export class PlayComponent implements OnInit, OnDestroy {
word_bg
.
addChild
(
letter_spr
);
}
this
.
underLine
.
push
(
allUnderLines
);
word_bg
.
setSize
(
totalWidth
,
height
*
2
);
word_bg_group
.
addChild
(
word_bg
);
this
.
word_arr_left
.
push
(
word_bg
);
word_bg_group
.
setScaleXY
(
this
.
mapScale
);
//
word_bg_group.setScaleXY(this.mapScale);
this
.
word_bg_groups
.
push
(
word_bg_group
);
this
.
body_bg
.
addChild
(
word_bg_group
);
...
...
@@ -920,7 +927,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
x
=
0
;
let
y
=
50
+
114
*
i
;
if
(
i
>
3
){
x
=
6
8
0
;
x
=
6
2
0
;
y
=
50
+
114
*
(
i
-
4
);
}
let
index_1
=
i
// this.saveData.recordingIndex.indexOf(tIndex)
...
...
@@ -1059,6 +1066,13 @@ export class PlayComponent implements OnInit, OnDestroy {
let
option
=
this
.
optionsAll
[
i
];
if
(
this
.
checkClickTarget
(
option
))
{
if
(
option
[
"
correct
"
])
{
if
(
this
.
opend
[
option
[
"
index
"
]])
{
// console.log(this.underLine[option["index"]])
}
else
{
this
.
opend
[
option
[
"
index
"
]]
=
true
;
}
// this.playAudio("sm-choice-correct", false, ()=>{
// if(this.saveData.indexAudio[option["index"]]) {
// this.playAudio(this.saveData.indexAudio[option["index"]], true, ()=>{
...
...
@@ -1068,8 +1082,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// this.canTouch = true;
// }
// })
this
.
opend
[
option
[
"
index
"
]]
=
true
;
let
word
=
this
.
word_arr_left
[
option
[
"
index
"
]];
let
letters
:
Array
<
Label
>
=
word
.
children
.
slice
(
1
);
for
(
let
j
=
0
;
j
<
letters
.
length
;
j
++
)
{
...
...
@@ -1157,6 +1170,11 @@ export class PlayComponent implements OnInit, OnDestroy {
// this.playAudio(this.saveData.wordArr[i].word_audio_url);
})
return
;
}
else
{
console
.
log
(
this
.
underLine
[
i
])
this
.
underLine
[
i
].
forEach
(
element
=>
{
element
.
alpha
=
0
;
});
}
this
.
stopAllAudio
()
this
.
playAudio
(
this
.
saveData
.
wordArr
[
i
].
word_audio_url
);
...
...
src/assets/font/futura-md-bt-bold.ttf
0 → 100644
View file @
80983b9b
File added
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