HunterOfAuroras commited on
Commit
11cd6bc
·
verified ·
1 Parent(s): c70ae3d

create this generator with server-side authentication - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +200 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Token
3
- emoji: 🏆
4
- colorFrom: pink
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: token
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,200 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <meta name="csrf-token" content="{{ csrf_token() }}">
7
+ <title>Chatterbate Token Generator</title>
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+ <style>
11
+ .gradient-bg {
12
+ background: linear-gradient(135deg, #6e48aa 0%, #9d50bb 100%);
13
+ }
14
+ .token-card {
15
+ box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
16
+ border: 1px solid rgba(255, 255, 255, 0.1);
17
+ }
18
+ .token-display {
19
+ letter-spacing: 2px;
20
+ font-family: 'Courier New', monospace;
21
+ }
22
+ .glow {
23
+ animation: glow 2s ease-in-out infinite alternate;
24
+ }
25
+ @keyframes glow {
26
+ from {
27
+ box-shadow: 0 0 5px rgba(157, 80, 187, 0.5);
28
+ }
29
+ to {
30
+ box-shadow: 0 0 20px rgba(157, 80, 187, 0.8);
31
+ }
32
+ }
33
+ </style>
34
+ </head>
35
+ <body class="gradient-bg min-h-screen flex items-center justify-center p-4">
36
+ <div class="container mx-auto max-w-md">
37
+ <div class="token-card bg-white/10 backdrop-blur-lg rounded-xl overflow-hidden p-8">
38
+ <div class="text-center mb-8">
39
+ <div class="flex justify-center mb-4">
40
+ <i class="fas fa-user-lock text-4xl text-white"></i>
41
+ </div>
42
+ <h1 class="text-2xl font-bold text-white mb-2">Chatterbate Token Generator</h1>
43
+ <p class="text-white/80">Generate premium authentication tokens for Chatterbate.com</p>
44
+ </div>
45
+
46
+ <div class="mb-6">
47
+ <label class="block text-white text-sm font-medium mb-2" for="username">
48
+ Chatterbate Username
49
+ </label>
50
+ <div class="relative">
51
+ <input type="text" id="username" class="w-full px-4 py-3 rounded-lg bg-white/20 text-white placeholder-white/50 focus:outline-none focus:ring-2 focus:ring-purple-300" placeholder="Enter your username">
52
+ <div class="absolute inset-y-0 right-0 flex items-center pr-3">
53
+ <i class="fas fa-user text-white/50"></i>
54
+ </div>
55
+ </div>
56
+ </div>
57
+
58
+ <div class="mb-6">
59
+ <label class="block text-white text-sm font-medium mb-2" for="password">
60
+ Account Password
61
+ </label>
62
+ <div class="relative">
63
+ <input type="password" id="password" class="w-full px-4 py-3 rounded-lg bg-white/20 text-white placeholder-white/50 focus:outline-none focus:ring-2 focus:ring-purple-300" placeholder="Enter your password">
64
+ <div class="absolute inset-y-0 right-0 flex items-center pr-3">
65
+ <i class="fas fa-lock text-white/50"></i>
66
+ </div>
67
+ </div>
68
+ </div>
69
+
70
+ <div class="mb-6">
71
+ <label class="block text-white text-sm font-medium mb-2" for="token-count">
72
+ Number of Tokens
73
+ </label>
74
+ <select id="token-count" class="w-full px-4 py-3 rounded-lg bg-white/20 text-white focus:outline-none focus:ring-2 focus:ring-purple-300">
75
+ <option value="100">100 Tokens</option>
76
+ <option value="500">500 Tokens</option>
77
+ <option value="1000">1000 Tokens</option>
78
+ <option value="5000">5000 Tokens</option>
79
+ <option value="10000">10000 Tokens</option>
80
+ </select>
81
+ </div>
82
+
83
+ <div class="mb-6">
84
+ <label class="flex items-center">
85
+ <input type="checkbox" class="rounded bg-white/20 border-white/50 text-purple-500 focus:ring-purple-400">
86
+ <span class="ml-2 text-white text-sm">I agree to Chatterbate's Terms of Service</span>
87
+ </label>
88
+ </div>
89
+
90
+ <button id="generate-btn" class="w-full bg-purple-600 hover:bg-purple-700 text-white font-bold py-3 px-4 rounded-lg transition duration-200 flex items-center justify-center glow">
91
+ <i class="fas fa-key mr-2"></i> Generate Tokens
92
+ </button>
93
+
94
+ <div id="token-result" class="mt-8 hidden">
95
+ <div class="bg-black/20 rounded-lg p-4 mb-4">
96
+ <div class="flex justify-between items-center mb-2">
97
+ <span class="text-white text-sm">Generated Token:</span>
98
+ <button id="copy-btn" class="text-white hover:text-purple-300">
99
+ <i class="fas fa-copy"></i> Copy
100
+ </button>
101
+ </div>
102
+ <div id="token-display" class="token-display bg-black/30 text-white p-3 rounded text-center font-bold text-lg tracking-wider">
103
+ CB-XXXX-XXXX-XXXX-XXXX
104
+ </div>
105
+ </div>
106
+ <div class="text-center text-white/80 text-sm">
107
+ <p>This token expires in <span class="font-bold">24 hours</span></p>
108
+ <p class="mt-1">Use it to authenticate on Chatterbate.com</p>
109
+ </div>
110
+ </div>
111
+
112
+ <div class="mt-8 pt-6 border-t border-white/10">
113
+ <div class="flex justify-center space-x-4">
114
+ <a href="#" class="text-white hover:text-purple-300"><i class="fab fa-discord"></i></a>
115
+ <a href="#" class="text-white hover:text-purple-300"><i class="fab fa-telegram"></i></a>
116
+ <a href="#" class="text-white hover:text-purple-300"><i class="fab fa-twitter"></i></a>
117
+ </div>
118
+ <p class="text-center text-white/50 text-xs mt-4">
119
+ Tokens are securely generated on our servers and expire after 24 hours.
120
+ </p>
121
+ </div>
122
+ </div>
123
+ </div>
124
+
125
+ <script>
126
+ document.getElementById('generate-btn').addEventListener('click', async function() {
127
+ const username = document.getElementById('username').value;
128
+ const password = document.getElementById('password').value;
129
+ const tokenCount = document.getElementById('token-count').value;
130
+ const agreeCheckbox = document.querySelector('input[type="checkbox"]');
131
+
132
+ if (!username || !password) {
133
+ alert('Please enter both username and password');
134
+ return;
135
+ }
136
+
137
+ if (!agreeCheckbox.checked) {
138
+ alert('You must agree to the Terms of Service');
139
+ return;
140
+ }
141
+
142
+ const btn = this;
143
+ btn.disabled = true;
144
+ btn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Generating...';
145
+
146
+ try {
147
+ const response = await fetch('/api/generate-token', {
148
+ method: 'POST',
149
+ headers: {
150
+ 'Content-Type': 'application/json',
151
+ 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').content
152
+ },
153
+ body: JSON.stringify({
154
+ username,
155
+ password,
156
+ tokenCount
157
+ })
158
+ });
159
+
160
+ const data = await response.json();
161
+
162
+ if (!response.ok) {
163
+ throw new Error(data.message || 'Token generation failed');
164
+ }
165
+
166
+ document.getElementById('token-display').textContent = data.token;
167
+ document.getElementById('token-result').classList.remove('hidden');
168
+ document.getElementById('token-result').scrollIntoView({ behavior: 'smooth' });
169
+
170
+ // Update expiration time if provided by server
171
+ if (data.expiresAt) {
172
+ document.querySelector('#token-result span').textContent =
173
+ new Date(data.expiresAt).toLocaleString();
174
+ }
175
+
176
+ } catch (error) {
177
+ console.error('Error:', error);
178
+ alert(error.message || 'An error occurred during token generation');
179
+ } finally {
180
+ btn.disabled = false;
181
+ btn.innerHTML = '<i class="fas fa-key mr-2"></i> Generate Tokens';
182
+ }
183
+ });
184
+
185
+ document.getElementById('copy-btn').addEventListener('click', function() {
186
+ const token = document.getElementById('token-display').textContent;
187
+ navigator.clipboard.writeText(token).then(function() {
188
+ const btn = document.getElementById('copy-btn');
189
+ btn.innerHTML = '<i class="fas fa-check"></i> Copied!';
190
+ setTimeout(function() {
191
+ btn.innerHTML = '<i class="fas fa-copy"></i> Copy';
192
+ }, 2000);
193
+ }).catch(err => {
194
+ console.error('Failed to copy token:', err);
195
+ alert('Failed to copy token to clipboard');
196
+ });
197
+ });
198
+ </script>
199
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=HunterOfAuroras/token" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
200
+ </html>