Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
goodluck
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
fukai
goodluck
Commits
b36225d0
Commit
b36225d0
authored
Dec 27, 2019
by
zhangyongfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加抽奖结束时的结果动画,使中奖动画更自然
parent
9ea65295
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
17 deletions
+52
-17
App.vue
src/App.vue
+22
-17
animation.scss
src/assets/style/animation.scss
+30
-0
No files found.
src/App.vue
View file @
b36225d0
...
...
@@ -19,18 +19,20 @@
</li>
</ul>
</div>
<div
id=
"resbox"
v-show=
"showRes"
>
<p
@
click=
"showRes = false"
>
{{
categoryName
}}
抽奖结果:
</p>
<span
v-for=
"item in resArr"
:key=
"item"
class=
"itemres"
:style=
"resCardStyle"
@
click=
"showRes = false"
>
{{
item
}}
</span>
</div>
<transition
name=
"bounce"
>
<div
id=
"resbox"
v-show=
"showRes"
>
<p
@
click=
"showRes = false"
>
{{
categoryName
}}
抽奖结果:
</p>
<span
v-for=
"item in resArr"
:key=
"item"
class=
"itemres"
:style=
"resCardStyle"
@
click=
"showRes = false"
>
{{
item
}}
</span>
</div>
</transition>
<LotteryConfig
:visible
.
sync=
"showConfig"
@
resetconfig=
"reloadTagCanvas"
/>
<Tool
@
toggle=
"toggle"
@
resetConfig=
"reloadTagCanvas"
:running=
"running"
/>
...
...
@@ -61,7 +63,7 @@ export default {
computed
:
{
resCardStyle
()
{
const
style
=
{};
const
style
=
{
fontSize
:
'30px'
};
const
{
number
}
=
this
.
config
;
if
(
number
<
100
)
{
style
.
fontSize
=
'100px'
;
...
...
@@ -182,9 +184,7 @@ export default {
if
(
this
.
running
)
{
window
.
TagCanvas
.
SetSpeed
(
'rootcanvas'
,
speed
());
this
.
reloadTagCanvas
();
setTimeout
(()
=>
{
this
.
showRes
=
true
;
},
300
);
this
.
showRes
=
true
;
}
else
{
this
.
showRes
=
false
;
const
{
number
}
=
config
;
...
...
@@ -257,6 +257,12 @@ export default {
color
:
#ccc
;
font-size
:
12px
;
}
.bounce-enter-active
{
animation
:
bounce-in
1.5s
;
}
.bounce-leave-active
{
animation
:
bounce-in
0.2s
reverse
;
}
}
#main
{
height
:
100%
;
...
...
@@ -282,7 +288,6 @@ export default {
border-radius
:
4px
;
border
:
1px
solid
#ccc
;
line-height
:
160px
;
font-size
:
80px
;
font-weight
:
bold
;
margin-right
:
20px
;
margin-top
:
20px
;
...
...
src/assets/style/animation.scss
View file @
b36225d0
...
...
@@ -16,3 +16,33 @@
left
:
-400%
;
}
}
@-webkit-keyframes
bounce-in
{
0
%
{
-webkit-transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
0
);
transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
0
);
}
50
%
{
-webkit-transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
1
.5
);
transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
1
.5
);
}
100
%
{
-webkit-transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
1
);
transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
1
);
}
}
@keyframes
bounce-in
{
0
%
{
-webkit-transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
0
);
transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
0
);
}
50
%
{
-webkit-transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
1
.5
);
transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
1
.5
);
}
100
%
{
-webkit-transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
1
);
transform
:
translateX
(
-50%
)
translateY
(
-50%
)
scale
(
1
);
}
}
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