diff --git a/README.md b/README.md new file mode 100644 index 0000000..e215bc4 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. diff --git a/app/about/page.tsx b/app/about/page.tsx index b851093..15d6841 100644 --- a/app/about/page.tsx +++ b/app/about/page.tsx @@ -1,5 +1,6 @@ "use client"; +import CTA from "@/components/CTASection"; import { motion } from "framer-motion"; import { Film, Target, TrendingUp, Users, Lightbulb, Heart } from "lucide-react"; @@ -151,6 +152,7 @@ export default function AboutPage() { + ); } diff --git a/app/contact/page.tsx b/app/contact/page.tsx index ba85dc2..a3b56ae 100644 --- a/app/contact/page.tsx +++ b/app/contact/page.tsx @@ -3,9 +3,12 @@ import { motion } from "framer-motion"; import { Mail, Phone, Clock, MessageCircle, ArrowRight } from "lucide-react"; import Link from "next/link"; -import { useEffect } from "react"; +import { useEffect, useState, useRef } from "react"; export default function ContactPage() { + const [firstFormSubmitted, setFirstFormSubmitted] = useState(false); + const iframeRef = useRef(null); + useEffect(() => { // Load Tally embed script const script = document.createElement("script"); @@ -14,7 +17,56 @@ export default function ContactPage() { document.body.appendChild(script); return () => { - document.body.removeChild(script); + if (document.body.contains(script)) { + document.body.removeChild(script); + } + }; + }, []); + + + useEffect(() => { + // Listen for Tally form submission events + const handleMessage = (event: MessageEvent) => { + // Validate origin for security (Tally forms are served from tally.so) + if (!event.origin.includes("tally.so")) { + return; + } + + // Check if the message contains the form submission event + if (typeof event.data === "string" && event.data.includes("Tally.FormSubmitted")) { + try { + const data = JSON.parse(event.data); + + // Check for both 'event' and 'type' properties (Tally may use either) + if (data.event === "Tally.FormSubmitted" || data.type === "Tally.FormSubmitted") { + // Check if it's the first form (Bza7LN) + if (data.payload?.formId === "Bza7LN") { + setFirstFormSubmitted((prev) => { + if (!prev) { + return true; + } + return prev; + }); + } + } + } catch (error) { + // If parsing fails, try checking if it's a simple string match + if (event.data.includes("Tally.FormSubmitted")) { + setFirstFormSubmitted((prev) => { + if (!prev) { + return true; + } + return prev; + }); + } + } + } + }; + + window.addEventListener("message", handleMessage); + + return () => { + window.removeEventListener("message", handleMessage); }; }, []); const contactMethods = [ @@ -157,17 +209,34 @@ export default function ContactPage() { transition={{ duration: 0.6, delay: 0.2, ease: "easeOut" }} className="order-1 md:order-2" > -
-