File size: 14,451 Bytes
4662280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d132547
 
 
 
 
 
4662280
 
 
d132547
4662280
bde575a
f65a3aa
a8a6b40
86e9c4e
8df17da
57c9a1f
8df17da
d132547
4662280
 
 
 
 
 
 
d132547
 
 
 
 
 
4662280
 
5367fbc
d132547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4662280
d132547
 
 
 
 
4662280
 
cea0011
 
d132547
 
 
 
c550769
 
 
d132547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c550769
d132547
 
 
 
c550769
 
 
 
 
 
 
d132547
c550769
d132547
 
 
 
 
 
 
 
 
 
 
 
 
c550769
 
d132547
 
 
 
 
 
 
 
c550769
d132547
c550769
 
d132547
c550769
cea0011
d132547
cea0011
488f6ca
4065cf0
 
c0ebbd9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4065cf0
 
c0ebbd9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4065cf0
c0ebbd9
 
 
 
 
 
 
 
4065cf0
 
 
4662280
d132547
4662280
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>California Films Project</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            background-color: #f8f9fa;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
        }
        .floating-panel {
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            transition: all 0.3s ease;
        }
        .gradient-text {
            background: linear-gradient(90deg, #3b82f6, #10b981);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }
        /* Style to handle the hidden state gracefully */
        #floatingPanel.hidden {
            opacity: 0;
            transform: translateY(1rem);
            pointer-events: none;
        }
    </style>
</head>
<body class="min-h-screen bg-gray-50 flex flex-col">

    <main class="flex-grow flex flex-col items-center justify-center p-4 text-center">
        <h1 class="text-4xl md:text-3xl font-bold mb-4 gradient-text">California Films Project/</h1>
        <p class="text-0.10g md:text-0.10xl text-gray-600">Film Tax Incentives / Transferable Tax Credits {B/On Eligibility}</p>
      <p class="text-md md:text-x0.10 text-gray-600 mt-2">Benefits: Annuitized • Blockchain Tokens • Yield% Farming</p>
        <p class="text-md md:text-x0.10 text-gray-600 mt-2">1901 Avenue of the Stars / Silicon Beach /</p>
      <br>
      <p class="text-md md:text-x0.05 text-gray-600 mt-1">§ 1.482-4 (b) (4)(5) §1.482-4(f)(3) § 6132 (h)(1) Section 798.3 Notice 2014-21</p>
    
    </main>

    <div class="fixed bottom-6 right-6 z-50">
        <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">
            <i class="fas fa-id-card text-2xl"></i>
        </button>
    </div>

    <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">
        <div id="formContainer">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-xl font-semibold text-gray-800">Indicate Your Interest</h3>
                <button id="closePanel" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <p class="text-gray-600 mb-4 text-sm">Complete this form to participate. {Financier-or-Filmmaker} {Film-Stream-Television} {<> 1M Budgets} {New ROI Model} Your unique ID will serve as your placeholder.</p>
            <form id="interestForm" class="space-y-4">
                <div>
                    <label for="name" class="block text-sm font-medium text-gray-700 mb-1">Full Name</label>
                    <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">
                </div>
                <div>
                    <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label>
                    <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">
                </div>
                <div>
                    <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">
                        <span id="buttonText">Generate Unique ID</span>
                        <i id="buttonIcon" class="fas fa-arrow-right ml-2"></i>
                    </button>
                </div>
            </form>
        </div>
        <div id="successMessage" class="hidden text-center">
            <div class="text-green-500">
                <i class="fas fa-check-circle fa-3x"></i>
            </div>
            <h4 class="text-lg font-semibold text-gray-800 mt-3">Success!</h4>
            <p class="text-gray-600 mt-1">Your unique ID is:</p>
            <p id="uniqueIDDisplay" class="font-bold text-lg text-gray-800 bg-gray-100 rounded-md py-2 mt-2"></p>
            <p class="mt-3 text-sm text-gray-500">We'll be in touch soon!</p>
            <button id="closeSuccess" class="mt-4 w-full text-sm text-gray-600 hover:text-gray-800">Close</button>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', () => {
            // --- CONFIGURATION ---
            const WORKER_URL = 'https://contact-form-api.aiagents.workers.dev/';

            // --- STATE ---
            let isSubmitting = false;

            // --- ELEMENTS ---
            const togglePanelBtn = document.getElementById('togglePanel');
            const floatingPanel = document.getElementById('floatingPanel');
            const closePanelBtn = document.getElementById('closePanel');
            const interestForm = document.getElementById('interestForm');
            const formContainer = document.getElementById('formContainer');
            const successMessage = document.getElementById('successMessage');
            const uniqueIDDisplay = document.getElementById('uniqueIDDisplay');
            const closeSuccessBtn = document.getElementById('closeSuccess');
            const submitButton = document.getElementById('submitButton');
            const buttonText = document.getElementById('buttonText');

            // --- FUNCTIONS ---
            const showPanel = () => floatingPanel.classList.remove('hidden');
            const hidePanel = () => floatingPanel.classList.add('hidden');

            const generateUniqueId = () => 'CFP-' + Date.now().toString(36) + Math.random().toString(36).substring(2, 8).toUpperCase();

            // --- EVENT LISTENERS ---
            togglePanelBtn.addEventListener('click', showPanel);
            closePanelBtn.addEventListener('click', hidePanel);
            closeSuccessBtn.addEventListener('click', () => {
                hidePanel();
                setTimeout(() => {
                    formContainer.classList.remove('hidden');
                    successMessage.classList.add('hidden');
                    interestForm.reset();
                }, 300); 
            });

            interestForm.addEventListener('submit', async (e) => {
                e.preventDefault();
                
                // ** THE FIX IS HERE: If a submission is already happening, do nothing. **
                if (isSubmitting) {
                    return; 
                }

                isSubmitting = true;
                submitButton.disabled = true;
                buttonText.textContent = 'Submitting...';

                const uniqueId = generateUniqueId();
                const name = document.getElementById('name').value;
                const email = document.getElementById('email').value;

                try {
                    const response = await fetch(WORKER_URL, {
                        method: 'POST',
                        headers: { 'Content-Type': 'application/json' },
                        body: JSON.stringify({ name, email, uniqueId }),
                    });

                    if (!response.ok) {
                        const errorData = await response.json();
                        throw new Error(errorData.error || 'Submission failed');
                    }
                    
                    uniqueIDDisplay.textContent = uniqueId;
                    formContainer.classList.add('hidden');
                    successMessage.classList.remove('hidden');

                } catch (error) {
                    console.error('Error submitting form:', error);
                    alert(`There was an error: ${error.message}`);
                } finally {
                    // Re-enable the form for a new submission later
                    isSubmitting = false;
                    submitButton.disabled = false;
                    buttonText.textContent = 'Generate Unique ID';
                }
            });
        });
    
// Paste this code inside the existing document.addEventListener('DOMContentLoaded', () => { ... });

<script>
document.addEventListener('DOMContentLoaded', () => {

    // #################################################################
    // ## LOGIC FOR THE "INDICATE YOUR INTEREST" PANEL (FORM)
    // #################################################################
    const interestForm = document.getElementById('interestForm');
    if (interestForm) {
        // --- CONFIGURATION ---
        const WORKER_URL = 'https://contact-form-api.aiagents.workers.dev/';
        // --- STATE ---
        let isSubmitting = false;
        // --- ELEMENTS ---
        const togglePanelBtn = document.getElementById('togglePanel');
        const floatingPanel = document.getElementById('floatingPanel');
        const closePanelBtn = document.getElementById('closePanel');
        const formContainer = document.getElementById('formContainer');
        const successMessage = document.getElementById('successMessage');
        const uniqueIDDisplay = document.getElementById('uniqueIDDisplay');
        const closeSuccessBtn = document.getElementById('closeSuccess');
        const submitButton = document.getElementById('submitButton');
        const buttonText = document.getElementById('buttonText');

        const showInterestPanel = () => floatingPanel.classList.remove('hidden');
        const hideInterestPanel = () => floatingPanel.classList.add('hidden');
        const generateUniqueId = () => 'CFP-' + Date.now().toString(36) + Math.random().toString(36).substring(2, 8).toUpperCase();

        togglePanelBtn.addEventListener('click', showInterestPanel);
        closePanelBtn.addEventListener('click', hideInterestPanel);
        closeSuccessBtn.addEventListener('click', () => {
            hideInterestPanel();
            setTimeout(() => {
                formContainer.classList.remove('hidden');
                successMessage.classList.add('hidden');
                interestForm.reset();
            }, 300);
        });

        interestForm.addEventListener('submit', async (e) => {
            e.preventDefault();
            if (isSubmitting) return;

            isSubmitting = true;
            submitButton.disabled = true;
            buttonText.textContent = 'Submitting...';
            const uniqueId = generateUniqueId();
            const name = document.getElementById('name').value;
            const email = document.getElementById('email').value;

            try {
                const response = await fetch(WORKER_URL, {
                    method: 'POST',
                    headers: { 'Content-Type': 'application/json' },
                    body: JSON.stringify({ name, email, uniqueId }),
                });
                if (!response.ok) {
                    const errorData = await response.json();
                    throw new Error(errorData.error || 'Submission failed');
                }
                uniqueIDDisplay.textContent = uniqueId;
                formContainer.classList.add('hidden');
                successMessage.classList.remove('hidden');
            } catch (error) {
                console.error('Error submitting form:', error);
                alert(`There was an error: ${error.message}`);
            } finally {
                isSubmitting = false;
                submitButton.disabled = false;
                buttonText.textContent = 'Generate Unique ID';
            }
        });
    }

    // #################################################################
    // ## LOGIC FOR THE "POINTS CALCULATOR" PANEL
    // #################################################################
    const pointsCalculatorPanel = document.getElementById('pointsCalculatorPanel');
    if (pointsCalculatorPanel) {
        // --- ELEMENTS ---
        const toggleCalculatorBtn = document.getElementById('toggleCalculator');
        const closeCalculatorBtn = document.getElementById('closeCalculator');
        const pointsResultDiv = document.getElementById('pointsResult');
        const roleInputs = document.querySelectorAll('input[name="filmRole"]');

        // --- POINTS DATA ---
        const pointsData = {
            Financier: {
                points: "50 Points",
                description: "Financing 100% of the budget typically equals 50% of the net profits, representing the foundational 50/50 split between capital and production."
            },
            Producer: {
                points: "10 Points",
                description: "A lead producer typically receives points from the 'Producer's Pool,' rewarding their effort in developing and managing the entire project."
            },
            Director: {
                points: "5 Points",
                description: "An established director's creative leadership is often rewarded with points from the 'Talent Pool' in addition to their fee."
            }
        };

        const updatePointsDisplay = () => {
            const selectedRole = document.querySelector('input[name="filmRole"]:checked').value;
            const data = pointsData[selectedRole];
            pointsResultDiv.innerHTML = `<h4 class="text-2xl font-bold text-blue-600">${data.points}</h4><p class="text-xs text-gray-600 mt-1">${data.description}</p>`;
        };

        toggleCalculatorBtn.addEventListener('click', () => {
            pointsCalculatorPanel.classList.toggle('hidden');
            pointsCalculatorPanel.classList.toggle('opacity-0');
            pointsCalculatorPanel.classList.toggle('translate-y-4');
            updatePointsDisplay();
        });

        closeCalculatorBtn.addEventListener('click', () => {
            pointsCalculatorPanel.classList.add('hidden', 'opacity-0', 'translate-y-4');
        });

        roleInputs.forEach(input => {
            input.addEventListener('change', updatePointsDisplay);
        });
    }
});

</script>

</body>
</html>