Skip to content

Commit 93ed94d

Browse files
authored
Merge pull request #17 from JS-GitRepo/feature/Introduction
Feature/introduction
2 parents a07b2dd + 976e6fb commit 93ed94d

File tree

11 files changed

+72
-45
lines changed

11 files changed

+72
-45
lines changed

src/components/HomeView.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const HomeView = ({}: Props) => {
3333
const paramStateSet = [setParam1, setParam2, setParam3, setParam4];
3434
// check if this is the landing page
3535
const [isLanding, setIsLanding] = useState<boolean>(false);
36+
const [isIntro, setIsIntro] = useState<boolean>(false);
3637
// - - - - CONTEXT - - - -
3738
const { hueRotation, setHueDuration } = useContext(AppContext);
3839
// - - - - - TITLES AND TEXT - - - - -
@@ -84,7 +85,13 @@ const HomeView = ({}: Props) => {
8485
setParam4(webDevProjList[0]);
8586
tempParams[3] = webDevProjList[0];
8687
}
87-
88+
// Checks for introduction page
89+
if (tempParams[1] === "introduction") {
90+
setIsIntro(true);
91+
} else {
92+
setIsIntro(false);
93+
}
94+
// Reroutes to default project / current project based on current route
8895
let construct_URL = `/${tempParams[0]}/${tempParams[1]}/${tempParams[2]}/${tempParams[3]}`;
8996
let isSame_URL = construct_URL === location.pathname;
9097
let isIntroduction_URL = tempParams[1] === "introduction";
@@ -117,9 +124,10 @@ const HomeView = ({}: Props) => {
117124
subtitle={subtitle}
118125
subEmoji={subEmoji}
119126
allParams={allParamsArray}
127+
isIntro={isIntro}
120128
/>
121-
<HomeViewContent currentContent={param4} />
122-
<HomeViewFooter allParams={allParamsArray} />
129+
<HomeViewContent currentContent={param4} isIntro={isIntro} />
130+
<HomeViewFooter allParams={allParamsArray} isIntro={isIntro} />
123131
</div>
124132
);
125133
};

src/components/HomeViewContent.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ import "./styles/HomeViewContent.css";
44
import Deerfall from "./projects/Deerfall";
55
import MediaMatchup from "./projects/MediaMatchup";
66
import { useNavigate } from "react-router-dom";
7+
import PersonalIntro from "./projects/PersonalIntro";
78

89
interface Props {
910
currentContent: string | undefined;
11+
isIntro: boolean;
1012
}
1113

12-
const HomeViewContent = ({ currentContent }: Props) => {
14+
const HomeViewContent = ({ currentContent, isIntro }: Props) => {
1315
// - - - - States - - - -
1416
// toggleQueue false = projQueue1, toggleQueue true = projQueue2
1517
const [toggleQueue, setToggleQueue] = useState(false);
1618
const navigate = useNavigate();
1719
// - - - - Projects - - - -
1820
const allProjList = {
21+
intro: <PersonalIntro />,
1922
deerfall: <Deerfall isPortfolio={true} />,
2023
mediamatchup: <MediaMatchup isPortfolio={true} />,
2124
};
@@ -36,10 +39,12 @@ const HomeViewContent = ({ currentContent }: Props) => {
3639
});
3740

3841
useEffect(() => {
39-
if (currentContent) {
42+
if (currentContent && !isIntro) {
4043
setCurrProjArray([eval(`allProjList.${currentContent}`)]);
44+
} else if (isIntro) {
45+
setCurrProjArray([eval("allProjList.intro")]);
4146
}
42-
}, [currentContent]);
47+
}, [currentContent, isIntro]);
4348

4449
return (
4550
<div className='HomeViewContent'>

src/components/HomeViewFooter.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ import "./styles/HomeViewFooter.css";
66

77
interface Props {
88
allParams: string[];
9+
isIntro: boolean;
910
}
1011

11-
const HomeViewFooter = ({ allParams }: Props) => {
12+
const HomeViewFooter = ({ allParams, isIntro }: Props) => {
1213
const currentYear = new Date();
1314
const { hueRotation } = useContext(AppContext);
1415

1516
return (
1617
<div className='HomeViewFooter'>
1718
<div className='project-nav-ctr'>
18-
<div className='project-nav'>
19+
<div className={isIntro ? "project-nav hidden" : "project-nav"}>
1920
<span className='material-symbols-outlined'>chevron_left</span>
2021
<h2>{allParams[3]}</h2>
2122
<span className='material-symbols-outlined'>chevron_right</span>

src/components/HomeViewHeader.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,12 @@ interface Props {
88
subtitle: string;
99
subEmoji: string;
1010
allParams: string[];
11+
isIntro: boolean;
1112
}
1213

13-
const HomeViewHeader = ({ subtitle, subEmoji, allParams }: Props) => {
14+
const HomeViewHeader = ({ subtitle, subEmoji, allParams, isIntro }: Props) => {
1415
// GENERAL
1516
const { hueRotation } = useContext(AppContext);
16-
const [isIntro, setIsIntro] = useState<boolean>(false);
17-
18-
useEffect(() => {
19-
if (allParams[1] === "introduction") {
20-
setIsIntro(true);
21-
} else {
22-
setIsIntro(false);
23-
}
24-
}, [allParams]);
2517

2618
// Some elements in the return will be hidden by media query CSS, to allow UI elements in the header or footer depending on mobile / Desktop. This is why there are some "redundant" elements
2719
return (
@@ -85,8 +77,7 @@ const HomeViewHeader = ({ subtitle, subEmoji, allParams }: Props) => {
8577
</ul>
8678
</div>
8779
</div>
88-
89-
<div className='nav-category-ctr'>
80+
<div className={isIntro ? "hidden" : "nav-category-ctr"}>
9081
<ul>
9182
<li>
9283
<NavLink

src/components/PersonalIntro.tsx renamed to src/components/projects/PersonalIntro.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import "./styles/PersonalIntro.css";
2-
import headshot from "../img/Headshot-PurpleFlannel.png";
1+
import headshot from "../../img/Headshot-PurpleFlannel.png";
32

43
const PersonalIntro = () => {
54
return (

src/components/styles/HomeViewContent.css

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
overflow: hidden;
1010
}
1111

12-
.HomeViewContent .media-ctr {
13-
height: 100%;
14-
width: 100%;
15-
}
16-
1712
.HomeViewContent video {
1813
height: 100%;
1914
object-fit: cover;
@@ -28,6 +23,34 @@
2823
width: 100%;
2924
}
3025

26+
.HomeViewContent .media-ctr {
27+
height: 100%;
28+
width: 100%;
29+
}
30+
31+
.HomeViewContent .PersonalIntro {
32+
display: flex;
33+
align-items: center;
34+
justify-content: center;
35+
box-sizing: border-box;
36+
margin-bottom: 0%;
37+
width: 100%;
38+
height: 100%;
39+
z-index: 1;
40+
border: 10px ridge rgba(0, 255, 221, 0.767);
41+
}
42+
43+
.HomeViewContent .PersonalIntro img {
44+
min-width: 100px;
45+
min-height: 100px;
46+
max-width: 400px;
47+
max-height: 400px;
48+
width: 40vw;
49+
height: auto;
50+
padding: 3px;
51+
border: 10px ridge rgba(255, 0, 255, 0.767);
52+
}
53+
3154
/* - - - - MEDIA QUERIES - - - -*/
3255
@media only screen and (min-width: 768px) {
3356
.HomeViewContent video {

src/components/styles/HomeViewFooter.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
position: absolute;
1616
bottom: 5%;
1717
width: 65vw;
18-
max-width: 350px;
18+
min-width: 235px;
19+
max-width: 375px;
1920
height: 110px;
2021
border-radius: 20px;
2122
/* Flex */
@@ -76,6 +77,11 @@
7677
font-size: 10px;
7778
}
7879

80+
.HomeViewFooter .hidden {
81+
margin: -3px;
82+
visibility: hidden;
83+
}
84+
7985
/* - - - MEDIA QUERIES - - -*/
8086

8187
@media only screen and (min-width: 768px) {

src/components/styles/HomeViewHeader.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@
5454
align-items: center;
5555
list-style: none;
5656
padding: 0px;
57+
width: 181px;
5758
}
5859

5960
.HomeViewHeader .nav-category-ctr ul li {
6061
margin: 0px 10px;
6162
}
6263

64+
.HomeViewHeader .hidden {
65+
display: none;
66+
}
67+
6368
/* - - - MEDIA QUERIES - - -*/
6469
@media only screen and (min-width: 768px) {
6570
.HomeViewHeader {
@@ -105,4 +110,10 @@
105110
margin: 0px 10px;
106111
height: 30px;
107112
}
113+
114+
.HomeViewHeader .hidden {
115+
display: flex;
116+
visibility: hidden;
117+
width: 181px;
118+
}
108119
}

src/components/styles/LandingPage.css

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,6 @@
7272
z-index: 1;
7373
}
7474

75-
.LandingPage .lp-content-ctr .PersonalIntro {
76-
display: flex;
77-
align-items: center;
78-
justify-content: center;
79-
box-sizing: border-box;
80-
margin-bottom: 0%;
81-
width: 100%;
82-
z-index: 1;
83-
}
84-
85-
.LandingPage .lp-content-ctr .PersonalIntro img {
86-
border: 10px ridge rgba(0, 255, 221, 0.767);
87-
padding: 3px;
88-
width: 250px;
89-
}
90-
9175
.LandingPage .lp-content-ctr .nav-ctr {
9276
display: flex;
9377
flex: 5;

src/components/styles/PersonalIntro.css

Whitespace-only changes.

0 commit comments

Comments
 (0)