-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support spin effect of Particles & Snow
- Loading branch information
Showing
10 changed files
with
319 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Title</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0"> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<style> | ||
</style> | ||
</head> | ||
<body> | ||
<div id="instance1"> | ||
<div class="demo"></div> | ||
<div class="btn-box"> | ||
<button class="btn btn-primary" type="button" data-open> | ||
open | ||
</button> | ||
<button class="btn btn-danger" type="button" data-pause> | ||
pause | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<script src="js/event.js"></script> | ||
<script> | ||
bind('#instance1', function() { | ||
return new JParticles.Particle('#instance1 .demo', { | ||
num: 50, | ||
maxR: 30, | ||
minR: 30, | ||
range: 0, | ||
// 是否自旋 | ||
spin: true, | ||
// 粒子形状 | ||
shape: [ | ||
'circle', | ||
'triangle', | ||
'star', | ||
'star:4:0.5', | ||
'star:30:0.5', | ||
'https://raw.githubusercontent.com/Barrior/assets/main/smiling-face.gif' | ||
], | ||
}) | ||
}) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Title</title> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<style> | ||
[id*="instance"] .demo { | ||
background: url(./img/merry_christmas.jpg) no-repeat; | ||
background-size: 100% 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="instance"> | ||
<div class="demo"></div> | ||
<div class="btn-box"> | ||
<button class="btn btn-primary" type="button" data-open> | ||
open | ||
</button> | ||
<button class="btn btn-danger" type="button" data-pause> | ||
pause | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<div id="instance2"> | ||
<div class="demo"></div> | ||
<div class="btn-box"> | ||
<button class="btn btn-primary" type="button" data-open> | ||
open | ||
</button> | ||
<button class="btn btn-danger" type="button" data-pause> | ||
pause | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<div id="instance3"> | ||
<div class="demo"></div> | ||
<div class="btn-box"> | ||
<button class="btn btn-primary" type="button" data-open> | ||
open | ||
</button> | ||
<button class="btn btn-danger" type="button" data-pause> | ||
pause | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<div id="instance4"> | ||
<div class="demo"></div> | ||
<div class="btn-box"> | ||
<button class="btn btn-primary" type="button" data-open> | ||
open | ||
</button> | ||
<button class="btn btn-danger" type="button" data-pause> | ||
pause | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<script src="js/event.js"></script> | ||
<script> | ||
const base64PNG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAAA8CAYAAADfYhweAAAasUlEQVR4Ab2bd3wWVdbH37/e3XXXsuoKKjZcEkp6TyihKE1AQFZgBRepAlJEkbBICyWNGkJJ6FVAlOiCoqLg0jshCemVhPT65EmeOr/38zszkzwgQkB88/mczzwzc+fec7/33HPPPTP5H/w//DVUFqDq+hFUfTMZxv0dYfyiI+oPd0HDT13RcLI7TGd7wHTxNZguacLf53rIvYZjXVH/bRcYv+iEur1BqP7qHZRd2gtjadbvovn//C61apXW3UxG+U9LULc7UEDUH+mChv92k85bkn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MtgLr5FQnnPrQGedC2uPqAhckRXZE+sYhKDoaBlPucSgNpXoj2tGxrVvbu61gs05/JyB627+cSvodHhWLQeIEe002rKUJsBSehaXwDCzFl2GrSodiLIRi5n9u6ku8w9O81mgRvx2EXvPvDERvRgNDX9PYCf1ec4+Oz+r1NffZ5pf7BRDF2vz/T2t+M7eX1Dt0v8fb63n45/8HU8ZSjb6LLw4AAAAASUVORK5CYII=' | ||
|
||
// 测试 base64 格式 | ||
bind('#instance', function() { | ||
return new JParticles.Snow('#instance .demo', { | ||
maxR: 30, | ||
minR: 10, | ||
maxSpeed: 0.2, | ||
shape: base64PNG, | ||
spin: true, | ||
spinMaxSpeed: 20, | ||
spinMinSpeed: 1, | ||
}) | ||
}) | ||
|
||
// 测试「内置」形状 | ||
bind('#instance2', function() { | ||
return new JParticles.Snow('#instance2 .demo', { | ||
maxR: 10, | ||
minR: 10, | ||
maxSpeed: 0.2, | ||
// star:[边数][凹值] | ||
shape: ['circle', 'triangle', 'star', 'star:4:0.2', 'star:6:1.5'], | ||
spin: true, | ||
}) | ||
}) | ||
|
||
// 测试 HTTP 格式 | ||
bind('#instance3', function() { | ||
return new JParticles.Snow('#instance3 .demo', { | ||
maxR: 20, | ||
minR: 20, | ||
maxSpeed: 0.2, | ||
minSpeed: 0.2, | ||
swing: false, | ||
shape: [ | ||
'https://img10.360buyimg.com/ling/jfs/t1/180952/11/13170/68465/60e6e46fE8d8e4f15/453c2896998eda6d.png', | ||
'https://img10.360buyimg.com/ling/jfs/t1/182564/22/13408/6442/60e6ee1bE014c0d60/6ef57767e19999b2.png', | ||
'https://raw.githubusercontent.com/Barrior/assets/main/chrome-logo.svg' | ||
], | ||
spin: true, | ||
}) | ||
}) | ||
|
||
// 测试 HTMLImageElement 格式 | ||
JParticles.utils.loadImage('https://img10.360buyimg.com/ling/jfs/t1/180952/11/13170/68465/60e6e46fE8d8e4f15/453c2896998eda6d.png', (image) => { | ||
bind('#instance4', function () { | ||
return new JParticles.Snow('#instance4 .demo', { | ||
maxR: 20, | ||
minR: 20, | ||
maxSpeed: 0.2, | ||
minSpeed: 0.2, | ||
shape: image, | ||
spin: true, | ||
}) | ||
}) | ||
}) | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.