Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM5-20
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-20
Commits
f3824d68
Commit
f3824d68
authored
Apr 13, 2021
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev done
parent
f3e33862
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
563 additions
and
119 deletions
+563
-119
form.component.html
src/app/form/form.component.html
+4
-4
play.component.scss
src/app/play/play.component.scss
+5
-0
play.component.ts
src/app/play/play.component.ts
+69
-8
data.js
src/assets/play/data/data.js
+485
-107
Century Gothic Bold.ttf
src/assets/play/font/Century Gothic Bold.ttf
+0
-0
button.mp3
src/assets/play/sound/button.mp3
+0
-0
incorrect.mp3
src/assets/play/sound/incorrect.mp3
+0
-0
popup.mp3
src/assets/play/sound/popup.mp3
+0
-0
No files found.
src/app/form/form.component.html
View file @
f3824d68
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
5
"
nzFor=
"item.text_main"
>
正确选项
</nz-form-label>
<nz-form-label
[
nzSpan
]="
5
"
nzFor=
"item.text_main"
>
正确选项
</nz-form-label>
<nz-form-control
[
nzSpan
]="
10
"
>
<nz-form-control
[
nzSpan
]="
10
"
>
<nz-select
[(
ngModel
)]="
item
.
rightSide
"
>
<nz-select
[(
ngModel
)]="
item
.
rightSide
"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
nzValue=
"left"
nzLabel=
"左选项"
default
></nz-option>
<nz-option
nzValue=
"left"
nzLabel=
"左选项"
default
></nz-option>
<nz-option
nzValue=
"right"
nzLabel=
"右选项"
></nz-option>
<nz-option
nzValue=
"right"
nzLabel=
"右选项"
></nz-option>
</nz-select>
</nz-select>
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
<td>
<td>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
nzValue=
"#363333"
nzLabel=
"灰色"
></nz-option>
<nz-option
nzValue=
"#363333"
nzLabel=
"灰色"
></nz-option>
<nz-option
nzValue=
"#c8161
d
"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"#c8161
e
"
nzLabel=
"红色"
></nz-option>
</nz-select>
</nz-select>
</td>
</td>
</tr>
</tr>
...
@@ -147,7 +147,7 @@
...
@@ -147,7 +147,7 @@
<td>
<td>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
nzValue=
"#363333"
nzLabel=
"灰色"
></nz-option>
<nz-option
nzValue=
"#363333"
nzLabel=
"灰色"
></nz-option>
<nz-option
nzValue=
"#c8161
d
"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"#c8161
e
"
nzLabel=
"红色"
></nz-option>
</nz-select>
</nz-select>
</td>
</td>
</tr>
</tr>
...
@@ -201,7 +201,7 @@
...
@@ -201,7 +201,7 @@
<td>
<td>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<nz-select
[(
ngModel
)]="
data
.
letter_color
"
(
ngModelChange
)="
saveItem
()"
>
<nz-option
nzValue=
"#363333"
nzLabel=
"灰色"
></nz-option>
<nz-option
nzValue=
"#363333"
nzLabel=
"灰色"
></nz-option>
<nz-option
nzValue=
"#c8161
d
"
nzLabel=
"红色"
></nz-option>
<nz-option
nzValue=
"#c8161
e
"
nzLabel=
"红色"
></nz-option>
</nz-select>
</nz-select>
</td>
</td>
</tr>
</tr>
...
...
src/app/play/play.component.scss
View file @
f3824d68
...
@@ -105,6 +105,11 @@
...
@@ -105,6 +105,11 @@
font-family
:
'FuturaBT Medium'
;
font-family
:
'FuturaBT Medium'
;
src
:
url("../../assets/play/font/FuturaBT Medium.ttf")
;
src
:
url("../../assets/play/font/FuturaBT Medium.ttf")
;
}
}
@font-face
{
font-family
:
'Century Gothic Bold'
;
src
:
url("../../assets/play/font/Century Gothic Bold.ttf")
;
}
// @font-face{
// @font-face{
// font-family: 'FuturaStd-Medium';
// font-family: 'FuturaStd-Medium';
// src: url("../../assets/play/font/FuturaStd-Medium.otf") ;
// src: url("../../assets/play/font/FuturaStd-Medium.otf") ;
...
...
src/app/play/play.component.ts
View file @
f3824d68
...
@@ -180,6 +180,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -180,6 +180,7 @@ export class PlayComponent implements OnInit, OnDestroy {
contentObj
.
long_audio
.
audio_url
&&
array
.
push
(
contentObj
.
long_audio
.
audio_url
)
contentObj
.
long_audio
.
audio_url
&&
array
.
push
(
contentObj
.
long_audio
.
audio_url
)
contentObj
.
title
.
mainTextAudio_url
&&
array
.
push
(
contentObj
.
title
.
mainTextAudio_url
)
contentObj
.
title
.
mainTextAudio_url
&&
array
.
push
(
contentObj
.
title
.
mainTextAudio_url
)
contentObj
.
dataArray
.
forEach
(
element
=>
{
contentObj
.
dataArray
.
forEach
(
element
=>
{
element
.
audio_url_main
&&
array
.
push
(
element
.
audio_url_main
)
element
.
audio_url_left
&&
array
.
push
(
element
.
audio_url_left
)
element
.
audio_url_left
&&
array
.
push
(
element
.
audio_url_left
)
element
.
audio_url_right
&&
array
.
push
(
element
.
audio_url_right
)
element
.
audio_url_right
&&
array
.
push
(
element
.
audio_url_right
)
});
});
...
@@ -378,7 +379,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -378,7 +379,7 @@ export class PlayComponent implements OnInit, OnDestroy {
textMainContainer
.
ref
.
alpha
=
0
;
textMainContainer
.
ref
.
alpha
=
0
;
let
baseX
=
0
;
let
baseX
=
0
;
for
(
let
wi
=
0
;
wi
<
dataItem
.
letters_main
.
length
;
wi
++
)
{
for
(
let
wi
=
0
;
wi
<
dataItem
.
letters_main
.
length
;
wi
++
)
{
let
letter
=
this
.
g_cartoon
.
createLabel
(
dataItem
.
letters_main
[
wi
].
letter_val
,
"
FuturaBT-
Bold
"
,
dataItem
.
letters_main
[
wi
].
letter_color
,
48
*
1
,
baseX
,
50
,
"
left
"
)
let
letter
=
this
.
g_cartoon
.
createLabel
(
dataItem
.
letters_main
[
wi
].
letter_val
,
"
Century Gothic
Bold
"
,
dataItem
.
letters_main
[
wi
].
letter_color
,
48
*
1
,
baseX
,
50
,
"
left
"
)
let
bd
=
letter
.
getBoundingBox
();
let
bd
=
letter
.
getBoundingBox
();
baseX
+=
bd
.
width
+
1
baseX
+=
bd
.
width
+
1
textMainContainer
.
ref
.
addChild
(
letter
)
textMainContainer
.
ref
.
addChild
(
letter
)
...
@@ -388,28 +389,36 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -388,28 +389,36 @@ export class PlayComponent implements OnInit, OnDestroy {
textMainContainer
.
ref
.
y
=
pos
[
len
].
textMain
.
y
-
50
;
textMainContainer
.
ref
.
y
=
pos
[
len
].
textMain
.
y
-
50
;
let
textLeftContainer
=
this
.
g_cartoon
.
createCartoonElementShapeRect
(
`popup-text-back-left-
${
i
}
-container`
,
386
,
100
,
"
#FFFF00
"
);
let
textLeftContainer
=
this
.
g_cartoon
.
createCartoonElementShapeRect
(
`popup-text-back-left-
${
i
}
-container`
,
386
,
100
,
"
#FFFF00
"
);
let
lettersLeft
=
[]
bgCard
.
ref
.
addChild
(
textLeftContainer
.
ref
);
bgCard
.
ref
.
addChild
(
textLeftContainer
.
ref
);
textLeftContainer
.
ref
.
alpha
=
0
;
textLeftContainer
.
ref
.
alpha
=
0
;
baseX
=
0
;
baseX
=
0
;
for
(
let
wi
=
0
;
wi
<
dataItem
.
letters_left
.
length
;
wi
++
)
{
for
(
let
wi
=
0
;
wi
<
dataItem
.
letters_left
.
length
;
wi
++
)
{
let
letter
=
this
.
g_cartoon
.
createLabel
(
dataItem
.
letters_left
[
wi
].
letter_val
,
"
FuturaBT-Bold
"
,
dataItem
.
letters_left
[
wi
].
letter_color
,
42
*
1
,
baseX
,
50
,
"
left
"
)
let
letter
=
this
.
g_cartoon
.
createLabel
(
dataItem
.
letters_left
[
wi
].
letter_val
,
"
FuturaBT-Bold
"
,
"
#363333
"
,
42
*
1
,
baseX
,
50
,
"
left
"
)
let
bd
=
letter
.
getBoundingBox
();
let
bd
=
letter
.
getBoundingBox
();
baseX
+=
bd
.
width
+
1
baseX
+=
bd
.
width
+
1
textLeftContainer
.
ref
.
addChild
(
letter
)
textLeftContainer
.
ref
.
addChild
(
letter
);
if
(
dataItem
.
letters_left
[
wi
].
letter_color
==
"
#c8161e
"
)
{
lettersLeft
.
push
(
letter
)
}
}
}
textLeftContainer
.
ref
.
width
=
baseX
;
textLeftContainer
.
ref
.
width
=
baseX
;
textLeftContainer
.
ref
.
x
=
pos
[
len
].
textLeft
.
x
-
baseX
/
2
;
textLeftContainer
.
ref
.
x
=
pos
[
len
].
textLeft
.
x
-
baseX
/
2
;
textLeftContainer
.
ref
.
y
=
pos
[
len
].
textLeft
.
y
-
50
;
textLeftContainer
.
ref
.
y
=
pos
[
len
].
textLeft
.
y
-
50
;
let
textRightContainer
=
this
.
g_cartoon
.
createCartoonElementShapeRect
(
`popup-text-back-right-
${
i
}
-container`
,
386
,
100
,
"
#FFFF00
"
);
let
textRightContainer
=
this
.
g_cartoon
.
createCartoonElementShapeRect
(
`popup-text-back-right-
${
i
}
-container`
,
386
,
100
,
"
#FFFF00
"
);
let
lettersRight
=
[]
bgCard
.
ref
.
addChild
(
textRightContainer
.
ref
);
bgCard
.
ref
.
addChild
(
textRightContainer
.
ref
);
textRightContainer
.
ref
.
alpha
=
0
;
textRightContainer
.
ref
.
alpha
=
0
;
baseX
=
0
;
baseX
=
0
;
for
(
let
wi
=
0
;
wi
<
dataItem
.
letters_right
.
length
;
wi
++
)
{
for
(
let
wi
=
0
;
wi
<
dataItem
.
letters_right
.
length
;
wi
++
)
{
let
letter
=
this
.
g_cartoon
.
createLabel
(
dataItem
.
letters_right
[
wi
].
letter_val
,
"
FuturaBT-Bold
"
,
dataItem
.
letters_right
[
wi
].
letter_color
,
42
*
1
,
baseX
,
50
,
"
left
"
)
let
letter
=
this
.
g_cartoon
.
createLabel
(
dataItem
.
letters_right
[
wi
].
letter_val
,
"
FuturaBT-Bold
"
,
"
#363333
"
,
42
*
1
,
baseX
,
50
,
"
left
"
)
let
bd
=
letter
.
getBoundingBox
();
let
bd
=
letter
.
getBoundingBox
();
baseX
+=
bd
.
width
+
1
baseX
+=
bd
.
width
+
1
textRightContainer
.
ref
.
addChild
(
letter
)
textRightContainer
.
ref
.
addChild
(
letter
)
if
(
dataItem
.
letters_right
[
wi
].
letter_color
==
"
#c8161e
"
)
{
lettersRight
.
push
(
letter
)
}
}
}
textRightContainer
.
ref
.
width
=
baseX
;
textRightContainer
.
ref
.
width
=
baseX
;
textRightContainer
.
ref
.
x
=
pos
[
len
].
textRight
.
x
-
baseX
/
2
;
textRightContainer
.
ref
.
x
=
pos
[
len
].
textRight
.
x
-
baseX
/
2
;
...
@@ -513,27 +522,79 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -513,27 +522,79 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
}
}
this
.
subscribeMapDownEvent
(
textMainContainer
.
id
,
()
=>
{
if
(
dataItem
.
audio_url_main
)
{
this
.
g_cartoon
.
playAudio
(
dataItem
.
audio_url_main
,
false
,
()
=>
{
this
.
g_enableMapDown
=
true
;
})
}
else
{
this
.
g_enableMapDown
=
true
;
}
})
this
.
subscribeMapDownEvent
(
textLeftContainer
.
id
,
()
=>
{
if
(
dataItem
.
audio_url_left
)
{
this
.
g_cartoon
.
playAudio
(
dataItem
.
audio_url_left
,
false
,
()
=>
{
this
.
g_enableMapDown
=
true
;
})
}
else
{
this
.
g_enableMapDown
=
true
;
}
})
this
.
subscribeMapDownEvent
(
textRightContainer
.
id
,
()
=>
{
if
(
dataItem
.
audio_url_right
)
{
this
.
g_cartoon
.
playAudio
(
dataItem
.
audio_url_right
,
false
,
()
=>
{
this
.
g_enableMapDown
=
true
;
})
}
else
{
this
.
g_enableMapDown
=
true
;
}
})
bgCard
.
selected
=
false
;
bgCard
.
selected
=
false
;
this
.
subscribeMapDownEvent
(
targetRigh
t
.
id
,
()
=>
{
this
.
subscribeMapDownEvent
(
radioButtonRight_ou
t
.
id
,
()
=>
{
if
(
!
bgCard
.
selected
)
{
if
(
!
bgCard
.
selected
)
{
bgCard
.
switchSelect
(
"
right
"
)
bgCard
.
switchSelect
(
"
right
"
)
if
(
dataItem
.
rightSide
==
"
right
"
)
{
if
(
dataItem
.
rightSide
==
"
right
"
)
{
this
.
g_cartoon
.
playAudio
(
"
sm-correct
"
,
false
,
()
=>
{
this
.
g_enableMapDown
=
true
;
})
circleRight
.
ref
.
alpha
=
255
;
circleRight
.
ref
.
alpha
=
255
;
lettersRight
.
forEach
(
le
=>
{
le
.
fontColor
=
"
#c8161e
"
})
bgCard
.
selected
=
true
;
bgCard
.
selected
=
true
;
}
else
{
this
.
g_cartoon
.
playAudio
(
"
sm-wrong
"
,
false
,
()
=>
{
this
.
g_enableMapDown
=
true
;
})
}
}
}
else
{
this
.
g_enableMapDown
=
true
;
}
}
this
.
g_enableMapDown
=
true
;
})
})
this
.
subscribeMapDownEvent
(
targetLef
t
.
id
,
()
=>
{
this
.
subscribeMapDownEvent
(
radioButtonLeft_ou
t
.
id
,
()
=>
{
if
(
!
bgCard
.
selected
)
{
if
(
!
bgCard
.
selected
)
{
bgCard
.
switchSelect
(
"
left
"
)
bgCard
.
switchSelect
(
"
left
"
)
if
(
dataItem
.
rightSide
==
"
left
"
)
{
if
(
dataItem
.
rightSide
==
"
left
"
)
{
this
.
g_cartoon
.
playAudio
(
"
sm-correct
"
,
false
,
()
=>
{
this
.
g_enableMapDown
=
true
;
})
circleLeft
.
ref
.
alpha
=
255
;
circleLeft
.
ref
.
alpha
=
255
;
lettersLeft
.
forEach
(
le
=>
{
le
.
fontColor
=
"
#c8161e
"
})
bgCard
.
selected
=
true
;
bgCard
.
selected
=
true
;
}
else
{
this
.
g_cartoon
.
playAudio
(
"
sm-wrong
"
,
false
,
()
=>
{
this
.
g_enableMapDown
=
true
;
})
}
}
}
else
{
this
.
g_enableMapDown
=
true
;
}
}
this
.
g_enableMapDown
=
true
;
})
})
cardContainer
.
ref
.
addChild
(
bgCard
.
ref
)
cardContainer
.
ref
.
addChild
(
bgCard
.
ref
)
...
...
src/assets/play/data/data.js
View file @
f3824d68
This diff is collapsed.
Click to expand it.
src/assets/play/font/Century Gothic Bold.ttf
0 → 100644
View file @
f3824d68
File added
src/assets/play/sound/button.mp3
deleted
100644 → 0
View file @
f3e33862
File deleted
src/assets/play/sound/incorrect.mp3
0 → 100644
View file @
f3824d68
File added
src/assets/play/sound/popup.mp3
deleted
100644 → 0
View file @
f3e33862
File deleted
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