From b0931adeed16de342264fef1c89ea81be8f27f89 Mon Sep 17 00:00:00 2001 From: Kodiererin Date: Fri, 11 Oct 2024 15:06:36 +0530 Subject: [PATCH 1/3] (Feature) : Adding Loader --- my-app/src/components/Loader.jsx | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 my-app/src/components/Loader.jsx diff --git a/my-app/src/components/Loader.jsx b/my-app/src/components/Loader.jsx new file mode 100644 index 0000000..dac0def --- /dev/null +++ b/my-app/src/components/Loader.jsx @@ -0,0 +1,7 @@ +import React from 'react' + +export default function Loader() { + return ( +
Loader
+ ) +} From 1024b00d8999a38a7b39ed8f57b516f2981d35b0 Mon Sep 17 00:00:00 2001 From: Kodiererin Date: Fri, 11 Oct 2024 15:09:06 +0530 Subject: [PATCH 2/3] (Feature) : Added a Loader --- my-app/package-lock.json | 14 +++--- my-app/package.json | 3 +- my-app/src/App.jsx | 54 +++++++++++++++--------- my-app/src/assets/images/codex-logo.png | Bin 0 -> 6734 bytes my-app/src/components/Loader.jsx | 50 +++++++++++++++++++--- 5 files changed, 89 insertions(+), 32 deletions(-) create mode 100644 my-app/src/assets/images/codex-logo.png diff --git a/my-app/package-lock.json b/my-app/package-lock.json index ba00db5..dbaab4a 100644 --- a/my-app/package-lock.json +++ b/my-app/package-lock.json @@ -10,7 +10,8 @@ "dependencies": { "@headlessui/react": "^2.1.8", "@wojtekmaj/react-hooks": "^1.21.0", - "framer-motion": "^11.5.6", + "framer-motion": "^11.11.7", + "my-app": "file:", "react": "^18.3.1", "react-dom": "^18.3.1", "react-helmet": "^6.1.0", @@ -3246,10 +3247,9 @@ } }, "node_modules/framer-motion": { - "version": "11.5.6", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.5.6.tgz", - "integrity": "sha512-JMwUpAxv/DWgul9vPgX0ElKn0G66sUc6O9tOXsYwn3zxwvhxFljSXC0XT2QCzuTYBshwC8nyDAa1SYcV0Ldbhw==", - "license": "MIT", + "version": "11.11.7", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.11.7.tgz", + "integrity": "sha512-89CgILOXPeG3L7ymOTGrLmf8IiKubYLUN/QkYgQuLvehAHfqgwJbLfCnhuyRI4WTds1TXkUp67A7IJrgRY/j1w==", "dependencies": { "tslib": "^2.4.0" }, @@ -4594,6 +4594,10 @@ "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==", "license": "MIT" }, + "node_modules/my-app": { + "resolved": "", + "link": true + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", diff --git a/my-app/package.json b/my-app/package.json index b53709b..9991b6a 100644 --- a/my-app/package.json +++ b/my-app/package.json @@ -12,7 +12,8 @@ "dependencies": { "@headlessui/react": "^2.1.8", "@wojtekmaj/react-hooks": "^1.21.0", - "framer-motion": "^11.5.6", + "framer-motion": "^11.11.7", + "my-app": "file:", "react": "^18.3.1", "react-dom": "^18.3.1", "react-helmet": "^6.1.0", diff --git a/my-app/src/App.jsx b/my-app/src/App.jsx index 1856ad5..e360134 100644 --- a/my-app/src/App.jsx +++ b/my-app/src/App.jsx @@ -1,4 +1,7 @@ +// src/App.jsx + import { BrowserRouter, Routes, Route } from "react-router-dom"; +import { useState, useEffect } from "react"; import Home from "./pages/Home"; import About from "./pages/About"; import NotFound from "./pages/404"; @@ -7,32 +10,41 @@ import ContactForm from "./pages/Contact"; import Events from "./pages/Events"; import Base from "./layouts/Base"; import Subscribe from "./components/Subscribe"; -import { useState } from "react"; -// import NewsletterPage from "./pages/NewsletterPage"; +import Loader from "./components/Loader"; export default function App() { - const [isVisible, setIsVisible] = useState(false); - - const handleSetVisible = (value)=>{ - setIsVisible(value); - }; + const [isVisible, setIsVisible] = useState(false); + const [loading, setLoading] = useState(true); + + useEffect(() => { + const timer = setTimeout(() => { + setLoading(false); + }, 1500); // I have Adjusted loader time to 1.5 seconds for smoother transition + + return () => clearTimeout(timer); // Cleaning up timer + }, []); + + const handleSetVisible = (value) => setIsVisible(value); return (
- {isVisible&&} - - - - } /> - } /> - } /> - } /> - } /> - {/* } /> */} - } /> - - - + {isVisible && } + {loading ? ( + + ) : ( + + + + } /> + } /> + } /> + } /> + } /> + } /> + + + + )}
); } diff --git a/my-app/src/assets/images/codex-logo.png b/my-app/src/assets/images/codex-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..83012d8d329bddccecb40131dedaa26687a7af49 GIT binary patch literal 6734 zcmV-U8nNYxP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5C8xR5CN?ty>$Qp8RJPrK~#8N?Oh3+ z6vesko}Sqo76cJQ1q=wXi$qbQ7!5q45RZrl3JCI|K98vJd>#aY?|D8GjRz*`i%Qg} zEFRC}hfz^fqJp5JatI15%d+(9hA>Sk7r0&#o*KBzEj5<~*Lcd?>Vzm*o#RzyDO0W1)~>Z)-b_ zi$qp%s;WUNqd}Gr4v`{tkmH zg5N(2%wG*g8?;FelGI@H`)}r4u1ZGLJ;1EO6fcLCdJT2TauDfHbD_{-th9w*AsGA# zPeN1_qXtD89s#qLK+}dXik<`BtkBx}Z!o9%l~mNH$Na0?7;*4Sn|=eD3762kpywG4d%e*Xvv@>ytt(Fvgti3H&MJjk`R z9mFWI2RKwPtqak%U1n{=;QOAuVs7*1>yNG>K94VQ88FlT-}{;$H?vP*7Ex7kAl2aS>NjBQUD`1MMO?otHp(yA6Gy zK-w#cx9N^lp95)Pd;55pqQ7HAhYX#kAj`YqO#Gp|u`%`aVz!}aLox7fgYevj{zUt< z+2-|LjzL;vJno?huQqr(7|XYLtwzG_O`a4;kxkmKdHaL;0#_Azcloff-DF1Z9`EU z#V85@)G1M%3Mb)RbilYiBO%K27eaJ1yze~}*0jNxE^dM8ZA$1j3$Rf2$iI=>xwB_` z$XN%i10#_q(UFK*N08o#Iph|^GqZD(PY8t$gC;&@I-sMx_#ENX{9B*;{ln4dYaqy0 zXr9q!r+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2|xvfWDFCE2!f=T+eH1X*spEwRJkywbYLDQO}={cQGT= z0TSBJy$kt7PWOMgF7E$3$=i;rn@suXh$akH(#Ynq^WTdT)BQXFBe}v?~ig(bW z&Nd8&-@&AWQ-V#A&$4CY^|Z>HvKtz8#>yn~{(p$&05!8k@^&(ME$1XaJ&& zexe}SvbUk3A$mX!P&e+}k*#BY)X27R3)VDGoRjkZiJA(fGY(SK(m|S5gXn4KngXJw zTLj@Avz>i(9?Gnc22aL(R31&$JKu;ocs)9_9CKL0>3YZ$U_MX8+U#0S)tKYxq`tvu=V;7aT6K9W2`blpzi1aIil7@Iz^OH_oLd!QiJ9OmYkxHq48T2ctRr z1{i0@Tvb_7QK4d??u!Wx>HMdkeyY#mQ>RYtvOcPV1h8w@t^sgdBB&?4d-rZ_%$PAD zR-^-~R;?-?G-#0C$K#JbK7{+3F3XbL-}#e;=c9iwN_=FUW|z-8pcjJdF($&PfH(36 z&7n}AYL;vvMYJ5cU~bD{^Vii*K64OD$}UJlCxyc`<5hJMOR|t6yob#j8o<2CE^~w9 kFo%w(4 { + const [showExplore, setShowExplore] = useState(false); + + useEffect(() => { + const timer = setTimeout(() => { + setShowExplore(true); + }, 500); + + return () => clearTimeout(timer); + }, []); -export default function Loader() { return ( -
Loader
- ) -} +
+
+ Logo + +
+ + We Code + + + + We Explore + +
+
+
+ ); +}; + +export default Loader; From 6f07df1aec679ea4430171bdd89d490c9ff8894e Mon Sep 17 00:00:00 2001 From: Kodiererin Date: Sat, 12 Oct 2024 02:03:09 +0530 Subject: [PATCH 3/3] (Feature) : Implemented Suggestions --- my-app/src/App.jsx | 9 ++--- my-app/src/components/Loader.jsx | 65 ++++++++++++++++++-------------- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/my-app/src/App.jsx b/my-app/src/App.jsx index e360134..4998d44 100644 --- a/my-app/src/App.jsx +++ b/my-app/src/App.jsx @@ -1,5 +1,3 @@ -// src/App.jsx - import { BrowserRouter, Routes, Route } from "react-router-dom"; import { useState, useEffect } from "react"; import Home from "./pages/Home"; @@ -19,7 +17,7 @@ export default function App() { useEffect(() => { const timer = setTimeout(() => { setLoading(false); - }, 1500); // I have Adjusted loader time to 1.5 seconds for smoother transition + }, 1500); // Adjusted loader time to 1.5 seconds for smoother transition return () => clearTimeout(timer); // Cleaning up timer }, []); @@ -29,9 +27,8 @@ export default function App() { return (
{isVisible && } - {loading ? ( - - ) : ( + + {!loading && ( diff --git a/my-app/src/components/Loader.jsx b/my-app/src/components/Loader.jsx index edd675a..ab243c0 100644 --- a/my-app/src/components/Loader.jsx +++ b/my-app/src/components/Loader.jsx @@ -1,10 +1,8 @@ -// src/components/Loader.jsx - import React, { useEffect, useState } from "react"; -import { motion } from "framer-motion"; +import { motion, AnimatePresence } from "framer-motion"; import logo from "../assets/images/codex-logo.png"; -const Loader = () => { +const Loader = ({ loading }) => { const [showExplore, setShowExplore] = useState(false); useEffect(() => { @@ -16,31 +14,40 @@ const Loader = () => { }, []); return ( -
-
- Logo - -
- - We Code - - - - We Explore - -
-
-
+ + {loading && ( + +
+ Logo + +
+ + We Code + + + + We Explore + +
+
+
+ )} +
); };