Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU01
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
PU01
Commits
b37c7339
Commit
b37c7339
authored
Jun 28, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
3fe625cf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
26 deletions
+51
-26
ng-template-generator_20200628 21-31-56.zip
publish/ng-template-generator_20200628 21-31-56.zip
+0
-0
form.component.html
src/app/form/form.component.html
+3
-3
form.component.ts
src/app/form/form.component.ts
+2
-2
play.component.ts
src/app/play/play.component.ts
+46
-21
bg_laba.png
src/assets/play/bg_laba.png
+0
-0
No files found.
publish/ng-template-generator_2020062
5 12-36-57
.zip
→
publish/ng-template-generator_2020062
8 21-31-56
.zip
View file @
b37c7339
No preview for this file type
src/app/form/form.component.html
View file @
b37c7339
...
@@ -87,8 +87,8 @@
...
@@ -87,8 +87,8 @@
文字
文字
</div>
</div>
<div
style=
"flex:5"
>
<div
style=
"flex:5"
>
<
!-- <input type="text" nz-input placeholder="" [(ngModel)]="contentObj.dataArray[i]" (blur)="saveItem()" style="width: 250px;" /> --
>
<
input
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
item
.
text
"
(
blur
)="
saveItem
()"
style=
"width: 250px;"
/
>
<
input
type=
"text"
nz-input
placeholder=
""
[(
ngModel
)]="
contentObj
.
dataArray
[
i
].
text
"
(
blur
)="
handleTextChange
($
event
,
i
)"
style=
"width: 250px;"
/
>
<
!-- <input type="text" nz-input placeholder="" [(ngModel)]="contentObj.dataArray[i].text" (blur)="handleTextChange($event, i)" style="width: 250px;" /> --
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
图片
图片
</div>
</div>
<div
style=
"flex:5"
>
<div
style=
"flex:5"
>
<app-upload-image-with-preview
style=
"width: 100%;"
[
picUrl
]="
item
.
image_url
"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
contentObj
.
dataArray
,
i
)"
></app-upload-image-with-preview>
<app-upload-image-with-preview
style=
"width: 100%;"
[
picUrl
]="
item
.
image_url
"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
item
,
'
image_url
'
)"
></app-upload-image-with-preview>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/app/form/form.component.ts
View file @
b37c7339
...
@@ -150,12 +150,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -150,12 +150,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
addItem
(
item
?,
type
?)
{
addItem
(
item
?,
type
?)
{
item
.
push
(
""
)
item
.
push
(
{
text
:
""
,
image_url
:
""
}
)
this
.
saveItem
();
this
.
saveItem
();
}
}
onImageUploadSuccessByItem
(
e
,
item
,
key
)
{
onImageUploadSuccessByItem
(
e
,
item
,
key
)
{
this
.
contentObj
.
dataArray
[
key
].
image_url
=
e
.
url
item
[
key
]
=
e
.
url
this
,
this
.
refresh
()
this
,
this
.
refresh
()
this
.
save
();
this
.
save
();
}
}
...
...
src/app/play/play.component.ts
View file @
b37c7339
...
@@ -235,6 +235,13 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -235,6 +235,13 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
endGame
(){
endGame
(){
let
audioPlayer
=
this
.
g_cartoon
.
getCartoonElement
(
"
bg-short-audio
"
)
if
(
audioPlayer
.
isPlaying
){
audioPlayer
.
playIcon
.
ref
.
visible
=
true
audioPlayer
.
pauseIcon
.
ref
.
visible
=
false
audioPlayer
.
audio
.
pause
()
audioPlayer
.
isPlaying
=
!
audioPlayer
.
isPlaying
}
this
.
showEndPatal
();
this
.
showEndPatal
();
this
.
clapHand
();
this
.
clapHand
();
this
.
g_cartoon
.
playAudio
(
"
sm-choice-complete
"
,
false
,
()
=>
{
this
.
g_cartoon
.
playAudio
(
"
sm-choice-complete
"
,
false
,
()
=>
{
...
@@ -855,18 +862,20 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -855,18 +862,20 @@ export class PlayComponent implements OnInit, OnDestroy {
time
=
audio
.
duration
time
=
audio
.
duration
}
}
let
endTime
=
Math
.
floor
(
time
/
60
)
let
endTime
=
Math
.
floor
(
time
/
60
)
console
.
log
(
time
,
time
/
60
,
time
%
60
)
let
timeString
=
""
let
timeString
=
""
if
(
endTime
<
9
){
if
(
endTime
<
9
){
timeString
=
"
0
"
+
endTime
timeString
=
"
0
"
+
endTime
}
else
{
}
else
{
timeString
+
endTime
+
""
timeString
+
endTime
+
""
}
}
if
(
time
%
60
<
9
){
if
(
time
%
60
<
9
){
timeString
=
timeString
+
"
:0
"
+
(
time
%
60
+
""
).
substring
(
0
,
2
)
timeString
=
timeString
+
"
:0
"
+
(
Math
.
ceil
(
time
%
60
)
+
""
).
substring
(
0
,
2
)
}
else
{
}
else
{
timeString
=
timeString
+
"
:
"
+
(
time
%
60
+
""
).
substring
(
0
,
2
)
timeString
=
timeString
+
"
:
"
+
(
Math
.
ceil
(
time
%
60
)
+
""
).
substring
(
0
,
2
)
}
}
console
.
log
(
timeString
)
let
timeStart
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
audio-player-start
"
,
"
00:00
"
,
"
BRLNSR_1
"
,
"
#FFFFFF
"
,
34
)
let
timeStart
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
audio-player-start
"
,
"
00:00
"
,
"
BRLNSR_1
"
,
"
#FFFFFF
"
,
34
)
timeStart
.
ref
.
x
=
-
(
476
/
2
)
+
30
timeStart
.
ref
.
x
=
-
(
476
/
2
)
+
30
timeStart
.
ref
.
y
=
40
timeStart
.
ref
.
y
=
40
...
@@ -1028,18 +1037,18 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1028,18 +1037,18 @@ export class PlayComponent implements OnInit, OnDestroy {
let
audioType
=
"
L
"
let
audioType
=
"
L
"
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
bg-short-audio
"
,
"
bg_laba
"
,
(
w
,
h
)
=>
{
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
bg-short-audio
"
,
"
bg_laba
"
,
(
w
,
h
)
=>
{
return
{
return
{
sx
:
474
*
this
.
g_mapScale
/
w
,
sx
:
693
*
this
.
g_mapScale
/
w
,
sy
:
98
*
this
.
g_mapScale
/
h
sy
:
100
*
this
.
g_mapScale
/
h
}
}
},
(
w
,
h
)
=>
{
},
(
w
,
h
)
=>
{
let
x
=
0
;
let
x
=
0
;
let
y
=
0
let
y
=
0
if
(
this
.
g_formData
.
question
.
type
==
"
LongAudio
"
){
if
(
this
.
g_formData
.
question
.
type
==
"
LongAudio
"
){
x
=
-
23
5
x
=
-
12
5
y
=
-
45
y
=
-
45
}
else
{
}
else
{
audioType
=
"
S
"
audioType
=
"
S
"
x
=
2
0
x
=
8
0
}
}
return
{
return
{
x
:
this
.
g_cartoon
.
getOrigin
().
x
+
(
1280
+
x
)
*
this
.
g_mapScale
,
x
:
this
.
g_cartoon
.
getOrigin
().
x
+
(
1280
+
x
)
*
this
.
g_mapScale
,
...
@@ -1047,17 +1056,32 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1047,17 +1056,32 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
})
})
element
.
audioType
=
audioType
element
.
audioType
=
audioType
element
.
playIcon
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
btn-audio-play
"
,
"
btn_videooff
"
,
(
w
,
h
)
=>
{
if
(
element
.
audioType
==
"
S
"
){
return
{
element
.
playIcon
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
btn-audio-play
"
,
"
btn_laba (3)
"
,
(
w
,
h
)
=>
{
sx
:
91
/
w
,
return
{
sy
:
90
/
h
sx
:
136
/
w
,
}
sy
:
116
/
h
},
(
w
,
h
)
=>
{
}
return
{
},
(
w
,
h
)
=>
{
x
:
-
140
,
return
{
y
:
-
80
x
:
-
250
,
}
y
:
-
80
})
}
})
}
else
{
element
.
playIcon
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
btn-audio-play
"
,
"
btn_videooff
"
,
(
w
,
h
)
=>
{
return
{
sx
:
91
/
w
,
sy
:
90
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
-
250
,
y
:
-
80
}
})
}
element
.
pauseIcon
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
btn-audio-pause
"
,
"
btn_videoon
"
,
(
w
,
h
)
=>
{
element
.
pauseIcon
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
btn-audio-pause
"
,
"
btn_videoon
"
,
(
w
,
h
)
=>
{
return
{
return
{
sx
:
91
/
w
,
sx
:
91
/
w
,
...
@@ -1065,7 +1089,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1065,7 +1089,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
},
(
w
,
h
)
=>
{
},
(
w
,
h
)
=>
{
return
{
return
{
x
:
-
14
0
,
x
:
-
25
0
,
y
:
-
80
y
:
-
80
}
}
})
})
...
@@ -1101,7 +1125,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1101,7 +1125,7 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
starAni
=
this
.
g_cartoon
.
createAnimation
(
"
btn_laba
"
,
3
,
500
)
element
.
starAni
=
this
.
g_cartoon
.
createAnimation
(
"
btn_laba
"
,
3
,
500
)
element
.
starAni
.
loop
=
true
;
element
.
starAni
.
loop
=
true
;
element
.
starAni
.
setScaleXY
(
this
.
g_mapScale
)
element
.
starAni
.
setScaleXY
(
this
.
g_mapScale
)
element
.
starAni
.
x
=
element
.
ref
.
x
-
14
0
*
this
.
g_mapScale
element
.
starAni
.
x
=
element
.
ref
.
x
-
25
0
*
this
.
g_mapScale
element
.
starAni
.
y
=
element
.
ref
.
y
-
80
*
this
.
g_mapScale
element
.
starAni
.
y
=
element
.
ref
.
y
-
80
*
this
.
g_mapScale
this
.
render
(
element
.
starAni
,
zIndexMap
.
animation
)
this
.
render
(
element
.
starAni
,
zIndexMap
.
animation
)
element
.
starAni
.
play
()
element
.
starAni
.
play
()
...
@@ -1905,8 +1929,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1905,8 +1929,9 @@ export class PlayComponent implements OnInit, OnDestroy {
});
});
totlaWidth
+=
(
elementArray
.
length
-
1
)
*
spacing
totlaWidth
+=
(
elementArray
.
length
-
1
)
*
spacing
let
laseX
=
this
.
g_canvasWidth
/
2
-
totlaWidth
/
2
;
let
laseX
=
this
.
g_canvasWidth
/
2
-
totlaWidth
/
2
;
let
baseY
=
0
;
elementArray
.
forEach
((
element
,
index
)
=>
{
elementArray
.
forEach
((
element
,
index
)
=>
{
let
bd
=
element
.
ref
.
getBoundingBox
()
let
bd
=
element
.
ref
.
getBoundingBox
()
;
if
(
withAni
){
if
(
withAni
){
tweenChange
(
element
.
ref
,
{
x
:
laseX
+
bd
.
width
/
2
},
0.2
,
()
=>
{
tweenChange
(
element
.
ref
,
{
x
:
laseX
+
bd
.
width
/
2
},
0.2
,
()
=>
{
this
.
g_cartoon
.
saveSize
(
element
.
id
)
this
.
g_cartoon
.
saveSize
(
element
.
id
)
...
...
src/assets/play/bg_laba.png
View replaced file @
3fe625cf
View file @
b37c7339
18.6 KB
|
W:
|
H:
15 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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