Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
dencare-game
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2729441a
authored
Sep 04, 2019
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
39ea15f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
Public/static/js/lucky-card.js
+19
-2
No files found.
Public/static/js/lucky-card.js
View file @
2729441a
...
@@ -27,6 +27,12 @@
...
@@ -27,6 +27,12 @@
*
*
* @constructor
* @constructor
*/
*/
var
defindX
=
0
;
var
defindY
=
0
;
var
timerStatus
=
false
;
var
timer
=
null
;
function
LuckyCard
(
settings
,
callback
)
{
function
LuckyCard
(
settings
,
callback
)
{
this
.
cover
=
null
;
this
.
cover
=
null
;
this
.
ctx
=
null
;
this
.
ctx
=
null
;
...
@@ -98,19 +104,30 @@
...
@@ -98,19 +104,30 @@
var
pageScrollLeft
=
document
.
documentElement
.
scrollLeft
||
document
.
body
.
scrollLeft
;
var
pageScrollLeft
=
document
.
documentElement
.
scrollLeft
||
document
.
body
.
scrollLeft
;
var
mouseX
=
evt
.
pageX
-
coverPos
.
left
-
pageScrollLeft
;
var
mouseX
=
evt
.
pageX
-
coverPos
.
left
-
pageScrollLeft
;
var
mouseY
=
evt
.
pageY
-
coverPos
.
top
-
pageScrollTop
;
var
mouseY
=
evt
.
pageY
-
coverPos
.
top
-
pageScrollTop
;
defineX
=
mouseX
;
defindY
=
mouseY
;
if
(
!
timerStatus
)
{
timer
=
setInterval
(
fillCircle
,
1
);
}
};
function
fillCircle
()
{
this
.
ctx
.
beginPath
();
this
.
ctx
.
beginPath
();
this
.
ctx
.
fillStyle
=
'#FFFFFF'
;
this
.
ctx
.
fillStyle
=
'#FFFFFF'
;
this
.
ctx
.
globalCompositeOperation
=
"destination-out"
;
this
.
ctx
.
globalCompositeOperation
=
"destination-out"
;
this
.
ctx
.
arc
(
mouseX
,
mouse
Y
,
10
,
0
,
2
*
Math
.
PI
);
this
.
ctx
.
arc
(
defineX
,
defind
Y
,
10
,
0
,
2
*
Math
.
PI
);
this
.
ctx
.
fill
();
this
.
ctx
.
fill
();
}
;
}
/**
/**
* touchend/mouseup event handler
* touchend/mouseup event handler
*/
*/
function
_endEventHandler
(
event
)
{
function
_endEventHandler
(
event
)
{
event
.
preventDefault
();
event
.
preventDefault
();
timerStatus
=
false
;
if
(
this
.
opt
.
callback
&&
typeof
this
.
opt
.
callback
===
'function'
)
_calcArea
.
call
(
this
,
this
.
ctx
,
this
.
opt
.
callback
,
this
.
opt
.
ratio
);
if
(
this
.
opt
.
callback
&&
typeof
this
.
opt
.
callback
===
'function'
)
_calcArea
.
call
(
this
,
this
.
ctx
,
this
.
opt
.
callback
,
this
.
opt
.
ratio
);
this
.
cover
.
removeEventListener
(
this
.
events
[
1
],
this
.
moveEventHandler
,
false
);
this
.
cover
.
removeEventListener
(
this
.
events
[
1
],
this
.
moveEventHandler
,
false
);
document
.
removeEventListener
(
this
.
events
[
2
],
this
.
endEventHandler
,
false
);
document
.
removeEventListener
(
this
.
events
[
2
],
this
.
endEventHandler
,
false
);
...
...
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