Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
pingan-maruko
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
ff433304
authored
Jun 16, 2020
by
October
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.izhida.cn:php/pingan-maruko
parents
443355bd
583616e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
11 deletions
+36
-11
Application/Home/View/default/layout.tpl
+1
-1
Public/static/js/common.js
+35
-10
No files found.
Application/Home/View/default/layout.tpl
View file @
ff433304
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<meta
name=
"format-detection"
content=
"telephone=no"
>
<meta
name=
"format-detection"
content=
"telephone=no"
>
{:assign var=projectId value=0}
{:assign var=projectId value=0}
{:assign var=rem value=false}
{:assign var=rem value=false}
{:assign var=version value='
6.1
.0'}
{:assign var=version value='
1.0
.0'}
{:block name='projectx'}{:/block}
{:block name='projectx'}{:/block}
{:if $rem == true}
{:if $rem == true}
<meta
name=
"viewport"
content=
"width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no"
>
<meta
name=
"viewport"
content=
"width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no"
>
...
...
Public/static/js/common.js
View file @
ff433304
...
@@ -67,6 +67,22 @@ $(document).ready(function () {
...
@@ -67,6 +67,22 @@ $(document).ready(function () {
});
});
function
deepClone
(
obj
)
{
var
objClone
=
new
Particle
if
(
obj
&&
typeof
obj
===
'object'
)
{
for
(
key
in
obj
)
{
if
(
key
!==
'children'
)
{
objClone
[
key
]
=
obj
[
key
]
}
}
}
return
objClone
}
function
init
()
{
function
init
()
{
inited
=
true
;
inited
=
true
;
$
(
'.page1'
).
show
();
$
(
'.page1'
).
show
();
...
@@ -99,32 +115,39 @@ function updateWorld() {
...
@@ -99,32 +115,39 @@ function updateWorld() {
}
}
function
update
()
{
function
update
()
{
if
(
particles
.
length
<
5
00
&&
Math
.
random
()
<
probability
)
{
if
(
particles
.
length
<
2
00
&&
Math
.
random
()
<
probability
)
{
createFirework
();
createFirework
();
}
}
var
alive
=
[];
var
alive
=
[];
for
(
var
i
=
0
;
i
<
particles
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
particles
.
length
;
i
++
)
{
oldParticle
=
deepClone
(
particles
[
i
])
if
(
particles
[
i
].
move
())
{
if
(
particles
[
i
].
move
())
{
alive
.
push
(
particles
[
i
]);
alive
.
push
(
particles
[
i
]);
particles
[
i
].
children
.
push
(
oldParticle
)
if
(
particles
[
i
].
children
.
length
>
5
)
{
particles
[
i
].
children
.
splice
(
0
,
1
)
}
}
}
}
}
particles
=
alive
;
particles
=
alive
;
}
}
function
paint
()
{
function
paint
()
{
// ctx.globalCompositeOperation = 'source-over';
// // ctx.fillStyle = "rgba(0,0,0,0.1)";
// ctx.fillRect(0, 0, w, h);
ctx
.
globalCompositeOperation
=
'lighter'
;
ctx
.
globalCompositeOperation
=
'lighter'
;
for
(
var
i
=
0
;
i
<
particles
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
particles
.
length
;
i
++
)
{
particles
[
i
].
draw
(
ctx
);
particles
[
i
].
draw
(
ctx
);
for
(
k
in
particles
[
i
].
children
)
{
particles
[
i
].
children
[
k
].
w
-=
0.205
particles
[
i
].
children
[
k
].
draw
(
ctx
)
}
}
}
}
}
function
createFirework
()
{
function
createFirework
()
{
xPoint
=
Math
.
random
()
*
(
w
-
200
)
+
100
;
xPoint
=
Math
.
random
()
*
(
w
-
200
)
+
100
;
yPoint
=
Math
.
random
()
*
(
h
-
5
00
)
+
100
;
yPoint
=
Math
.
random
()
*
(
h
-
2
00
)
+
100
;
var
nFire
=
Math
.
random
()
*
50
+
100
;
var
nFire
=
Math
.
random
()
*
50
+
100
;
// var nFire = 1;
var
c
=
"rgb("
+
(
~~
(
Math
.
random
()
*
200
+
55
))
+
","
+
var
c
=
"rgb("
+
(
~~
(
Math
.
random
()
*
200
+
55
))
+
","
+
(
~~
(
Math
.
random
()
*
200
+
55
))
+
","
+
(
~~
(
Math
.
random
()
*
200
+
55
))
+
")"
;
(
~~
(
Math
.
random
()
*
200
+
55
))
+
","
+
(
~~
(
Math
.
random
()
*
200
+
55
))
+
")"
;
for
(
var
i
=
0
;
i
<
nFire
;
i
++
)
{
for
(
var
i
=
0
;
i
<
nFire
;
i
++
)
{
...
@@ -139,7 +162,7 @@ function createFirework() {
...
@@ -139,7 +162,7 @@ function createFirework() {
}
}
function
Particle
()
{
function
Particle
()
{
this
.
w
=
this
.
h
=
Math
.
random
()
*
4
+
1
;
this
.
w
=
this
.
h
=
2
;
this
.
x
=
xPoint
-
this
.
w
/
2
;
this
.
x
=
xPoint
-
this
.
w
/
2
;
this
.
y
=
yPoint
-
this
.
h
/
2
;
this
.
y
=
yPoint
-
this
.
h
/
2
;
...
@@ -151,19 +174,21 @@ function Particle() {
...
@@ -151,19 +174,21 @@ function Particle() {
this
.
alpha
=
Math
.
random
()
*
.
5
+
.
5
;
this
.
alpha
=
Math
.
random
()
*
.
5
+
.
5
;
this
.
color
;
this
.
color
;
this
.
children
=
[];
}
}
Particle
.
prototype
=
{
Particle
.
prototype
=
{
gravity
:
0.0
1
,
gravity
:
0.0
5
,
move
:
function
()
{
move
:
function
()
{
this
.
childrens
.
push
({
x
:
this
.
x
,
y
:
this
.
y
}
);
this
.
childrens
.
push
({
x
:
this
.
x
,
y
:
this
.
y
}
);
this
.
x
+=
this
.
vx
;
this
.
x
+=
this
.
vx
;
this
.
vy
+=
this
.
gravity
;
this
.
vy
+=
this
.
gravity
;
this
.
y
+=
this
.
vy
;
this
.
y
+=
this
.
vy
;
this
.
alpha
-=
0.01
;
this
.
alpha
-=
0.01
;
if
(
this
.
x
<=
-
this
.
w
||
this
.
x
>=
canvas
.
width
||
if
(
this
.
x
<=
-
this
.
w
||
this
.
x
>=
screen
.
width
||
this
.
y
>=
canvas
.
height
||
this
.
y
>=
screen
.
height
||
this
.
alpha
<=
0
)
{
this
.
alpha
<=
0
)
{
this
.
alpha
=
0
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -172,7 +197,7 @@ Particle.prototype = {
...
@@ -172,7 +197,7 @@ Particle.prototype = {
var
step
=
0.05
;
var
step
=
0.05
;
c
.
save
();
c
.
save
();
c
.
beginPath
();
c
.
beginPath
();
this
.
w
=
this
.
w
>=
0
?
this
.
w
:
0.09
c
.
translate
(
this
.
x
+
this
.
w
/
2
,
this
.
y
+
this
.
h
/
2
);
c
.
translate
(
this
.
x
+
this
.
w
/
2
,
this
.
y
+
this
.
h
/
2
);
c
.
arc
(
0
,
0
,
this
.
w
,
0
,
Math
.
PI
*
2
);
c
.
arc
(
0
,
0
,
this
.
w
,
0
,
Math
.
PI
*
2
);
c
.
fillStyle
=
this
.
color
;
c
.
fillStyle
=
this
.
color
;
...
...
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