-
Notifications
You must be signed in to change notification settings - Fork 4
/
tanksTipJar.html
223 lines (195 loc) · 14.1 KB
/
tanksTipJar.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<!DOCTYPE html>
<html>
<head>
<title>Tank's Tip Jar</title>
<link href="https://fonts.googleapis.com/css?family=Staatliches" rel="stylesheet">
<style type="text/css">
* {
margin: 0; padding: 0;
transition: 200ms all cubic-bezier(0.4, 0.0, 0.2, 1);
}
*:focus { outline: none; }
*::selection {
background: #F8D80D;
color: #1d1f21;
}
body {
font-family: "Staatliches", sans-serif;
color: #1d1f21;
background-color: #1d1f21;
background-image: linear-gradient(
rgba(29, 31, 33, 0.5),
rgba(29, 31, 33, 0.5)
), url(tanks.jpg);
background-position: center;
background-size: cover;
width: 100vw;
height: 100vh;
overflow: hidden;
color: #fff;
font-size: 28px;
}
.icon {
display: inline-block;
width: 24px;
height: 24px;
fill: #1d1f21;
transition: none;
}
#money {
width: calc(100% + 40px);
margin-left: -20px;
text-align: center;
font-size: 32px;
}
#money td {
padding: 5px 0;
background: #1d1f21;
border-radius: 64px;
color: #fff;
cursor: pointer;
border: solid 4px #F8D80D;
}
#money .icon {
width: 32px;
height: 32px;
margin-bottom: -4px;
fill: #fff;
}
#money td.active {
background: #F8D80D;
color: #1d1f21;
}
#money .active .icon {
fill: #1d1f21;
}
#logo {
width: 240px;
fill: #F8D80D;
margin: 10px 0;
}
#content {
position: absolute; margin: auto;
top: 30px; left: 0; right: 0;
width: 420px;
}
input[type="number"], textarea, button {
width: calc(100% - 8px);
height: 48px;
border-radius: 64px;
border: solid 4px #F8D80D;
background: #1d1f21;
font-family: "Staatliches", sans-serif;
font-size: 32px;
color: #fff;
text-align: center;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
margin: 0;
}
input[type="number"]::placeholder {
color: rgba(255,255,255,0.1);
}
input[type="number"].active {
background: #F8D80D;
color: #1d1f21;
}
textarea {
resize: none;
border: none;
border-radius: 16px;
font-size: 28px;
padding: 10px 15px;
text-align: left;
width: calc(100% - 30px);
height: 66px;
}
textarea::-webkit-scrollbar {
width: 0;
}
button {
height: 64px;
font-size: 32px;
background: #F8D80D;
color: #1d1f21;
}
#money td:hover, button:hover {
transform: scale(0.9);
}
</style>
</head>
<body>
<div id="content">
<svg id="logo" viewBox="0 0 614 340"><path d="M163.296 240c10.2 0 18.9 3.598 26 10.694 7.09 7.096 10.69 15.796 10.69 26.001v63.293h-21.09v-31.4h-57.809v31.4H99.9v-63.293c0-10.105 3.597-18.805 10.693-25.901C117.789 243.598 126.488 240 136.59 240h26.706zm64.79 0v.2h38.11c7.7 0 14.2 1.799 19.7 5.497 7.1 4.697 11.39 11.193 12.69 19.492.4 2.402.6 5.303.6 8.804 0 2.902-.1 5.403-.2 7.604-.5 8.003-3.7 14.699-9.79 19.995 5.69 6.896 8.59 14.717 8.59 23.647v14.749h-21.19v-14.8c0-4.3-1.5-7.9-4.5-10.9-3-3.1-6.6-4.6-10.9-4.6h-33.11v30.3h-21.09V240h21.09zm-206.999 0v.2h38.109c7.702 0 14.202 1.799 19.699 5.497 8.095 5.497 12.492 13.092 13.092 22.796.5 7.705-1.799 14.505-6.695 20.401 5.896 6.197 8.595 13.595 8.095 22.201-.6 9.804-4.897 17.499-12.992 22.996-5.597 3.798-12.196 5.697-19.798 5.697h-39.51v.2H0V240h21.087zm39.51 78.7c3.101 0 5.701-.7 7.802-2.001 2.4-1.501 3.701-3.703 3.801-6.705.199-3.302-.901-5.904-3.301-7.605-2.101-1.501-4.801-2.201-8.302-2.201h-39.51V318.7h39.51zm205.599-30.2c6.7 0 10.5-2.501 11.5-7.603.3-1.401.4-3.702.4-6.904 0-2.701-.2-4.702-.5-6.002-1.2-4.502-5-6.703-11.4-6.703h-38.11V288.5h38.11zm-87.3-1.1v-10.705c0-4.302-1.5-7.904-4.6-10.905-3.098-3.102-6.699-4.602-11-4.602H136.59c-4.301 0-7.901 1.5-11.002 4.602-3.001 3.001-4.501 6.603-4.501 10.905V287.4h57.809zm-119.7-8.4c3.401 0 6.102-.7 8.202-2.101 2.501-1.601 3.601-4.003 3.402-7.305-.301-5.504-4.102-8.306-11.604-8.306H21.087V279h38.109zm175.89-159v.2h38.11c7.7 0 14.2 1.799 19.7 5.497 7.1 4.697 11.39 11.193 12.69 19.492.4 2.402.6 5.303.6 8.804 0 2.902-.1 5.403-.2 7.604-.5 8.003-3.7 14.699-9.79 19.995 5.69 6.896 8.59 14.717 8.59 23.647v14.749h-21.19v-14.8c0-4.3-1.5-7.9-4.5-10.9-3-3.1-6.6-4.6-10.9-4.6h-33.11v30.3h-21.09V120h21.09zm141.01 0c10.2 0 18.9 3.598 26 10.694 7.09 7.096 10.69 15.794 10.69 25.994v63.3h-21.09v-63.3c0-4.3-1.5-7.9-4.6-10.9-3.1-3.1-6.7-4.6-11-4.6h-26.71c-4.3 0-7.9 1.5-11 4.6-3 3-4.5 6.6-4.5 10.9v63.3h-21.19v-63.3c0-10.2 3.6-18.898 10.7-25.994 7.09-7.096 15.79-10.694 25.99-10.694h26.71zm166.69 0v.2h38.11c7.7 0 14.2 1.799 19.7 5.497 7.1 4.697 11.39 11.193 12.69 19.492.4 2.402.6 5.303.6 8.804 0 2.902-.1 5.403-.2 7.604-.5 8.003-3.7 14.699-9.79 19.995 5.69 6.896 8.59 14.717 8.59 23.647v14.749h-21.19v-14.8c0-4.3-1.5-7.9-4.5-10.9-3-3.1-6.6-4.6-10.9-4.6h-33.11v30.3h-21.09V120h21.09zm-372.39 0c10.1 0 18.8 3.598 25.9 10.694 7.09 7.096 10.69 15.795 10.69 25.897v26.806c0 10.102-3.6 18.801-10.69 25.897-7.1 7.096-15.8 10.694-25.9 10.694H143.59c-10.102 0-18.801-3.598-25.897-10.694-7.096-7.096-10.693-15.795-10.693-25.897v-26.806c0-10.102 3.597-18.801 10.693-25.897S133.488 120 143.59 120h26.806zm-107 0c10.102 0 18.802 3.598 25.897 10.694 7.096 7.096 10.694 15.795 10.694 25.897H78.8c0-4.201-1.501-7.802-4.602-10.802-3-3.101-6.601-4.601-10.802-4.601H36.59c-4.201 0-7.801 1.5-10.902 4.601-3.001 3-4.501 6.601-4.501 10.802v26.806c0 4.201 1.5 7.801 4.501 10.902 3.101 3.001 6.701 4.501 10.902 4.501h26.806c4.201 0 7.802-1.5 10.802-4.501 3.101-3.1 4.602-6.701 4.602-10.902h21.187c0 10.102-3.598 18.801-10.694 25.897-7.095 7.096-15.795 10.694-25.897 10.694H36.59c-10.102 0-18.801-3.598-25.897-10.694C3.597 202.198 0 193.499 0 183.397v-26.806c0-10.102 3.597-18.801 10.693-25.897S26.488 120 36.59 120h26.806zm417.59 0c7.4 0 14.2 2.099 20.4 6.196 6.2 4.098 10.7 9.495 13.6 16.392l-19.6 8.306c-2.4-5.904-8-9.606-14.4-9.606h-26.9c-5.5 0-9.4 2.001-11.7 5.904-.9 1.501-1.3 3.002-1.3 4.503 0 4.103 3.3 6.604 9.8 7.305 1.8.2 4.4.3 7.8.3.2 0 1 0 2.3-.1h6.2v.3h.4l-.2 10.494.2 10.494h-.4v.3h-2.5l-7.2-.1c-4.7 0-8.1.3-10.2.9-4.1 1.101-6.2 3.302-6.2 6.705 0 3.502 1.7 6.304 5.1 8.306 2.4 1.401 5 2.101 7.9 2.101h26.9c6.4 0 12-3.703 14.4-9.607l19.6 8.306c-2.9 6.898-7.4 12.295-13.6 16.392-6.2 4.098-13 6.197-20.4 6.197h-26.9c-6.1 0-11.9-1.4-17.2-4.298-5.49-2.898-9.79-6.996-12.79-12.093-2.9-4.797-4.3-9.9-4.3-15.304 0-7.105 2.3-13.202 6.9-18.299-4.6-5.197-6.9-11.294-6.9-18.299 0-10.907 6.1-21.001 15.69-26.598 5.8-3.398 12-5.097 18.6-5.097h26.9zm-310.59 78.8c4.2 0 7.8-1.5 10.8-4.501 3.1-3.101 4.6-6.701 4.6-10.902v-26.806c0-4.201-1.5-7.802-4.6-10.802-3-3.101-6.6-4.601-10.8-4.601H143.59c-4.201 0-7.801 1.5-10.902 4.601-3.001 3-4.501 6.601-4.501 10.802v26.806c0 4.201 1.5 7.801 4.501 10.902 3.101 3.001 6.701 4.501 10.902 4.501h26.806zm102.8-30.3c6.7 0 10.5-2.501 11.5-7.603.3-1.401.4-3.702.4-6.904 0-2.701-.2-4.702-.5-6.002-1.2-4.502-5-6.703-11.4-6.703h-38.11V168.5h38.11zm307.7 0c6.7 0 10.5-2.501 11.5-7.603.3-1.401.4-3.702.4-6.904 0-2.701-.2-4.702-.5-6.002-1.2-4.502-5-6.703-11.4-6.703h-38.11V168.5h38.11zM75.587 0v20.988h-27.3v79H27.3v-79H0V0h75.587zm240.599 34.7h29.91c4.3 0 7.9-1.504 10.9-4.513 3.1-3.109 4.6-6.719 4.6-11.032V0h21.19v19.155c0 10.029-3.5 18.643-10.59 25.739 7.79 7.196 11.69 16.105 11.69 26.829v28.265h-21.09v-28.3c0-4.3-1.5-7.9-4.6-10.9-3-3.1-6.6-4.6-10.9-4.6h-31.11v43.8h-21.09V0h21.09v34.7zM144.296 0c10.202 0 18.902 3.598 25.997 10.694 7.093 7.096 10.693 15.796 10.693 26.001v63.293H159.9v-31.4h-57.813v31.4H80.9V36.695c0-10.105 3.597-18.805 10.693-25.901C98.789 3.598 107.488 0 117.59 0h26.706zm107.1 0c10.2 0 18.9 3.598 26 10.694 7.09 7.096 10.69 15.794 10.69 25.994v63.3h-21.09v-63.3c0-4.3-1.5-7.9-4.6-10.9-3.1-3.1-6.7-4.6-11-4.6h-26.71c-4.3 0-7.9 1.5-11 4.6-3 3-4.5 6.6-4.5 10.9v63.3h-21.19v-63.3c0-10.2 3.6-18.898 10.7-25.994C205.786 3.598 214.486 0 224.686 0h26.71zm234.4 0c7.4 0 14.2 2.099 20.4 6.196 6.2 4.098 10.69 9.495 13.59 16.392l-19.59 8.406c-2.4-5.904-8-9.606-14.4-9.606h-27.11c-5.5 0-9.4 2.001-11.7 5.904-.9 1.501-1.3 3.002-1.3 4.503 0 4.203 3.4 6.705 10.2 7.405.7.1 5.2.1 13.51.1h3.2c.5-.1.9-.1 1.4-.1 10.1-.3 17.8.2 23 1.399 8.4 1.899 14.7 5.797 18.89 11.893 3.2 4.698 4.8 9.897 4.8 15.701 0 10.907-6.19 21.101-15.79 26.698-5.8 3.398-12 5.097-18.6 5.097h-30.61c-7.4 0-14.2-2.099-20.49-6.197-6.2-4.097-10.7-9.594-13.6-16.392l19.59-8.406c2.5 5.905 8.1 9.607 14.5 9.607h30.61c5.5 0 9.4-2.001 11.7-5.904.9-1.501 1.3-3.002 1.3-4.503 0-4.303-3.6-6.705-10.7-7.405-4.1-.4-8.8-.5-14.1-.2l-2.2.1h-2.4c-9.91.3-17.41-.2-22.51-1.4-8.09-1.898-14.19-5.796-18.29-11.893-3.2-4.597-4.8-9.796-4.8-15.6 0-10.907 6.2-21.001 15.79-26.698 5.7-3.398 11.9-5.097 18.6-5.097h27.11zM159.9 47.4V36.695c0-4.302-1.501-7.904-4.602-10.905-3.1-3.102-6.701-4.602-11.002-4.602H117.59c-4.301 0-7.901 1.5-11.002 4.602-3.001 3.001-4.501 6.603-4.501 10.905V47.4H159.9zM414.056.009v30.264h-21.26V.009h21.26z"/></svg>
<p>How much would you like to donate?</p>
<table id="money" cellspacing="20">
<tr>
<td class="price-button" data-amount="50"><svg class="icon" viewBox="0 0 576 576"><path d="M416.2 416.7c-13.8 25.4-33.3 46.4-56.9 61.6-13.4 8.7-28.2 15.5-44 20.2-43.5 12.9-89.3 8.1-129.2-13.5-39.8-21.6-68.9-57.4-81.8-100.9s-8.1-89.3 13.5-129.2c13.8-25.4 33.3-46.4 56.9-61.6 7.7-4.9 15.8-9.3 24.2-12.9l.8 256.8c11.8 7.1 24.8 12.5 38.5 15.9l-1.1-282.6c14.6-1.2 34.9-1.9 57-2.2l1.2 286.6c13.4-2.4 26.2-6.7 38-12.7l-.4-274.2c41.7 0 81.4.7 94.1.7l8.1-37.4c-16.8 0-58.6-.9-102.2-1l-.1-63.9 178-1.2 8.6-38.2-225.6 1.5.4 102c-21.2.3-41.2.8-57 2l-.4-104.1-38.3.6.4 110.3c-49.2 17-89.7 51.3-114.6 97.3-26.5 48.8-32.4 105-16.5 158.3C83.6 448.1 119.2 492 168 518.5c48.8 26.5 105 32.4 158.3 16.5 19.3-5.7 37.4-14.1 53.9-24.7 28.9-18.7 52.9-44.4 69.8-75.5 8.6-15.9 15.1-32.6 19.3-49.7-12.5-2.7-24.9-5.4-37.4-8.1-3.7 13.7-8.9 27-15.7 39.7z"/></svg> 50</td>
<td class="price-button" data-amount="100"><svg class="icon" viewBox="0 0 576 576"><path d="M416.2 416.7c-13.8 25.4-33.3 46.4-56.9 61.6-13.4 8.7-28.2 15.5-44 20.2-43.5 12.9-89.3 8.1-129.2-13.5-39.8-21.6-68.9-57.4-81.8-100.9s-8.1-89.3 13.5-129.2c13.8-25.4 33.3-46.4 56.9-61.6 7.7-4.9 15.8-9.3 24.2-12.9l.8 256.8c11.8 7.1 24.8 12.5 38.5 15.9l-1.1-282.6c14.6-1.2 34.9-1.9 57-2.2l1.2 286.6c13.4-2.4 26.2-6.7 38-12.7l-.4-274.2c41.7 0 81.4.7 94.1.7l8.1-37.4c-16.8 0-58.6-.9-102.2-1l-.1-63.9 178-1.2 8.6-38.2-225.6 1.5.4 102c-21.2.3-41.2.8-57 2l-.4-104.1-38.3.6.4 110.3c-49.2 17-89.7 51.3-114.6 97.3-26.5 48.8-32.4 105-16.5 158.3C83.6 448.1 119.2 492 168 518.5c48.8 26.5 105 32.4 158.3 16.5 19.3-5.7 37.4-14.1 53.9-24.7 28.9-18.7 52.9-44.4 69.8-75.5 8.6-15.9 15.1-32.6 19.3-49.7-12.5-2.7-24.9-5.4-37.4-8.1-3.7 13.7-8.9 27-15.7 39.7z"/></svg> 100</td>
</tr>
<tr>
<td class="price-button" data-amount="200"><svg class="icon" viewBox="0 0 576 576"><path d="M416.2 416.7c-13.8 25.4-33.3 46.4-56.9 61.6-13.4 8.7-28.2 15.5-44 20.2-43.5 12.9-89.3 8.1-129.2-13.5-39.8-21.6-68.9-57.4-81.8-100.9s-8.1-89.3 13.5-129.2c13.8-25.4 33.3-46.4 56.9-61.6 7.7-4.9 15.8-9.3 24.2-12.9l.8 256.8c11.8 7.1 24.8 12.5 38.5 15.9l-1.1-282.6c14.6-1.2 34.9-1.9 57-2.2l1.2 286.6c13.4-2.4 26.2-6.7 38-12.7l-.4-274.2c41.7 0 81.4.7 94.1.7l8.1-37.4c-16.8 0-58.6-.9-102.2-1l-.1-63.9 178-1.2 8.6-38.2-225.6 1.5.4 102c-21.2.3-41.2.8-57 2l-.4-104.1-38.3.6.4 110.3c-49.2 17-89.7 51.3-114.6 97.3-26.5 48.8-32.4 105-16.5 158.3C83.6 448.1 119.2 492 168 518.5c48.8 26.5 105 32.4 158.3 16.5 19.3-5.7 37.4-14.1 53.9-24.7 28.9-18.7 52.9-44.4 69.8-75.5 8.6-15.9 15.1-32.6 19.3-49.7-12.5-2.7-24.9-5.4-37.4-8.1-3.7 13.7-8.9 27-15.7 39.7z"/></svg> 200</td>
<td class="price-button" data-amount="500"><svg class="icon" viewBox="0 0 576 576"><path d="M416.2 416.7c-13.8 25.4-33.3 46.4-56.9 61.6-13.4 8.7-28.2 15.5-44 20.2-43.5 12.9-89.3 8.1-129.2-13.5-39.8-21.6-68.9-57.4-81.8-100.9s-8.1-89.3 13.5-129.2c13.8-25.4 33.3-46.4 56.9-61.6 7.7-4.9 15.8-9.3 24.2-12.9l.8 256.8c11.8 7.1 24.8 12.5 38.5 15.9l-1.1-282.6c14.6-1.2 34.9-1.9 57-2.2l1.2 286.6c13.4-2.4 26.2-6.7 38-12.7l-.4-274.2c41.7 0 81.4.7 94.1.7l8.1-37.4c-16.8 0-58.6-.9-102.2-1l-.1-63.9 178-1.2 8.6-38.2-225.6 1.5.4 102c-21.2.3-41.2.8-57 2l-.4-104.1-38.3.6.4 110.3c-49.2 17-89.7 51.3-114.6 97.3-26.5 48.8-32.4 105-16.5 158.3C83.6 448.1 119.2 492 168 518.5c48.8 26.5 105 32.4 158.3 16.5 19.3-5.7 37.4-14.1 53.9-24.7 28.9-18.7 52.9-44.4 69.8-75.5 8.6-15.9 15.1-32.6 19.3-49.7-12.5-2.7-24.9-5.4-37.4-8.1-3.7 13.7-8.9 27-15.7 39.7z"/></svg> 500</td>
</tr>
</table>
<input id="price-input" type="number" name="amount" placeholder="Custom amount">
<textarea id="message" style="margin-top: 20px;">Ermagherd!! I love you SO MUCH Tank!</textarea>
<button id="submit" style="margin-top: 40px;">Send Tank the tip!</button>
</div>
<script type="text/javascript">
var currentAmount = 0;
var priceButtons = [];
function resetPriceButtons() {
priceButtons.forEach(priceButton=>priceButton.className="");
}
document.querySelectorAll(".price-button").forEach(priceButton=>{
priceButtons.push(priceButton);
priceButton.addEventListener("click", e=>{
priceInput.value = "";
priceInput.className = "";
resetPriceButtons();
priceButton.className = "active";
currentAmount = parseInt(priceButton.getAttribute("data-amount"));
});
});
var priceInput = document.getElementById("price-input");
priceInput.addEventListener("keyup", e=>{
resetPriceButtons();
if (e.srcElement.value>0) {
e.srcElement.className = "active";
currentAmount = parseInt(e.srcElement.value);
} else {
e.srcElement.className = "";
currentAmount = 0;
}
});
var messageInput = document.getElementById("message");
messageInput.addEventListener("keyup", e=>{
if (e.srcElement.value.length>72)
e.srcElement.value = e.srcElement.value.substring(0, 72);
})
var _GET = {};
if (window.location.search.length>1) {
window.location.search.substr(1).split("&").forEach(p=>{
p = p.split("=");
_GET[p[0]] = p[1];
});
}
var uuid = decodeURI(_GET.uuid);
document.getElementById("submit").addEventListener("click", e=>{
if (currentAmount<=0) return;
if (window.qt) {
EventBridge.emitWebEvent(JSON.stringify({
uuid: uuid,
amount: currentAmount,
message: messageInput.value.substring(0, 72),
}));
}
});
</script>
</body>
</html>