Skip to content

Commit 49d2758

Browse files
Fixes #87: Add a smooth page transition from going from homepage to second page
1 parent 87848a5 commit 49d2758

File tree

7 files changed

+174
-205
lines changed

7 files changed

+174
-205
lines changed

.firebase/hosting.YnVpbGQ.cache

Lines changed: 80 additions & 100 deletions
Large diffs are not rendered by default.

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.github/
22
.firebase/
33
public/
4+
build/

firebase.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"hosting": {
33
"public": "build",
4-
"ignore": [
5-
"firebase.json",
6-
"**/.*",
7-
"**/node_modules/**"
8-
],
4+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
95
"rewrites": [
106
{
117
"source": "**",

src/Routes.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import React, { Suspense } from 'react';
33
import { Route, Switch } from 'react-router-dom';
44
import LoadingScreen from 'src/components/LoadingScreen';
55
import Navigation from 'src/components/dashboard';
6-
import MainLayout from 'src/layouts/MainLayout';
7-
import HomeView from 'src/views/pages/HomeView';
86
import Error404View from 'src/views/pages/Error404View';
97
import Profile from 'src/components/Profile';
108
import EventDefaultPage from 'src/views/pages/events/eventdefault';
@@ -17,20 +15,11 @@ import LandingPage from './views/pages/HomeView/LandingPage';
1715
const renderRoutes = () => (
1816
<Suspense fallback={<LoadingScreen />}>
1917
<Switch>
20-
<Route
21-
path="/"
22-
exact
23-
render={props => (
24-
<MainLayout>
25-
<HomeView {...props} />
26-
</MainLayout>
27-
)}
28-
/>
18+
<Route path="/" exact render={() => <LandingPage />} />
2919
<Route path="/register" exact render={() => <Register />} />
3020
<Route path="/dashboard" exact render={() => <Navigation />} />
3121
<Route path="/profile" exact render={() => <Profile />} />
3222
<Route path="/events" exact render={() => <EventDefaultPage />} />
33-
<Route path="/landing" exact render={() => <LandingPage />} />
3423
<Route path="/events/:eventID" exact render={() => <IndividualEvent />} />
3524
<Route path="/createEvent" exact render={() => <CreateNewEvent />} />
3625
<Route path="/settings" exact render={() => <Settings />} />

src/views/pages/HomeView/Hero.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function Hero({ className, ...rest }) {
156156
size="large"
157157
variant="contained"
158158
>
159-
Check out
159+
Login and Create Profile
160160
</Button>
161161
</Box>
162162
</Grid>

src/views/pages/HomeView/LandingPage.js

Lines changed: 89 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ import {
1111
AppBar
1212
} from '@material-ui/core';
1313
import TopBar from 'src/layouts/MainLayout/TopBar';
14+
import HomeView from '.';
15+
import { HashLink } from 'react-router-hash-link';
1416

1517
const useStyles = makeStyles(theme => ({
1618
root: {
1719
backgroundColor: '#FFF',
18-
height: '90vh',
20+
height: '100vh',
1921
color: '#000',
20-
2122
overflow: 'hidden',
2223
[theme.breakpoints.down('md')]: {
2324
paddingTop: 0,
@@ -38,10 +39,7 @@ const useStyles = makeStyles(theme => ({
3839
display: 'flex',
3940
'& > img': {
4041
maxWidth: '100%',
41-
4242
backfaceVisibility: 'hidden'
43-
// boxShadow: theme.shadows[16]
44-
// transform: 'rotateY(-35deg) rotateX(15deg)'
4543
},
4644
[theme.breakpoints.down('sm')]: {
4745
maxWidth: '40vh'
@@ -52,11 +50,13 @@ const useStyles = makeStyles(theme => ({
5250
},
5351
Button: {
5452
textTransform: 'capitalize'
55-
// padding :
5653
},
5754
container: {
5855
paddingTop: '10vh',
5956
margin: '0 5px',
57+
[theme.breakpoints.down('md')]: {
58+
minHeight: '87%'
59+
},
6060
[theme.breakpoints.down('sm')]: {
6161
margin: '0',
6262
paddingTop: '2vh',
@@ -67,8 +67,6 @@ const useStyles = makeStyles(theme => ({
6767
},
6868
footer: {
6969
padding: 0,
70-
objectFit: 'cover',
71-
position: 'fixed',
7270
left: 0,
7371
bottom: 0,
7472
height: '30vh',
@@ -81,100 +79,105 @@ const useStyles = makeStyles(theme => ({
8179
function LandingPage({ className, ...rest }) {
8280
const classes = useStyles();
8381
return (
84-
<div>
85-
<AppBar>
86-
<TopBar variant="black" />
87-
</AppBar>
88-
<div className={clsx(classes.root, className)} {...rest}>
89-
<Grid
90-
container
91-
spacing={2}
92-
className={classes.container}
93-
direction="row"
94-
justify="center"
95-
alignItems="center"
96-
>
82+
<>
83+
<div>
84+
<AppBar>
85+
<TopBar variant="black" />
86+
</AppBar>
87+
<div className={clsx(classes.root, className)} {...rest}>
9788
<Grid
98-
item
99-
xs={12}
100-
sm={6}
101-
style={{ height: '80%' }}
89+
container
90+
spacing={2}
91+
className={classes.container}
10292
direction="row"
10393
justify="center"
10494
alignItems="center"
10595
>
106-
<Box
107-
style={{
108-
display: 'flex',
109-
justifyContent: 'center'
110-
}}
96+
<Grid
97+
item
98+
xs={12}
99+
sm={6}
100+
style={{ height: '80%' }}
101+
direction="row"
102+
justify="center"
103+
alignItems="center"
111104
>
112105
<Box
113-
display="flex"
114-
style={{ justifyContent: 'center', flexDirection: 'column' }}
106+
style={{
107+
display: 'flex',
108+
justifyContent: 'center'
109+
}}
115110
>
116-
<Box mt={10} display="flex">
117-
<Typography variant="h1" style={{ fontWeight: '700' }}>
118-
A Heading for the
119-
<br /> Landing Page
120-
</Typography>
121-
</Box>
122-
<Box mt={3} display="flex">
123-
<Typography variant="h6">
124-
A brief introduction about platform , what is the purpose of
125-
thisand what our
126-
<br /> platform representstwo to three lines will work
127-
</Typography>
128-
</Box>
129-
<Box mt={3} display="flex">
130-
<Button
131-
style={{
132-
backgroundColor: '#ffffff',
133-
color: '#B20000',
134-
textTransform: 'capitalize',
135-
fontWeight: 700,
136-
borderRadius: '20px'
137-
}}
138-
component="a"
139-
href="/register"
140-
size="large"
141-
variant="contained"
142-
>
143-
Get Started <ArrowForwardOutlinedIcon />
144-
</Button>
111+
<Box
112+
display="flex"
113+
style={{ justifyContent: 'center', flexDirection: 'column' }}
114+
>
115+
<Box mt={10} display="flex">
116+
<Typography variant="h1" style={{ fontWeight: '700' }}>
117+
CauseFolio
118+
<br /> Where Leaders Live
119+
</Typography>
120+
</Box>
121+
<Box mt={3} display="flex">
122+
<Typography variant="h6">
123+
A community driven event management platform where
124+
<br /> community leaders showcase their real portfolio
125+
</Typography>
126+
</Box>
127+
<Box mt={3} display="flex">
128+
<HashLink smooth to="#cfc">
129+
<Button
130+
style={{
131+
backgroundColor: '#ffffff',
132+
color: '#B20000',
133+
textTransform: 'capitalize',
134+
fontWeight: 700,
135+
borderRadius: '20px'
136+
}}
137+
size="large"
138+
variant="contained"
139+
>
140+
Know More <ArrowForwardOutlinedIcon />
141+
</Button>
142+
</HashLink>
143+
</Box>
145144
</Box>
146145
</Box>
147-
</Box>
146+
</Grid>
147+
<Grid
148+
item
149+
xs={12}
150+
sm={6}
151+
style={{ display: 'flex', justifyContent: 'center' }}
152+
>
153+
<div className={classes.image}>
154+
<img
155+
alt="codeforcauseimg"
156+
src="/static/home/serviceGirl.png"
157+
style={{ width: '55vh' }}
158+
/>
159+
</div>
160+
</Grid>
148161
</Grid>
149-
<Grid
150-
item
151-
xs={12}
152-
sm={6}
153-
style={{ display: 'flex', justifyContent: 'center' }}
154-
>
155-
<div className={classes.image}>
162+
163+
<Grid container xs={12} sm={12}>
164+
<Grid item className={classes.footer}>
156165
<img
157166
alt="codeforcauseimg"
158-
src="/static/home/serviceGirl.png"
159-
style={{ width: '55vh' }}
167+
src="/static/home/Footer.svg"
168+
style={{
169+
width: '100vw'
170+
}}
160171
/>
161-
</div>
162-
</Grid>
163-
</Grid>
164-
165-
<Grid container xs={12} sm={12}>
166-
<Grid item className={classes.footer}>
167-
<img
168-
alt="codeforcauseimg"
169-
src="/static/home/Footer.svg"
170-
style={{
171-
width: '100vw'
172-
}}
173-
/>
172+
</Grid>
174173
</Grid>
175-
</Grid>
174+
</div>
176175
</div>
177-
</div>
176+
<div
177+
style={{ height: '20vh', width: '100%', backgroundColor: '#291755' }}
178+
></div>
179+
<HomeView />
180+
</>
178181
);
179182
}
180183

src/views/pages/HomeView/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function HomeView() {
2020
const classes = useStyles();
2121

2222
return (
23-
<Page className={classes.root} title="Code for Cause">
23+
<Page id="cfc" className={classes.root} title="CauseFolio">
2424
<Hero className={classes.hero} />
2525
<Footer />
2626
</Page>

0 commit comments

Comments
 (0)