flask-Humanify 0.1.4__py3-none-any.whl → 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,208 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Verify you're human</title>
7
+ <style>
8
+ body {
9
+ font-family: system-ui, sans-serif;
10
+ background: #f2f2f2;
11
+ color: #181818;
12
+ margin: 0;
13
+ line-height: 1.5;
14
+ text-align: center;
15
+ display: grid;
16
+ place-items: center;
17
+ height: 100vh;
18
+ padding: 0 20px;
19
+ }
20
+
21
+ @media (prefers-color-scheme: dark) {
22
+ body {
23
+ background: #121212;
24
+ color: #f2f2f2;
25
+ }
26
+ }
27
+
28
+ .content {
29
+ max-width: 600px;
30
+ display: flex;
31
+ flex-direction: column;
32
+ align-items: center;
33
+ }
34
+
35
+ h1 {
36
+ font-size: 22px;
37
+ margin: 15px 0;
38
+ }
39
+
40
+ p {
41
+ margin: 15px 0;
42
+ opacity: 0.8;
43
+ }
44
+
45
+ .text-container {
46
+ text-align: center;
47
+ margin-bottom: 25px;
48
+ }
49
+
50
+ .error {
51
+ color: #e53935;
52
+ margin: 10px 0;
53
+ font-size: 16px;
54
+ }
55
+
56
+ form {
57
+ display: flex;
58
+ flex-direction: column;
59
+ align-items: center;
60
+ width: 100%;
61
+ max-width: 450px;
62
+ }
63
+
64
+ .audio-container {
65
+ width: 100%;
66
+ margin-bottom: 25px;
67
+ display: flex;
68
+ flex-direction: column;
69
+ align-items: center;
70
+ padding: 20px;
71
+ }
72
+
73
+ .audio-player {
74
+ width: 100%;
75
+ margin-bottom: 20px;
76
+ height: 40px;
77
+ }
78
+
79
+ .input-field {
80
+ width: 100%;
81
+ padding: 12px;
82
+ margin-bottom: 10px;
83
+ border: 2px solid rgba(74, 110, 208, 0.3);
84
+ border-radius: 6px;
85
+ font-size: 16px;
86
+ background-color: #ffffff;
87
+ color: #181818;
88
+ transition: all 0.2s ease;
89
+ }
90
+
91
+ @media (prefers-color-scheme: dark) {
92
+ .input-field {
93
+ background-color: #242424;
94
+ color: #f2f2f2;
95
+ border-color: rgba(74, 110, 208, 0.5);
96
+ }
97
+ }
98
+
99
+ .input-field:focus {
100
+ border-color: #4a6ed0;
101
+ outline: none;
102
+ box-shadow: 0 0 0 3px rgba(74, 110, 208, 0.3);
103
+ }
104
+
105
+ .submit-button {
106
+ padding: 12px 24px;
107
+ background-color: #4a6ed0;
108
+ color: white;
109
+ border: none;
110
+ border-radius: 6px;
111
+ cursor: pointer;
112
+ font-weight: 500;
113
+ transition: all 0.2s ease;
114
+ width: 100%;
115
+ max-width: 250px;
116
+ font-size: 16px;
117
+ margin-bottom: 15px;
118
+ }
119
+
120
+ .submit-button:hover {
121
+ background-color: #3a5ec0;
122
+ transform: translateY(-2px);
123
+ }
124
+
125
+ .image-challenge-link {
126
+ display: flex;
127
+ align-items: center;
128
+ justify-content: center;
129
+ margin-top: 15px;
130
+ color: #4a6ed0;
131
+ text-decoration: none;
132
+ font-size: 14px;
133
+ transition: all 0.2s ease;
134
+ }
135
+
136
+ .image-challenge-link:hover {
137
+ transform: translateY(-2px);
138
+ }
139
+
140
+ .image-challenge-link svg {
141
+ margin-right: 6px;
142
+ width: 16px;
143
+ height: 16px;
144
+ fill: currentColor;
145
+ }
146
+
147
+ @media (max-width: 600px) {
148
+ .audio-container {
149
+ padding: 15px;
150
+ }
151
+
152
+ .input-field {
153
+ font-size: 15px;
154
+ }
155
+ }
156
+
157
+ @media (max-width: 400px) {
158
+ form {
159
+ max-width: 300px;
160
+ }
161
+ }
162
+ </style>
163
+ </head>
164
+ <body>
165
+ <div class="content">
166
+ <div class="text-container">
167
+ <h1>Verify you're human</h1>
168
+ <p>Listen to the audio and type what you hear.</p>
169
+ {% if error %}
170
+ <p class="error">{{ error }}</p>
171
+ {% endif %}
172
+ </div>
173
+
174
+ <form action="{{ url_for('humanify.verify_audio') }}" method="POST">
175
+ <div class="audio-container">
176
+ <audio class="audio-player" controls autoplay>
177
+ <source src="{{ audio_file }}" type="audio/mpeg" />
178
+ Your browser does not support the audio element.
179
+ </audio>
180
+ <input
181
+ type="text"
182
+ class="input-field"
183
+ name="audio_response"
184
+ placeholder="Enter what you hear"
185
+ required
186
+ autocomplete="off"
187
+ autofocus
188
+ />
189
+ </div>
190
+ <input type="hidden" name="return_url" value="{{ return_url }}" />
191
+ <input type="hidden" name="captcha_data" value="{{ captcha_data }}" />
192
+ <button type="submit" class="submit-button">Verify</button>
193
+ </form>
194
+
195
+ {% if image_challenge_available %}
196
+ <a
197
+ class="image-challenge-link"
198
+ href="{{ url_for('humanify.challenge', return_url=return_url) }}"
199
+ >
200
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
201
+ <path d="M96 416q-14 0-23-9t-9-23V128q0-14 9-23t23-9h320q14 0 23 9t9 23v256q0 14-9 23t-23 9zm88-176q20 0 34-14t14-34-14-34-34-14-34 14-14 34 14 34 34 14m216 128v-64l-64-64-96 96-56-57-88 89z"/>
202
+ </svg>
203
+ Image challenge
204
+ </a>
205
+ {% endif %}
206
+ </div>
207
+ </body>
208
+ </html>
@@ -0,0 +1,232 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Verify you're human</title>
7
+ <style>
8
+ body {
9
+ font-family: system-ui, sans-serif;
10
+ background: #f2f2f2;
11
+ color: #181818;
12
+ margin: 0;
13
+ line-height: 1.5;
14
+ text-align: center;
15
+ display: grid;
16
+ place-items: center;
17
+ height: 100vh;
18
+ padding: 0 20px;
19
+ }
20
+
21
+ @media (prefers-color-scheme: dark) {
22
+ body {
23
+ background: #121212;
24
+ color: #f2f2f2;
25
+ }
26
+ }
27
+
28
+ .content {
29
+ max-width: 600px;
30
+ display: flex;
31
+ flex-direction: column;
32
+ align-items: center;
33
+ }
34
+
35
+ h1 {
36
+ font-size: 22px;
37
+ margin: 15px 0;
38
+ }
39
+
40
+ p {
41
+ margin: 15px 0;
42
+ opacity: 0.8;
43
+ }
44
+
45
+ .text-container {
46
+ text-align: center;
47
+ margin-bottom: 25px;
48
+ }
49
+
50
+ .error {
51
+ color: #e53935;
52
+ margin: 10px 0;
53
+ font-size: 16px;
54
+ }
55
+
56
+ form {
57
+ display: flex;
58
+ flex-direction: column;
59
+ align-items: center;
60
+ width: 100%;
61
+ }
62
+
63
+ .grid {
64
+ display: grid;
65
+ grid-template-columns: repeat(3, 1fr);
66
+ grid-gap: 15px;
67
+ width: 100%;
68
+ margin-bottom: 25px;
69
+ max-width: 450px;
70
+ }
71
+
72
+ .image-container {
73
+ position: relative;
74
+ transition: transform 0.2s ease;
75
+ border-radius: 8px;
76
+ overflow: hidden;
77
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
78
+ aspect-ratio: 1;
79
+ }
80
+
81
+ .image-container:hover {
82
+ transform: translateY(-3px);
83
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
84
+ }
85
+
86
+ .image-container img {
87
+ width: 100%;
88
+ height: 100%;
89
+ object-fit: cover;
90
+ display: block;
91
+ }
92
+
93
+ .custom-checkbox {
94
+ position: absolute;
95
+ bottom: 8px;
96
+ right: 8px;
97
+ appearance: none;
98
+ width: 22px;
99
+ height: 22px;
100
+ border: 2px solid #ffffff;
101
+ border-radius: 4px;
102
+ background-color: rgba(255, 255, 255, 0.7);
103
+ cursor: pointer;
104
+ transition: all 0.2s ease;
105
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
106
+ }
107
+
108
+ .custom-checkbox:checked {
109
+ background-color: #4a6ed0;
110
+ border-color: #4a6ed0;
111
+ }
112
+
113
+ .custom-checkbox:checked::before {
114
+ content: '✓';
115
+ position: absolute;
116
+ color: white;
117
+ font-size: 14px;
118
+ top: 50%;
119
+ left: 50%;
120
+ transform: translate(-50%, -50%);
121
+ }
122
+
123
+ .submit-button {
124
+ padding: 12px 24px;
125
+ background-color: #4a6ed0;
126
+ color: white;
127
+ border: none;
128
+ border-radius: 6px;
129
+ cursor: pointer;
130
+ font-weight: 500;
131
+ transition: all 0.2s ease;
132
+ width: 100%;
133
+ max-width: 250px;
134
+ font-size: 16px;
135
+ margin-bottom: 15px;
136
+ }
137
+
138
+ .submit-button:hover {
139
+ background-color: #3a5ec0;
140
+ transform: translateY(-2px);
141
+ }
142
+
143
+ .audio-challenge-link {
144
+ display: flex;
145
+ align-items: center;
146
+ justify-content: center;
147
+ margin-top: 15px;
148
+ color: #4a6ed0;
149
+ text-decoration: none;
150
+ font-size: 14px;
151
+ transition: all 0.2s ease;
152
+ }
153
+
154
+ .audio-challenge-link:hover {
155
+ transform: translateY(-2px);
156
+ }
157
+
158
+ .audio-challenge-link svg {
159
+ margin-right: 6px;
160
+ width: 16px;
161
+ height: 16px;
162
+ fill: currentColor;
163
+ }
164
+
165
+ @media (max-width: 600px) {
166
+ .grid {
167
+ grid-gap: 10px;
168
+ max-width: 350px;
169
+ }
170
+
171
+ .custom-checkbox {
172
+ width: 20px;
173
+ height: 20px;
174
+ bottom: 6px;
175
+ right: 6px;
176
+ }
177
+ }
178
+
179
+ @media (max-width: 400px) {
180
+ .grid {
181
+ grid-gap: 8px;
182
+ max-width: 300px;
183
+ }
184
+ }
185
+ </style>
186
+ </head>
187
+ <body>
188
+ <div class="content">
189
+ <div class="text-container">
190
+ <h1>Verify you're human</h1>
191
+ <p>Select all images that contain a <strong>{{ subject }}</strong>.</p>
192
+ {% if error %}
193
+ <p class="error">{{ error }}</p>
194
+ {% endif %}
195
+ </div>
196
+
197
+ <form action="{{ url_for('humanify.verify') }}" method="POST">
198
+ <div class="grid">
199
+ {% for image in images %}
200
+ <div class="image-container">
201
+ <img src="{{ image }}" alt="Verification image {{ loop.index }}" />
202
+ <input
203
+ type="checkbox"
204
+ class="custom-checkbox"
205
+ id="check{{ loop.index }}"
206
+ name="{{ loop.index }}"
207
+ value="1"
208
+ />
209
+ </div>
210
+ {% endfor %}
211
+ </div>
212
+ <input type="hidden" name="return_url" value="{{ return_url }}" />
213
+ <input type="hidden" name="captcha_data" value="{{ captcha_data }}" />
214
+ <button type="submit" class="submit-button">Verify</button>
215
+ </form>
216
+
217
+ {% if audio_challenge_available %}
218
+ <a
219
+ class="audio-challenge-link"
220
+ href="{{ url_for('humanify.audio_challenge', return_url=return_url) }}"
221
+ >
222
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
223
+ <path
224
+ d="M128 448q-26 0-45-19t-19-45V256q0-50 26-96 26-45 71-70 44-26 95-26 52 0 96 26 45 26 71 71 25 44 25 95v128q0 26-19 45t-45 19h-64V288h80v-32q0-38-19-72-20-33-53-52-33-20-72-20-40 0-72 19-33 20-52 53-20 33-20 72v32h80v160z"
225
+ />
226
+ </svg>
227
+ Audio challenge
228
+ </a>
229
+ {% endif %}
230
+ </div>
231
+ </body>
232
+ </html>
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Verify Human</title>
6
+ <title>Verify you're human</title>
7
7
  <style>
8
8
  body {
9
9
  font-family: system-ui, sans-serif;
@@ -30,17 +30,12 @@
30
30
  }
31
31
 
32
32
  .content {
33
- max-width: 600px;
33
+ max-width: 800px;
34
34
  display: flex;
35
35
  flex-direction: column;
36
36
  align-items: center;
37
37
  }
38
38
 
39
- .emoji {
40
- font-size: 48px;
41
- margin-bottom: 10px;
42
- }
43
-
44
39
  h1 {
45
40
  font-size: 22px;
46
41
  margin: 15px 0;
@@ -187,9 +182,9 @@
187
182
  class="audio-challenge-link"
188
183
  href="{{ url_for('humanify.audio_challenge', return_url=return_url) }}"
189
184
  >
190
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
185
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
191
186
  <path
192
- d="M10 1a1 1 0 0 1 1 1v13.59l1.29-1.29a1 1 0 1 1 1.42 1.42l-3 3a1 1 0 0 1-1.42 0l-3-3a1 1 0 0 1 1.42-1.42L9 15.59V2a1 1 0 0 1 1-1zm2-1a1 1 0 1 1 0 2 5 5 0 0 0-5 5 1 1 0 1 1-2 0 7 7 0 0 1 7-7zm2 3a1 1 0 1 1 0 2 3 3 0 0 0-3 3 1 1 0 1 1-2 0 5 5 0 0 1 5-5z"
187
+ d="M128 448q-26 0-45-19t-19-45V256q0-50 26-96 26-45 71-70 44-26 95-26 52 0 96 26 45 26 71 71 25 44 25 95v128q0 26-19 45t-45 19h-64V288h80v-32q0-38-19-72-20-33-53-52-33-20-72-20-40 0-72 19-33 20-52 53-20 33-20 72v32h80v160z"
193
188
  />
194
189
  </svg>
195
190
  Audio challenge