diff --git a/frontend/src/assets/styles/auth.css b/frontend/src/assets/styles/auth.css index b0794d1..bb6bbfa 100644 --- a/frontend/src/assets/styles/auth.css +++ b/frontend/src/assets/styles/auth.css @@ -3,24 +3,37 @@ @tailwind utilities; @layer utilities { - /* Act as a border */ - .card-wrapper { + + .container { @apply absolute overflow-hidden rounded-2xl ; } - /* Gradient */ - .card-wrapper::before { + .container::before { background-image: conic-gradient( from 200deg at 50% 50%, transparent 70%, #55e28b 85%, #3b82f6 90%, #BF40BF 95%); - @apply absolute left-[-50%] top-[-50%] h-[200%] w-[200%] animate-border-spin content-['']; + + content: ''; + position: absolute; + + width: 200%; + height: 200%; + animation: border-spin var(--spin-duration) linear infinite; } - /* Body */ - .card-content { + .front-content { @apply absolute left-[1px] top-[1px] h-[calc(100%-4px)] w-[calc(100%-4px)] rounded-2xl ; } } + +@keyframes border-spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} \ No newline at end of file diff --git a/frontend/src/components/Auth/AuthModal.tsx b/frontend/src/components/Auth/AuthModal.tsx index 92f21da..ea57b50 100644 --- a/frontend/src/components/Auth/AuthModal.tsx +++ b/frontend/src/components/Auth/AuthModal.tsx @@ -12,20 +12,31 @@ interface AuthModalProps { const AuthModal: React.FC = ({ onClose }) => { const [selectedTab, setSelectedTab] = useState("Login"); + const [spinDuration, setSpinDuration] = useState("7s") + + const handleSubmit = () => { + setSpinDuration("1s"); + + setTimeout(() => { + setSpinDuration("7s"); + }, 5000); + }; return ( <> {/*Background Blur*/}
{/*Container*/} -
+
{/*Border Container*/}
@@ -52,7 +63,7 @@ const AuthModal: React.FC = ({ onClose }) => { Register
- {selectedTab === "Login" ? : } + {selectedTab === "Login" ? : }
diff --git a/frontend/src/components/Auth/RegisterForm.tsx b/frontend/src/components/Auth/RegisterForm.tsx index 6bcc523..59c62ec 100644 --- a/frontend/src/components/Auth/RegisterForm.tsx +++ b/frontend/src/components/Auth/RegisterForm.tsx @@ -18,7 +18,11 @@ interface FormErrors { general?: string; // For general authentication errors } -const RegisterForm: React.FC = () => { +interface SubmitProps { + onSubmit: () => void; // Add the prop for the callback +} + +const RegisterForm: React.FC = ({ onSubmit }) => { const { setIsLoggedIn } = useAuth(); const [formData, setFormData] = useState({ @@ -58,6 +62,7 @@ const RegisterForm: React.FC = () => { const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); + onSubmit(); if (validateForm()) { try { diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index c3054d7..11a8100 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -12,7 +12,7 @@ export default { animation: { moving_text_colour: "moving_text_colour 6s ease-in-out infinite alternate", moving_bg: 'moving_bg 200s linear infinite', - 'border-spin': 'border-spin 7s linear infinite', + 'border-spin': 'border-spin linear infinite', // No duration here }, @@ -24,17 +24,12 @@ export default { moving_text_colour: { "0%": { backgroundPosition: "0% 50%" }, "100%": { backgroundPosition: "100% 50%" }, - + moving_bg: { '0%': { backgroundPosition: '0% 0%' }, '100%': { backgroundPosition: '100% 0%' }, } }, - 'border-spin': { - '100%': { - transform: 'rotate(360deg)', - }, - }, }, }, plugins: [