privateuserh commited on
Commit
d132547
·
verified ·
1 Parent(s): cea0011

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +113 -192
index.html CHANGED
@@ -11,228 +11,149 @@
11
  background-color: #f8f9fa;
12
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
13
  }
14
-
15
  .floating-panel {
16
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
17
  transition: all 0.3s ease;
18
- transform: translateY(0);
19
  }
20
-
21
- .floating-panel:hover {
22
- transform: translateY(-5px);
23
- }
24
-
25
- .floating-panel.hidden {
26
- transform: translateY(100px);
27
- }
28
-
29
  .gradient-text {
30
  background: linear-gradient(90deg, #3b82f6, #10b981);
31
  -webkit-background-clip: text;
32
  background-clip: text;
33
  color: transparent;
34
  }
 
 
 
 
 
 
35
  </style>
36
  </head>
37
  <body class="min-h-screen bg-gray-50 flex flex-col">
38
- <!-- Main Content -->
39
  <main class="flex-grow flex flex-col items-center justify-center p-4 text-center">
40
- <h1 class="text-1xl md:text-7xl font-bold mb-4 gradient-text">California Films Project</h1>
41
- <p class="text-x0.30 md:text-2xl text-gray-600">Film Tax Incentives / Benefits/ Blockchain Token Project</p>
42
- <p class="text-x0.10 md:text-2xl text-gray-600"> 1901 Avenue of the Stars / Silicon Beach</p>
43
- </main>
44
 
45
- <!-- Floating Button -->
46
  <div class="fixed bottom-6 right-6 z-50">
47
  <button id="togglePanel" class="bg-blue-600 hover:bg-blue-700 text-white w-16 h-16 rounded-full flex items-center justify-center shadow-lg transition-all duration-300 transform hover:scale-110">
48
  <i class="fas fa-id-card text-2xl"></i>
49
  </button>
50
  </div>
51
 
52
- <!-- Floating Panel -->
53
- <div id="floatingPanel" class="fixed bottom-24 right-6 w-80 bg-white rounded-xl shadow-xl p-6 hidden opacity-0 transition-all duration-300 transform translate-y-4 z-40">
54
- <div class="flex justify-between items-center mb-4">
55
- <h3 class="text-xl font-semibold text-gray-800">Indicate Your Interest</h3>
56
- <button id="closePanel" class="text-gray-500 hover:text-gray-700">
57
- <i class="fas fa-times"></i>
58
- </button>
59
- </div>
60
-
61
- <p class="text-gray-600 mb-4">Please complete this form to participate in the California Films Project. Your unique ID will serve as your placeholder.</p>
62
-
63
- <form id="interestForm" class="space-y-4">
64
- <div>
65
- <label for="name" class="block text-sm font-medium text-gray-700 mb-1">Full Name</label>
66
- <input type="text" id="name" name="name" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
67
- </div>
68
-
69
- <div>
70
- <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label>
71
- <input type="email" id="email" name="email" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
72
- </div>
73
-
74
- <div>
75
- <label class="block text-sm font-medium text-gray-700 mb-1">You are a:</label>
76
- <div class="mt-1 space-y-2">
77
- <div class="flex items-center">
78
- <input id="investor" name="role" type="radio" value="Investor" class="h-4 w-4 text-blue-600 focus:ring-blue-500" checked>
79
- <label for="investor" class="ml-2 block text-sm text-gray-700">Investor</label>
80
- </div>
81
- <div class="flex items-center">
82
- <input id="filmmaker" name="role" type="radio" value="Filmmaker" class="h-4 w-4 text-blue-600 focus:ring-blue-500">
83
- <label for="filmmaker" class="ml-2 block text-sm text-gray-700">Filmmaker</label>
84
- </div>
85
- </div>
86
- </div>
87
-
88
- <div>
89
- <button type="submit" class="w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-md transition duration-300 flex items-center justify-center">
90
- Generate Unique ID
91
- <i class="fas fa-arrow-right ml-2"></i>
92
  </button>
93
  </div>
94
- </form>
95
-
96
- <div id="successMessage" class="hidden mt-4 p-4 bg-green-50 rounded-md text-green-700">
97
- <div class="flex items-center">
98
- <i class="fas fa-check-circle mr-2"></i>
99
- <span>Your unique ID is: <span id="uniqueID" class="font-bold"></span></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  </div>
101
- <p class="mt-2 text-sm">We'll be in touch soon!</p>
 
 
 
 
102
  </div>
103
  </div>
104
-
105
- <meta charset="UTF-8">
106
-
107
- <h2>Submit Your Information</h2>
108
- <form id="dataForm">
109
- <label for="name">Name:</label><br>
110
- <input type="text" id="name" name="name" required><br><br>
111
-
112
- <label for="email">Email:</label><br>
113
- <input type="email" id="email" name="email" required><br><br>
114
-
115
- <input type="hidden" id="uniqueId" name="uniqueId">
116
- <button type="submit">Submit</button>
117
- </form>
118
-
119
- <p id="responseMessage"></p>
120
 
121
  <script>
122
- // PASTE YOUR WORKER URL HERE
123
- const WORKER_URL = 'https://contact-form-api.your-name.workers.dev';
124
-
125
- // Function to generate a simple unique ID
126
- function generateUniqueId() {
127
- return 'uid-' + Date.now() + '-' + Math.random().toString(36).substring(2, 9);
128
- }
129
-
130
- // Set the unique ID when the page loads
131
- document.getElementById('uniqueId').value = generateUniqueId();
132
-
133
- // Listen for the form submission
134
- document.getElementById('dataForm').addEventListener('submit', async (event) => {
135
- event.preventDefault(); // Stop the page from reloading
136
-
137
- const form = event.target;
138
- const name = form.elements.name.value;
139
- const email = form.elements.email.value;
140
- const uniqueId = form.elements.uniqueId.value;
141
- const messageElement = document.getElementById('responseMessage');
142
-
143
- messageElement.textContent = 'Submitting...'; // Provide feedback
144
-
145
- try {
146
- const response = await fetch(WORKER_URL, {
147
- method: 'POST',
148
- headers: {
149
- 'Content-Type': 'application/json',
150
- },
151
- body: JSON.stringify({ name, email, uniqueId }),
152
- });
153
-
154
- const responseText = await response.text();
155
- messageElement.textContent = responseText;
156
-
157
- if (response.ok) {
158
- form.reset(); // Clear the form on success
159
- document.getElementById('uniqueId').value = generateUniqueId(); // Set a new ID
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
161
- } catch (error) {
162
- messageElement.textContent = `A network error occurred. Please try again.`;
163
- }
164
  });
165
  </script>
166
 
167
- <script>
168
- // Panel toggle logic
169
- const togglePanel = document.getElementById('togglePanel');
170
- const floatingPanel = document.getElementById('floatingPanel');
171
- const closePanel = document.getElementById('closePanel');
172
-
173
- togglePanel.addEventListener('click', () => {
174
- floatingPanel.classList.toggle('hidden');
175
- floatingPanel.classList.toggle('opacity-0');
176
- floatingPanel.classList.toggle('translate-y-4');
177
- });
178
-
179
- closePanel.addEventListener('click', () => {
180
- floatingPanel.classList.add('hidden');
181
- floatingPanel.classList.add('opacity-0');
182
- floatingPanel.classList.add('translate-y-4');
183
- });
184
-
185
- // Form submission to Cloudflare D1
186
- const interestForm = document.getElementById('interestForm');
187
- const successMessage = document.getElementById('successMessage');
188
-
189
- interestForm.addEventListener('submit', async (e) => {
190
- e.preventDefault();
191
-
192
- const formData = {
193
- name: document.getElementById('name').value,
194
- email: document.getElementById('email').value,
195
- role: document.querySelector('input[name="role"]:checked').value,
196
- timestamp: new Date().toISOString()
197
- };
198
-
199
- // Generate a unique ID (for demo, in production this would come from D1)
200
- const uniqueId = 'CFP-' + Math.random().toString(36).substr(2, 8).toUpperCase();
201
-
202
- try {
203
- // In a real implementation, you would:
204
- // 1. Make a fetch request to your Cloudflare Worker
205
- // 2. The Worker would insert into D1 SQL database
206
- // 3. Return the unique ID from D1
207
-
208
- // Example fetch (commented out - replace with your actual endpoint)
209
- /*
210
- const response = await fetch('https://your-worker.your-subdomain.workers.dev/api/register', {
211
- method: 'POST',
212
- headers: {
213
- 'Content-Type': 'application/json',
214
- },
215
- body: JSON.stringify(formData),
216
- });
217
-
218
- if (!response.ok) throw new Error('Network response was not ok');
219
-
220
- const data = await response.json();
221
- const uniqueId = data.uniqueId;
222
- */
223
-
224
- // For this demo, we'll use the locally generated ID
225
- document.getElementById('uniqueID').textContent = uniqueId;
226
- interestForm.classList.add('hidden');
227
- successMessage.classList.remove('hidden');
228
-
229
- // You would also want to store the ID in localStorage or send it to the backend
230
-
231
- } catch (error) {
232
- console.error('Error:', error);
233
- alert('There was an error submitting your information. Please try again.');
234
- }
235
- });
236
- </script>
237
- <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=privateuserh/cfp2035" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
238
  </html>
 
11
  background-color: #f8f9fa;
12
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
13
  }
 
14
  .floating-panel {
15
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
16
  transition: all 0.3s ease;
 
17
  }
 
 
 
 
 
 
 
 
 
18
  .gradient-text {
19
  background: linear-gradient(90deg, #3b82f6, #10b981);
20
  -webkit-background-clip: text;
21
  background-clip: text;
22
  color: transparent;
23
  }
24
+ /* Style to handle the hidden state gracefully */
25
+ #floatingPanel.hidden {
26
+ opacity: 0;
27
+ transform: translateY(1rem);
28
+ pointer-events: none;
29
+ }
30
  </style>
31
  </head>
32
  <body class="min-h-screen bg-gray-50 flex flex-col">
33
+
34
  <main class="flex-grow flex flex-col items-center justify-center p-4 text-center">
35
+ <h1 class="text-4xl md:text-7xl font-bold mb-4 gradient-text">California Films Project</h1>
36
+ <p class="text-lg md:text-2xl text-gray-600">Film Tax Incentives / Benefits / Blockchain Token Project</p>
37
+ <p class="text-md md:text-xl text-gray-600 mt-2">1901 Avenue of the Stars / Silicon Beach</p>
38
+ </main>
39
 
 
40
  <div class="fixed bottom-6 right-6 z-50">
41
  <button id="togglePanel" class="bg-blue-600 hover:bg-blue-700 text-white w-16 h-16 rounded-full flex items-center justify-center shadow-lg transition-all duration-300 transform hover:scale-110">
42
  <i class="fas fa-id-card text-2xl"></i>
43
  </button>
44
  </div>
45
 
46
+ <div id="floatingPanel" class="fixed bottom-24 right-6 w-80 bg-white rounded-xl shadow-xl p-6 transition-all duration-300 hidden z-40">
47
+ <div id="formContainer">
48
+ <div class="flex justify-between items-center mb-4">
49
+ <h3 class="text-xl font-semibold text-gray-800">Indicate Your Interest</h3>
50
+ <button id="closePanel" class="text-gray-500 hover:text-gray-700">
51
+ <i class="fas fa-times"></i>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  </button>
53
  </div>
54
+ <p class="text-gray-600 mb-4 text-sm">Complete this form to participate. Your unique ID will serve as your placeholder.</p>
55
+ <form id="interestForm" class="space-y-4">
56
+ <div>
57
+ <label for="name" class="block text-sm font-medium text-gray-700 mb-1">Full Name</label>
58
+ <input type="text" id="name" name="name" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
59
+ </div>
60
+ <div>
61
+ <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label>
62
+ <input type="email" id="email" name="email" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
63
+ </div>
64
+ <div>
65
+ <button type="submit" id="submitButton" class="w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-md transition duration-300 flex items-center justify-center">
66
+ <span id="buttonText">Generate Unique ID</span>
67
+ <i id="buttonIcon" class="fas fa-arrow-right ml-2"></i>
68
+ </button>
69
+ </div>
70
+ </form>
71
+ </div>
72
+ <div id="successMessage" class="hidden text-center">
73
+ <div class="text-green-500">
74
+ <i class="fas fa-check-circle fa-3x"></i>
75
  </div>
76
+ <h4 class="text-lg font-semibold text-gray-800 mt-3">Success!</h4>
77
+ <p class="text-gray-600 mt-1">Your unique ID is:</p>
78
+ <p id="uniqueIDDisplay" class="font-bold text-lg text-gray-800 bg-gray-100 rounded-md py-2 mt-2"></p>
79
+ <p class="mt-3 text-sm text-gray-500">We'll be in touch soon!</p>
80
+ <button id="closeSuccess" class="mt-4 w-full text-sm text-gray-600 hover:text-gray-800">Close</button>
81
  </div>
82
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  <script>
85
+ document.addEventListener('DOMContentLoaded', () => {
86
+ // --- CONFIGURATION ---
87
+ const WORKER_URL = 'https://contact-form-api.aiagents.workers.dev/';
88
+
89
+ // --- ELEMENTS ---
90
+ const togglePanelBtn = document.getElementById('togglePanel');
91
+ const floatingPanel = document.getElementById('floatingPanel');
92
+ const closePanelBtn = document.getElementById('closePanel');
93
+ const interestForm = document.getElementById('interestForm');
94
+ const formContainer = document.getElementById('formContainer');
95
+ const successMessage = document.getElementById('successMessage');
96
+ const uniqueIDDisplay = document.getElementById('uniqueIDDisplay');
97
+ const closeSuccessBtn = document.getElementById('closeSuccess');
98
+ const submitButton = document.getElementById('submitButton');
99
+ const buttonText = document.getElementById('buttonText');
100
+
101
+ // --- FUNCTIONS ---
102
+ const showPanel = () => floatingPanel.classList.remove('hidden');
103
+ const hidePanel = () => floatingPanel.classList.add('hidden');
104
+
105
+ const generateUniqueId = () => 'CFP-' + Date.now().toString(36) + Math.random().toString(36).substring(2, 8).toUpperCase();
106
+
107
+ // --- EVENT LISTENERS ---
108
+ togglePanelBtn.addEventListener('click', showPanel);
109
+ closePanelBtn.addEventListener('click', hidePanel);
110
+ closeSuccessBtn.addEventListener('click', () => {
111
+ hidePanel();
112
+ // Reset form for next time
113
+ setTimeout(() => {
114
+ formContainer.classList.remove('hidden');
115
+ successMessage.classList.add('hidden');
116
+ interestForm.reset();
117
+ }, 300); // Wait for fade out
118
+ });
119
+
120
+ interestForm.addEventListener('submit', async (e) => {
121
+ e.preventDefault();
122
+ buttonText.textContent = 'Submitting...';
123
+ submitButton.disabled = true;
124
+
125
+ const uniqueId = generateUniqueId();
126
+ const name = document.getElementById('name').value;
127
+ const email = document.getElementById('email').value;
128
+
129
+ try {
130
+ const response = await fetch(WORKER_URL, {
131
+ method: 'POST',
132
+ headers: { 'Content-Type': 'application/json' },
133
+ body: JSON.stringify({ name, email, uniqueId }),
134
+ });
135
+
136
+ if (!response.ok) {
137
+ const errorText = await response.text();
138
+ throw new Error(errorText || 'Submission failed');
139
+ }
140
+
141
+ // Show success message
142
+ uniqueIDDisplay.textContent = uniqueId;
143
+ formContainer.classList.add('hidden');
144
+ successMessage.classList.remove('hidden');
145
+
146
+ } catch (error) {
147
+ console.error('Error submitting form:', error);
148
+ alert(`There was an error: ${error.message}. Please try again.`);
149
+ } finally {
150
+ // Reset button
151
+ buttonText.textContent = 'Generate Unique ID';
152
+ submitButton.disabled = false;
153
  }
154
+ });
 
 
155
  });
156
  </script>
157
 
158
+ </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  </html>