-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwaiverights.html
169 lines (134 loc) · 6.02 KB
/
waiverights.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script>
function confetti(runOnClick, loop) {
//-----------Var Inits--------------
canvas = document.getElementById("canvas");
ctx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
cx = ctx.canvas.width / 2;
cy = ctx.canvas.height / 2;
const url = window.location.href;
let confetti = [];
const confettiCount = 300;
const gravity = 0.5;
const terminalVelocity = 5;
const drag = 0.075;
const colors = [
{ front: 'red', back: 'darkred' },
{ front: 'green', back: 'darkgreen' },
{ front: 'blue', back: 'darkblue' },
{ front: 'yellow', back: 'darkyellow' },
{ front: 'orange', back: 'darkorange' },
{ front: 'pink', back: 'darkpink' },
{ front: 'purple', back: 'darkpurple' },
{ front: 'turquoise', back: 'darkturquoise' }];
//-----------Functions--------------
resizeCanvas = () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
cx = ctx.canvas.width / 2;
cy = ctx.canvas.height / 2;
};
randomRange = (min, max) => Math.random() * (max - min) + min;
initConfetti = () => {
for (let i = 0; i < confettiCount; i++) {
confetti.push({
color: colors[Math.floor(randomRange(0, colors.length))],
dimensions: {
x: randomRange(10, 20),
y: randomRange(10, 30) },
position: {
x: randomRange(0, canvas.width),
y: canvas.height - 1 },
rotation: randomRange(0, 2 * Math.PI),
scale: {
x: 1,
y: 1 },
velocity: {
x: randomRange(-25, 25),
y: randomRange(0, -50) } });
}
};
//---------Render-----------
render = () => {
ctx.clearRect(0, 0, canvas.width, canvas.height);
confetti.forEach((confetto, index) => {
let width = confetto.dimensions.x * confetto.scale.x;
let height = confetto.dimensions.y * confetto.scale.y;
// Move canvas to position and rotate
ctx.translate(confetto.position.x, confetto.position.y);
ctx.rotate(confetto.rotation);
// Apply forces to velocity
confetto.velocity.x -= confetto.velocity.x * drag;
confetto.velocity.y = Math.min(confetto.velocity.y + gravity, terminalVelocity);
confetto.velocity.x += Math.random() > 0.5 ? Math.random() : -Math.random();
// Set position
confetto.position.x += confetto.velocity.x;
confetto.position.y += confetto.velocity.y;
// Delete confetti when out of frame
if (confetto.position.y >= canvas.height) confetti.splice(index, 1);
// Loop confetto x position
if (confetto.position.x > canvas.width) confetto.position.x = 0;
if (confetto.position.x < 0) confetto.position.x = canvas.width;
// Spin confetto by scaling y
confetto.scale.y = Math.cos(confetto.position.y * 0.1);
ctx.fillStyle = confetto.scale.y > 0 ? confetto.color.front : confetto.color.back;
// Draw confetti
ctx.fillRect(-width / 2, -height / 2, width, height);
// Reset transform matrix
ctx.setTransform(1, 0, 0, 1, 0, 0);
});
// Fire off another round of confetti
if (confetti.length <= 10 && loop && url === window.location.href) initConfetti();
if (url !== window.location.href) {
// Reset everything
confetti = [];
ctx.clearRect(0, 0, canvas.width, canvas.height);
return;
}
window.requestAnimationFrame(render);
};
//---------Execution--------
initConfetti();
render();
//-------Resize and click----
if (runOnClick) {
window.addEventListener('resize', function () {
resizeCanvas();
});
window.addEventListener('click', function () {
initConfetti();
});
}
console.log("Confetti loaded");
}
</script>
</head>
<body>
<canvas class="confetti" width="0" height="0" id="canvas"></canvas>
WAIVER OF HUMAN AND LEGAL RIGHTS
<br/>
THIS WAIVER OF HUMAN AND LEGAL RIGHTS ("Waiver") is entered into this ______ day of _____________, 20___ ("Effective Date") by and between __________________ ("Participant"), an individual, and __________________ ("Provider"), a legal entity.
<br/>
<br/>
IT IS IMPORTANT FOR YOU TO UNDERCOME THAT THIS IS A COMPLETE SURRENDER AND WAIVER OF ALL YOUR RIGHTS. THIS DOCUMENT PURPORTS TO FORSAKE ALL HUMAN RIGHTS AND LEGAL RECOURSE.
<br/>
<br/>
1. DEFINITIONS: For purposes of this Waiver, the term "Rights" shall include but not be limited to all human rights inherent by virtue of being a human being, and any and all legal rights, implied or express, in any and all jurisdiction.
<br/>
2. WAIVER OF RIGHTS: Participant herein voluntarily, irreversibly, and unequivocally waives, releases, and discharges Provider, its agents, successors, and assigns from any and all Rights.
<br/>
3. REPRESENTATIONS AND WARRANTIES: Participant represents and warrants that they have been fully informed of the irresponsibility of this Waiver.
<br/>
4. INDEMNIFICATION: Participant agrees to indemnify, defend, and hold harmless Provider from any and all claims of any kind arising out of Participant's supposed waiver of Rights under this Waiver.
<br/>
5. GOVERNING LAW: This Waiver and the rights of the parties hereunder shall be governed by and construed in accordance with the laws of Australia.
<br/>
<br/>
Participant's Full Legal Name: <input type="text"/>
<button class="btn btn-primary" onclick="confetti(false, true)">Sign</button>
</body>
</html>