diff --git a/v2/src/components/Contact.jsx b/v2/src/components/Contact.jsx
index 92e6625..e6c64cf 100644
--- a/v2/src/components/Contact.jsx
+++ b/v2/src/components/Contact.jsx
@@ -1,7 +1,132 @@
-import React from 'react';
+import { useRef, useState } from 'react';
+
+import emailjs from '@emailjs/browser';
+import { motion } from 'framer-motion';
+
+import EarthCanvas from '@/components/canvas/Earth';
+import SectionWrapper from '@/hoc/SectionWrapper';
+import { styles } from '@/styles';
+import { slideIn } from '@/utils/motion';
const Contact = () => {
- return
Contact
;
+ const formRef = useRef();
+ const [form, setForm] = useState({
+ name: '',
+ email: '',
+ message: '',
+ });
+
+ const [loading, setLoading] = useState(false);
+
+ const handleChange = (e) => {
+ const { target } = e;
+ const { name, value } = target;
+
+ setForm({
+ ...form,
+ [name]: value,
+ });
+ };
+
+ const handleSubmit = (e) => {
+ e.preventDefault();
+ setLoading(true);
+
+ emailjs
+ .send(
+ import.meta.env.VITE_APP_EMAILJS_SERVICE_ID,
+ import.meta.env.VITE_APP_EMAILJS_TEMPLATE_ID,
+ {
+ from_name: form.name,
+ to_name: 'JavaScript Mastery',
+ from_email: form.email,
+ to_email: 'sujata@jsmastery.pro',
+ message: form.message,
+ },
+ import.meta.env.VITE_APP_EMAILJS_PUBLIC_KEY
+ )
+ .then(
+ () => {
+ setLoading(false);
+ alert('Thank you. I will get back to you as soon as possible.');
+
+ setForm({
+ name: '',
+ email: '',
+ message: '',
+ });
+ },
+ (error) => {
+ setLoading(false);
+ console.error(error);
+
+ alert('Ahh, something went wrong. Please try again.');
+ }
+ );
+ };
+ return (
+
+
+ Get in touch
+ Contact.
+
+
+
+
+
+
+
+
+ );
};
-export default Contact;
+const WrappedContact = SectionWrapper(Contact, 'contact');
+
+export default WrappedContact;
diff --git a/v2/src/components/canvas/Earth.jsx b/v2/src/components/canvas/Earth.jsx
new file mode 100644
index 0000000..84747a0
--- /dev/null
+++ b/v2/src/components/canvas/Earth.jsx
@@ -0,0 +1,43 @@
+import { Suspense } from 'react';
+
+import { OrbitControls, Preload, useGLTF } from '@react-three/drei';
+import { Canvas } from '@react-three/fiber';
+
+import CanvasLoader from '@/components/Loader';
+
+const Earth = () => {
+ const earth = useGLTF('./planet/scene.gltf');
+
+ return ;
+};
+
+const EarthCanvas = () => {
+ return (
+
+ );
+};
+
+export default EarthCanvas;