File tree Expand file tree Collapse file tree 6 files changed +82
-42
lines changed Expand file tree Collapse file tree 6 files changed +82
-42
lines changed Original file line number Diff line number Diff line change @@ -8,25 +8,28 @@ import Contact from './pages/Contact';
8
8
import Home from './pages/Home';
9
9
import Projects from './pages/Projects';
10
10
import ProjectSingle from './pages/ProjectSingle';
11
+ import { AnimatePresence } from 'framer-motion';
11
12
12
13
function App() {
13
14
return (
14
15
<div className=" bg-secondary-light dark:bg-primary-dark transition duration-300">
15
16
<Router>
16
- <ScrollToTop />
17
- <AppHeader />
18
- <Routes>
19
- <Route path="/" element={<Home />} />
20
- <Route path="projects" element={<Projects />} />
21
- <Route
22
- path="projects/single-project"
23
- element={<ProjectSingle />}
24
- />
17
+ <AnimatePresence>
18
+ <ScrollToTop />
19
+ <AppHeader />
20
+ <Routes>
21
+ <Route path="/" element={<Home />} />
22
+ <Route path="projects" element={<Projects />} />
23
+ <Route
24
+ path="projects/single-project"
25
+ element={<ProjectSingle />}
26
+ />
25
27
26
- <Route path="about" element={<About />} />
27
- <Route path="contact" element={<Contact />} />
28
- </Routes>
29
- <AppFooter />
28
+ <Route path="about" element={<About />} />
29
+ <Route path="contact" element={<Contact />} />
30
+ </Routes>
31
+ <AppFooter />
32
+ </AnimatePresence>
30
33
</Router>
31
34
</div>
32
35
);
Original file line number Diff line number Diff line change
1
+ import { motion } from 'framer-motion';
1
2
import { Link } from 'react-router-dom';
2
3
3
4
const ProjectSingle = ({ title, category, image }) => {
4
5
return (
5
- <Link
6
- to="/projects/single-project"
7
- className="rounded-xl shadow-lg hover:shadow-xl cursor-pointer mb-10 sm:mb-0 bg-secondary-light dark:bg-ternary-dark"
8
- aria-label="Single Project"
6
+ <motion.div
7
+ initial={{ opacity: 0 }}
8
+ animate={{ opacity: 1, delay: 1 }}
9
+ exit={{ opacity: 0 }}
9
10
>
10
- <div>
11
- <img
12
- src={image}
13
- className="rounded-t-xl border-none"
14
- alt="Single Project"
15
- />
16
- </div>
17
- <div className="text-center px-4 py-6">
18
- <p className="text-2xl text-ternary-dark dark:text-ternary-light font-semibold mb-2">
19
- {title}
20
- </p>
21
- <span className="text-lg text-ternary-dark dark:text-ternary-light">
22
- {category}
23
- </span>
24
- </div>
25
- </Link>
11
+ <Link
12
+ to="/projects/single-project"
13
+ className="rounded-xl shadow-lg hover:shadow-xl cursor-pointer mb-10 sm:mb-0 bg-secondary-light dark:bg-ternary-dark"
14
+ aria-label="Single Project"
15
+ >
16
+ <div>
17
+ <img
18
+ src={image}
19
+ className="rounded-t-xl border-none"
20
+ alt="Single Project"
21
+ />
22
+ </div>
23
+ <div className="text-center px-4 py-6">
24
+ <p className="text-2xl text-ternary-dark dark:text-ternary-light font-semibold mb-2">
25
+ {title}
26
+ </p>
27
+ <span className="text-lg text-ternary-dark dark:text-ternary-light">
28
+ {category}
29
+ </span>
30
+ </div>
31
+ </Link>
32
+ </motion.div>
26
33
);
27
34
};
28
35
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { FiSearch } from 'react-icons/fi';
3
3
import ProjectSingle from './ProjectSingle';
4
4
import { ProjectsContext } from '../../context/ProjectsContext';
5
5
import ProjectsFilter from './ProjectsFilter';
6
+ import { motion } from 'framer-motion';
6
7
7
8
const ProjectsGrid = () => {
8
9
const {
Original file line number Diff line number Diff line change @@ -2,12 +2,18 @@ import useThemeSwitcher from '../../hooks/useThemeSwitcher';
2
2
import { FiArrowDownCircle } from 'react-icons/fi';
3
3
import developerLight from '../../images/developer.svg';
4
4
import developerDark from '../../images/developer-dark.svg';
5
+ import { motion } from 'framer-motion';
5
6
6
7
const AppBanner = () => {
7
8
const [activeTheme] = useThemeSwitcher();
8
9
9
10
return (
10
- <section className="flex flex-col sm:justify-between items-center sm:flex-row mt-12 md:mt-2">
11
+ <motion.section
12
+ initial={{ opacity: 0 }}
13
+ animate={{ opacity: 1 }}
14
+ exit={{ opacity: 0 }}
15
+ className="flex flex-col sm:justify-between items-center sm:flex-row mt-12 md:mt-2"
16
+ >
11
17
<div className="w-full md:w-1/3 text-left">
12
18
<h1 className="text-2xl lg:text-4xl xl:text-5xl text-center sm:text-left font-semibold text-ternary-dark dark:text-primary-light uppercase">
13
19
Hi, Iam Stoman
@@ -35,7 +41,7 @@ const AppBanner = () => {
35
41
alt="Developer"
36
42
/>
37
43
</div>
38
- </section>
44
+ </motion. section>
39
45
);
40
46
};
41
47
Original file line number Diff line number Diff line change @@ -2,20 +2,37 @@ import AboutMeBio from '../components/about/AboutMeBio';
2
2
import AboutCounter from '../components/about/AboutCounter';
3
3
import AboutClients from '../components/about/AboutClients.js';
4
4
import { AboutMeProvider } from '../context/AboutMeContext';
5
+ import { motion } from 'framer-motion';
5
6
6
7
const About = () => {
7
8
return (
8
9
<AboutMeProvider>
9
- <div className="container mx-auto">
10
+ <motion.div
11
+ initial={{ opacity: 0 }}
12
+ animate={{ opacity: 1, delay: 1 }}
13
+ exit={{ opacity: 0 }}
14
+ className="container mx-auto"
15
+ >
10
16
<AboutMeBio />
11
- </div>
17
+ </motion. div>
12
18
13
19
{/** Counter without paddings */}
14
- <AboutCounter />
20
+ <motion.div
21
+ initial={{ opacity: 0 }}
22
+ animate={{ opacity: 1, delay: 1 }}
23
+ exit={{ opacity: 0 }}
24
+ >
25
+ <AboutCounter />
26
+ </motion.div>
15
27
16
- <div className="container mx-auto">
28
+ <motion.div
29
+ initial={{ opacity: 0 }}
30
+ animate={{ opacity: 1, delay: 1 }}
31
+ exit={{ opacity: 0 }}
32
+ className="container mx-auto"
33
+ >
17
34
<AboutClients />
18
- </div>
35
+ </motion. div>
19
36
</AboutMeProvider>
20
37
);
21
38
};
Original file line number Diff line number Diff line change @@ -3,17 +3,23 @@ import ProjectHeader from '../components/projects//ProjectHeader';
3
3
import ProjectInfo from '../components/projects/ProjectInfo';
4
4
import ProjectRelatedProjects from '../components/projects/ProjectRelatedProjects';
5
5
import { SingleProjectProvider } from '../context/SingleProjectContext';
6
+ import { motion } from 'framer-motion';
6
7
7
8
const ProjectSingle = () => {
8
9
return (
9
- <div className="container mx-auto mt-5 sm:mt-10">
10
+ <motion.div
11
+ initial={{ opacity: 0 }}
12
+ animate={{ opacity: 1, delay: 1 }}
13
+ exit={{ opacity: 0 }}
14
+ className="container mx-auto mt-5 sm:mt-10"
15
+ >
10
16
<SingleProjectProvider>
11
17
<ProjectHeader />
12
18
<ProjectGallery />
13
19
<ProjectInfo />
14
20
<ProjectRelatedProjects />
15
21
</SingleProjectProvider>
16
- </div>
22
+ </motion. div>
17
23
);
18
24
};
19
25
You can’t perform that action at this time.
0 commit comments