Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DF-L204
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
DF-L204
Commits
8dcb843a
Commit
8dcb843a
authored
Mar 24, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善
parent
cab02632
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
9 deletions
+30
-9
play.component.ts
src/app/play/play.component.ts
+30
-9
bg.png
src/assets/play/bg.png
+0
-0
btn_go.png
src/assets/play/btn_go.png
+0
-0
No files found.
src/app/play/play.component.ts
View file @
8dcb843a
...
...
@@ -96,7 +96,7 @@ export class PlayComponent implements OnInit, OnDestroy {
cardOuterR
=
90
;
//卡片内半径
cardInerR
=
8
0
;
cardInerR
=
7
0
;
maxWidth
=
450
;
...
...
@@ -115,6 +115,9 @@ export class PlayComponent implements OnInit, OnDestroy {
//练习题内容
curContents
=
[];
//练习题临时数组,用于随机取数
tempContents
=
[];
curContent
;
@
HostListener
(
'
window:resize
'
,
[
'
$event
'
])
...
...
@@ -603,9 +606,9 @@ export class PlayComponent implements OnInit, OnDestroy {
const
s
=
Math
.
min
(
sx
,
sy
);
this
.
mapScale
=
s
;
this
.
cardOuterR
=
90
*
this
.
mapScale
;
this
.
cardOuterR
=
this
.
cardOuterR
*
this
.
mapScale
;
this
.
cardInerR
=
80
*
this
.
mapScale
;
this
.
cardInerR
=
this
.
cardInerR
*
this
.
mapScale
;
this
.
renderArr
=
[];
...
...
@@ -800,6 +803,8 @@ export class PlayComponent implements OnInit, OnDestroy {
tContent
.
audio_url
=
content
.
audio_url
;
this
.
curContents
.
push
(
tContent
);
this
.
tempContents
.
push
(
tContent
);
}
//计算角度
...
...
@@ -938,7 +943,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
d
=
Math
.
sqrt
(
w
*
w
+
h
*
h
);
content_pic
.
setScaleXY
((
contentCard
.
width
-
60
)
/
d
);
content_pic
.
setScaleXY
((
contentCard
.
width
-
75
)
/
d
);
content_pic
.
x
=
0
;
content_pic
.
y
=
0
;
...
...
@@ -1066,7 +1071,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
y
=
itemPic
.
y
;
console
.
log
(
'
card
'
,
itemPic
);
//
console.log('card ', itemPic);
//设置阴影
if
(
y
>
-
30
){
...
...
@@ -1242,6 +1247,14 @@ export class PlayComponent implements OnInit, OnDestroy {
}
this
.
shadows
=
[];
//临时数组为空,则重新设置数据
if
(
!
this
.
tempContents
||
this
.
tempContents
.
length
==
0
){
console
.
log
(
'
reset temp contntes
'
);
for
(
let
i
=
0
;
i
<
this
.
curContents
.
length
;
++
i
){
this
.
tempContents
.
push
(
this
.
curContents
[
i
]);
}
}
}
}
...
...
@@ -1297,7 +1310,7 @@ export class PlayComponent implements OnInit, OnDestroy {
//音频长度
const
audio
=
this
.
audioObj
[
'
playing
'
];
let
duration
=
Math
.
ceil
(
audio
.
duration
)
;
let
duration
=
audio
.
duration
;
let
angle
=
duration
*
20
*
this
.
temp_multiple
;
...
...
@@ -1346,7 +1359,9 @@ export class PlayComponent implements OnInit, OnDestroy {
shadow
.
pic
.
setScaleXY
(
shadow
.
scale
);
}
this
.
curContent
=
this
.
getRandomItemFromArr
(
this
.
curContents
);
this
.
curContent
=
this
.
getRandomItemFromArr
(
this
.
tempContents
);
removeItemFromArr
(
this
.
tempContents
,
this
.
curContent
);
this
.
curContent
.
card_choice
.
alpha
=
1
;
//this.curContent.card_show.alpha = 0;
...
...
@@ -1371,16 +1386,22 @@ export class PlayComponent implements OnInit, OnDestroy {
return
;
}
let
time
=
0.1
;
if
(
duration
<
time
){
time
=
duration
;
}
let
t_angle
=
angle
%
360
;
item
.
rotation
=
t_angle
;
t_angle
=
t_angle
+
duration
*
20
*
this
.
temp_multiple
;
rotateItem
(
item
,
t_angle
,
0.2
,()
=>
{
rotateItem
(
item
,
t_angle
,
time
,()
=>
{
this
.
rotate
(
item
,
t_angle
,
duration
-
0.2
,
callback
);
this
.
rotate
(
item
,
t_angle
,
duration
-
time
,
callback
);
});
...
...
src/assets/play/bg.png
View replaced file @
cab02632
View file @
8dcb843a
447 KB
|
W:
|
H:
520 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/play/btn_go.png
View replaced file @
cab02632
View file @
8dcb843a
6.31 KB
|
W:
|
H:
8.18 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