Skip to content

Commit

Permalink
crew page
Browse files Browse the repository at this point in the history
  • Loading branch information
surya-tamang committed Jun 16, 2024
1 parent b4714a3 commit 8364912
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 45 deletions.
21 changes: 20 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.23.1"
"react-router-dom": "^6.23.1",
"swiper": "^11.1.4"
},
"devDependencies": {
"@types/react": "^18.2.66",
Expand Down
45 changes: 40 additions & 5 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@

/*---------------home page styling---------------*/


.home_page,
.crew_page,
.destination_page,
.technology_page {
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}

.home_page {
background: url('/src/assets/home/background-home-desktop.jpg')
}
Expand All @@ -15,8 +25,14 @@

.crew_page {
background: url('/src/assets/crew/background-crew-desktop.jpg');

}

.frame {
width: 35rem;
}


/*---------------destination page styling---------------*/

.destination_page {
Expand All @@ -32,11 +48,21 @@

.navs:hover::after,
.dest_button:hover:after,
.navs_active::after,
.dest_active::after {
.navs_active::after {
scale: 1;
}

.dest_active::after {
content: "";
background-color: white;
height: 3px;
width: 100%;
position: absolute;
bottom: 0;
scale: 1.5;
left: 0;
}

.navs::after,
.dest_button::after {
content: "";
Expand Down Expand Up @@ -91,6 +117,16 @@ h1.space {

.destination_content {
flex-direction: column;
margin-top: 0;
gap: 10px;
}

.heading_div {
margin: 0;
}

.heading {
font-size: 20px;
}

.imgBox img {
Expand All @@ -99,7 +135,7 @@ h1.space {

.imgBox,
.desBox {
width: 80%;
width: 90%;
}

.technology_page {
Expand All @@ -117,8 +153,7 @@ h1.space {
}

.navs {
font-size: 13px;
margin: 0 5px;
font-size: 10px;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Header = () => {
};

return (
<div className="header absolute flex w-full top-10 justify-between px-12 items-center">
<div className="header absolute flex w-full top-10 justify-between px-12 items-center z-10">
<NavLink className="logo" to={"/space-tourism/"}>
<img src="logo.svg" alt="logo" />
</NavLink>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Heading.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
const Heading = ({ title, index }) => {
return (
<div className="heading_div mt-8">
<h1 className="heading ml-12 text-3xl font-thin uppercase md:text-1xl md-bg-slate-200">
<h1 className="heading ml-28 text-3xl font-thin uppercase md:text-1xl md-bg-slate-200 text-slate-50">
<span className="font-bold text-slate-400">{index}</span> {title}
</h1>
</div>
Expand Down
28 changes: 8 additions & 20 deletions src/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,26 @@
],
"crew": [
{
"name": "Douglas Hurley",
"images": {
"png": "./assets/crew/image-douglas-hurley.png",
"webp": "./assets/crew/image-douglas-hurley.webp"
},
"crewName": "Douglas Hurley",
"images": "src/assets/crew/image-douglas-hurley.png",
"role": "Commander",
"bio": "Douglas Gerald Hurley is an American engineer, former Marine Corps pilot and former NASA astronaut. He launched into space for the third time as commander of Crew Dragon Demo-2."
},
{
"name": "Mark Shuttleworth",
"images": {
"png": "./assets/crew/image-mark-shuttleworth.png",
"webp": "./assets/crew/image-mark-shuttleworth.webp"
},
"crewName": "Mark Shuttleworth",
"images": "src/assets/crew/image-mark-shuttleworth.png",
"role": "Mission Specialist",
"bio": "Mark Richard Shuttleworth is the founder and CEO of Canonical, the company behind the Linux-based Ubuntu operating system. Shuttleworth became the first South African to travel to space as a space tourist."
},
{
"name": "Victor Glover",
"images": {
"png": "./assets/crew/image-victor-glover.png",
"webp": "./assets/crew/image-victor-glover.webp"
},
"crewName": "Victor Glover",
"images": "src/assets/crew/image-victor-glover.png",
"role": "Pilot",
"bio": "Pilot on the first operational flight of the SpaceX Crew Dragon to the International Space Station. Glover is a commander in the U.S. Navy where he pilots an F/A-18.He was a crew member of Expedition 64, and served as a station systems flight engineer."
},
{
"name": "Anousheh Ansari",
"images": {
"png": "./assets/crew/image-anousheh-ansari.png",
"webp": "./assets/crew/image-anousheh-ansari.webp"
},
"crewName": "Anousheh Ansari",
"images": "src/assets/crew/image-anousheh-ansari.png",
"role": "Flight Engineer",
"bio": "Anousheh Ansari is an Iranian American engineer and co-founder of Prodea Systems. Ansari was the fourth self-funded space tourist, the first self-funded woman to fly to the ISS, and the first Iranian in space."
}
Expand Down
15 changes: 15 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

.swiper-slide {
text-align: center;
font-size: 18px;
display: flex;
justify-content: center;
align-items: center;
}

.swiper-slide img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
53 changes: 47 additions & 6 deletions src/pages/Crew.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,52 @@
import React from 'react'
import React, { useState } from "react";
import Heading from "../components/Heading";

import dataJson from "../data.json";

const Crew = () => {
const crewData = dataJson.crew;
const [currentIndex, setCurrentIndex] = useState(0);
return (
<div className='crew_page min-h-screen w-full'>

<div className="crew_page min-h-screen w-full flex items-start flex-col justify-center overflow-hidden pt-36 pb-7 relative">
<Heading title={"meet our crew"} index={"02"} />
<div className="frame h-96 flex overflow-hidden ml-28 mt-20">
{crewData.map((item, index) => {
const { crewName, role, bio } = item;
return (
<div
key={index}
style={{ transform: `translateX(-${currentIndex}00%)` }}
className="slider min-w-full h-80 text-slate-50 flex flex-col gap-8 tracking-widest"
>
<p className="text-4xl font-thin">{role}</p>
<h1 className="text-6xl font-light">{crewName}</h1>
<p className="text-1xl"> {bio}</p>
</div>
);
})}
</div>
<div className="w-40 h-7 ml-28 flex gap-3">
{crewData.map((item, index) => {
return (
<button
key={index}
className={`dots h-5 w-5 rounded-full bg-slate-50 ${
index === currentIndex ? "opacity-100" : "opacity-40"
}`}
onClick={() => setCurrentIndex(index)}
/>
);
})}
</div>
<div>
<img
src={crewData[currentIndex].images}
alt={crewData[currentIndex].crewName}
className="crewImage absolute bottom-0 right-10 w-96 h-auto object-cover"
/>
</div>
</div>
)
}
);
};

export default Crew
export default Crew;
17 changes: 9 additions & 8 deletions src/pages/Destination.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ const Destination = () => {
<img src={image} alt="destination" />
</div>
<div className="desBox w-6/12">
<div className="flex gap-4">
<div className="flex gap-4 h-20 items-center">
{destinationList.map((item, index) => {
const { dest_name } = item;
return (
<button
className={`dest_button uppercase relative p-2 ${
className={`${
selectedDestination.dest_name === dest_name
? "dest_active"
? "text-3xl"
: ""
}`}
}
dest_button uppercase relative p-2 `}
key={index}
onClick={() => handleClick(dest_name)}
>
Expand All @@ -64,14 +65,14 @@ const Destination = () => {
);
})}
</div>
<div>
<h1 className="text-9xl uppercase my-6">
<div className="h-72">
<h1 className="text-9xl uppercase my-1">
{selectedDestination.dest_name}
</h1>
<p>{selectedDestination.description}</p>
</div>
<hr className="bg-slate-400 my-8 opacity-40" />
<div className="flex gap-44">
<hr className="bg-slate-400 opacity-40" />
<div className="flex gap-44 mt-5">
<div>
<h1 className="font-thin text-1xl uppercase">Avg. distance</h1>
<p className="text-3xl font-extralight uppercase">
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";

import "../index.css";
import { NavLink } from "react-router-dom";

const Home = () => {
return (
Expand All @@ -14,9 +15,9 @@ const Home = () => {
back, and relax because we'll give you safety
</p>
</article>
<button className="h-52 w-52 bg-slate-50 rounded-full uppercase">
<NavLink className="h-52 w-52 bg-slate-50 rounded-full uppercase flex items-center justify-center font-bold text-2xl tracking-wider" to={'/space-tourism/destination'}>
explore
</button>
</NavLink>
</div>
);
};
Expand Down

0 comments on commit 8364912

Please sign in to comment.