-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* finished officer modals * added missing files * changed modal to apply to entire officer card * Change title font * Merge main --------- Co-authored-by: Aditi Kumar <[email protected]>
- Loading branch information
Showing
6 changed files
with
184 additions
and
11 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
import styles from "@/styles/OfficerCard.module.css"; | ||
import OfficerModal from "@/components/OfficerModal.js"; | ||
import {useState} from "react"; | ||
|
||
export default function OfficerCard({name, position, netid, officer}) { | ||
const [show, setShow] = useState(false); | ||
|
||
const openModal = () => { | ||
setShow(true); | ||
}; | ||
|
||
const closeModal = () => { | ||
setShow(false); | ||
}; | ||
|
||
export default function OfficerCard({ name, position, img, netid }) { | ||
return ( | ||
<div className={`${styles.container}`}> | ||
<img | ||
className={`${styles.img}`} | ||
src={`/assets/img/officers/${netid}.jpg`} | ||
></img> | ||
<h2 className={`${styles.name}`}>{name}</h2> | ||
<p className={`${styles.position}`}>{position}</p> | ||
</div> | ||
<> | ||
<div className={`${styles.container}`} onClick={openModal}> | ||
<img | ||
className={`${styles.img}`} | ||
src={`/assets/img/officers/${netid}.jpg`} | ||
></img> | ||
<h2 className={`${styles.name}`}>{name}</h2> | ||
<p className={`${styles.position}`}>{position}</p> | ||
</div> | ||
|
||
<OfficerModal isOpen={show} closeModal={closeModal} officer={officer} /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import ComputerWindow from "./ComputerWindow"; | ||
import styles from "@/styles/OfficerModal.module.css"; | ||
|
||
export default function OfficerModal({isOpen, closeModal, officer}) { | ||
return isOpen ? OfficerInformation(closeModal, officer) : null; | ||
} | ||
|
||
function OfficerInformation( | ||
closeModal, | ||
officer | ||
) { | ||
return ( | ||
<> | ||
<div className={styles.container}> | ||
<ComputerWindow className={styles.window} topbarColor="#D2616C"> | ||
<div className={styles.officerInfo}> | ||
<h3 className={styles.title}>{officer.name} - {officer.position}</h3> | ||
|
||
<div className="columnContainer"> | ||
<div className={styles.left}> | ||
<img | ||
className={`${styles.photo}`} | ||
src={`/assets/img/officers/${officer.netid}.jpg`} | ||
></img> | ||
</div> | ||
|
||
<div className={styles.right}> | ||
<p><b>Major:</b> {officer.major}</p> | ||
<p><b>Year:</b> {officer.year}</p> | ||
<p><b>From:</b> {officer.place}</p> | ||
<p><b>Involvements:</b> {officer.involvements}</p> | ||
<p><b>Interests:</b> {officer.interests}</p> | ||
<p><b>Hobbies:</b> {officer.hobbies}</p> | ||
<p><b>Fun Fact:</b> {officer.fact}</p> | ||
<p><b>Advice:</b> {officer.advice}</p> | ||
<br></br> | ||
|
||
<a href={officer.email}> | ||
<img | ||
className={`${styles.socials}`} | ||
src="assets/img/logos/contacts/email.png" | ||
></img> | ||
</a> | ||
<a href={officer.linkedin}> | ||
<img | ||
className={`${styles.socials}`} | ||
src="assets/img/logos/contacts/linkedin.png" | ||
></img> | ||
</a> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
</div> | ||
<button onClick={closeModal} className={styles.closeButton}> | ||
Close | ||
</button> | ||
</ComputerWindow> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
justify-content: space-between; | ||
padding: 2rem; | ||
margin: 1rem; | ||
cursor: pointer; | ||
} | ||
|
||
.img { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
.closeButton { | ||
width: 100%; | ||
height: 3rem; | ||
border: none; | ||
color: #21636c; | ||
background-color: #e9e1e6; | ||
font-weight: 700; | ||
font-size: 16px; | ||
} | ||
|
||
.columnContainer { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
width: 100%; | ||
gap: 2rem; | ||
} | ||
|
||
.container { | ||
width: 100svw; | ||
height: 100svh; | ||
position: fixed; | ||
inset: 0; | ||
z-index: 999; | ||
background-color: rgba(10, 10, 10, 0.6); | ||
} | ||
|
||
.officerInfo { | ||
padding: 1rem 5svw 1rem 5svw; | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
max-height: 85svh; | ||
overflow-y: auto; | ||
} | ||
|
||
.officerInfo .left { | ||
width: calc(50% - 10px); | ||
padding: 10px; | ||
box-sizing: border-box; | ||
float: left; | ||
} | ||
|
||
.officerInfo .right { | ||
width: calc(50% - 10px); | ||
padding: 10px; | ||
box-sizing: border-box; | ||
float: right; | ||
text-align: left; | ||
} | ||
|
||
@media (max-width: 767px) { | ||
.officerInfo .left, | ||
.officerInfo .right { | ||
width: 100%; | ||
} | ||
} | ||
|
||
.photo { | ||
border: 6px solid #65c7cc; | ||
border-radius: 10%; | ||
height: 400px; | ||
width: 400px; | ||
object-fit: cover; | ||
max-width: 100%; | ||
} | ||
|
||
.socials { | ||
height: 100px; | ||
width: 100px; | ||
margin: 1%; | ||
object-fit: cover; | ||
max-width: 100%; | ||
float: right; | ||
} | ||
|
||
.title { | ||
font-family: "Audiowide" !important; | ||
margin-bottom: 1rem; | ||
font-size: 36px; | ||
font-weight: 400; | ||
color: #65c7cc; | ||
} | ||
|
||
.window { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
max-width: 90svw; | ||
width: max-content; | ||
} |