Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved Serving "About" page and added a Responsive Navbar along with more Styling #59

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 9 additions & 47 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,28 @@ import Wife from "./components/Wife";
import Footer from "./components/Footer";
import Confirm from "./components/Confirm";
import HowCanYouHelp from "./components/HowCanYouHelp";
import Navbar from "./components/Navbar";
import "./components/My.css";
import { BrowserRouter as Router, Routes, Route, Link } from "react-router-dom";
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import About from "./components/About";

function App() {
const refreshAboutPage = () => {
setTimeout(() => {
window.location.reload();
}, 50);
};


return (
<div className="App">
<Router>
<div className="spacer layer1"></div>
<nav className="mainnav">
<ul>
<a
href={window.location.pathname === "/about" ? "/" : "#wifeplay"}
style={{ color: "green" }}
>
<li
className="navclass news "
id="navbarid"
onClick={
window.location.pathname === "/about"
? refreshAboutPage
: null
}
>
{window.location.pathname === "/" ? "Play" : "Home"}
</li>
</a>

<a
href="https://github.com/1Shubham7"
target="_blank"
rel="noreferrer"
>
<li className="news">GitHub</li>
</a>
<a
href="https://www.linkedin.com/in/shubham-singh-mahar-5a002b20b/"
target="_blank"
rel="noreferrer"
>
<li className="news">LinkedIn</li>
</a>
<Link to="/about" onClick={refreshAboutPage}>
<li className="news">About</li>
</Link>
</ul>
</nav>

<Routes>
<Route path="/about" element={<About />} />
<Route path="/about" element={<>
<Navbar/>
<About/>
</>} />
<Route
path="/"
element={
<>
<Navbar/>
<Wife />
<Confirm />
<HowCanYouHelp />
Expand Down
86 changes: 35 additions & 51 deletions src/components/About.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,41 @@
import React from 'react'
import './photo.css'
import "./App.css";
import Wife from "./components/Wife";
import Footer from "./components/Footer";
import Confirm from "./components/Confirm";
import HowCanYouHelp from "./components/HowCanYouHelp";
import Navbar from "./components/Navbar";
import "./components/My.css";
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import About from "./components/About";

export default function About() {
const wifestyle2 = {
margin: '0',
background: 'yellow',
position: 'relative',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
padding: "100px 20vw",
minHeight: '200px',
color: 'green'
// fontFamily:
}

return (
<>
<div className="superClass" style={{ backgroundColor: 'yellow', color: 'green', paddingTop: '40px', paddingBottom: '40px' }}>

<div className="circular-image" >
<img
src="CVmin.jpg"
style={{
width: "300px",
height: "300px",
borderRadius: "50%",
overflow: "hidden",
border: "5px solid green",
boxSizing: "border-box",
animation: "border-pulse 2s infinite"
function App() {



}}
alt="Shubham Singh"
return (
<div className="App">
<Router>
<Routes>
<Route path="/about" element={<>
<Navbar/>
<About/>
</>} />
<Route
path="/"
element={
<>
<Navbar/>
<Wife />
<Confirm />
<HowCanYouHelp />
</>
}
/>

</div >
<div className="text" style={{ textAlign: 'center', justifyContent: 'center' }}>

<section style={wifestyle2} >
<h1 style={{ textDecoration: 'underline' }}>About Me</h1>
<p>This is Shubham Singh Mahar. I am a First Year Undergrad pursuing
Bachelors in Technology with Computer Science Eng. major from a tier-3 college in Ghaziabad.
I am from Haldwani, Nanital, Uttarakhand.
The code for this project is available in the GitHub repository <a href="https://github.com/1Shubham7/Wife-Predictor">Wife-Predictor</a>.
Starring the repository on GitHub would be really helpful!</p>
<p>Do check out my blog <a href="https://1shubham7.hashnode.dev/">1Shubham7</a>.</p>
</section>
</div>
</div>

</>
</Routes>
<Footer />
</Router>
</div>
);
}

export default App;
6 changes: 3 additions & 3 deletions src/components/Confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function ConfirmationCheckbox() {
<div
id="wifeplay"
style={{
backgroundColor: "green",
color: "white",
background: "yellow",
color: "green",
fontSize: "20px",
paddingTop: "120px",
paddingBottom: "120px",
Expand Down Expand Up @@ -217,4 +217,4 @@ function ConfirmationCheckbox() {
);
}

export default ConfirmationCheckbox;
export default ConfirmationCheckbox;
2 changes: 1 addition & 1 deletion src/components/HowCanYouHelp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function HowCanYouHelp() {
const wifestyle2 = {
margin: '0',
color: 'white',
background: 'green',
background: 'linear-gradient(to right,green,blue)',
position: 'relative',
display: 'flex',
flexDirection: 'column',
Expand Down
45 changes: 26 additions & 19 deletions src/components/My.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,24 @@
position: absolute;
}

.mainnav ul{
.navbar{
background-image: url('../../public/NavlayerOne.svg');
aspect-ratio: 3/1;
width: 100%;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}

.navbar ul{
padding-top: 30%;
width: 50%;
margin: auto;
display: flex;
justify-content: center;
}

.mainnav ul li{
.navbar ul li{
margin: 0 24px;
margin-top:-150px;
list-style: none;
Expand Down Expand Up @@ -61,26 +73,10 @@
line-height: 0;
}

.spacer{
aspect-ratio: 960/300;
width: 100%;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}

.layer1{
background-image: url('../../public/NavlayerOne.svg');
}

.flip{
transform: rotate(180deg);
}

.navlayer{
background-image: url('../../public/NavlayerOne.svg');
}

.news:hover::after{
/* transform: scale(1.1); */
transition: 400ms;
Expand Down Expand Up @@ -192,4 +188,15 @@ html{
color: green;
}

}
}

@media only screen and (max-width: 769px) {
.navbar ul{
margin-top: 10%;
overflow: scroll;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
}
42 changes: 42 additions & 0 deletions src/components/Navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { useNavigate } from 'react-router-dom';


export default function Navbar(){

let navigate=useNavigate();

return(
<div className='navbar' >
<ul>
<a
href={window.location.pathname === "/about" ? "/" : "#wifeplay"}
style={{ color: "green" }}
>
<li
className="navclass news "
id="navbarid"

>
{window.location.pathname === "/about" ? "Home" : "Play"}
</li>
</a>

<a
href="https://github.com/1Shubham7"
target="_blank"
rel="noreferrer"
>
<li className="news">GitHub</li>
</a>
<a
href="https://www.linkedin.com/in/shubham-singh-mahar-5a002b20b/"
target="_blank"
rel="noreferrer"
>
<li className="news">LinkedIn</li>
</a>
<li className="news" onClick={()=>{navigate('/about')}}>About</li>
</ul>
</div>
);
}
2 changes: 1 addition & 1 deletion src/components/Wife.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function Wife() {
const wifestyle = {
margin: '0',
color: 'white',
background: 'green',
background: 'linear-gradient(to right,green,blue)',
position: 'relative',
display: 'flex',
flexDirection: 'column',
Expand Down