Skip to content

Commit 652b543

Browse files
authored
Merge pull request #151 from alefever39/alefever39/#93-add-dark-mode
added light/dark mode
2 parents 38984d4 + 385c3f9 commit 652b543

File tree

2 files changed

+116
-10
lines changed

2 files changed

+116
-10
lines changed

src/cards/AlliesCard/AlliesCard.jsx

+39-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,56 @@
1-
import React from "react";
1+
import React, { useState } from "react";
22
import "./AlliesCard.scss";
33
import image from "./allies_headshot.JPG";
44

55
function AlliesCard() {
6+
const [darkMode, setDarkMode] = useState(false);
7+
8+
function toggleDarkMode() {
9+
if (darkMode === false) {
10+
setDarkMode(true);
11+
} else {
12+
setDarkMode(false);
13+
}
14+
}
15+
616
return (
7-
<div className="cardContainer">
8-
<div className="card">
17+
<div className={`${darkMode ? "dark" : "light"}AllieCardContainer`}>
18+
<div className="alliecard">
919
<img
1020
className="allieImageContainer"
1121
src={image}
1222
alt="Smiling tall white woman with long blonde hair wearing glasses and a red and deep blue floral print blouse sits in front of a white brick wall"
1323
/>
1424
</div>
1525

16-
<div className="card">
26+
<div className="alliecard">
1727
<h3>Allie LeFever</h3>
1828
<p>Software Engineer</p>
19-
<a href="https://www.linkedin.com/in/allie-lefever/">LinkedIn</a>
29+
<button className="allieLinkButton">
30+
<a
31+
className="allieLink"
32+
href="https://www.linkedin.com/in/allie-lefever/"
33+
>
34+
LinkedIn
35+
</a>
36+
</button>
37+
<button className="allieLinkButton">
38+
<a className="allieLink" href="https://github.com/alefever39">
39+
GitHub
40+
</a>
41+
</button>
42+
</div>
43+
44+
<div></div>
45+
<div className="allieDarkButtonContainer">
46+
<button
47+
onClick={toggleDarkMode}
48+
className={`allieDarkButton ${
49+
darkMode ? "dark" : "light"
50+
}AllieDarkButton`}
51+
>
52+
{darkMode ? "Light Mode" : "Dark Mode"}
53+
</button>
2054
</div>
2155
</div>
2256
);

src/cards/AlliesCard/AlliesCard.scss

+77-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,96 @@
1-
.cardContainer {
1+
.lightAllieCardContainer {
22
display: grid;
33
grid-template-columns: 1fr 1fr;
44
grid-template-rows: auto;
5+
// border: 2px solid blue;
56
align-items: center;
7+
background-image: linear-gradient(
8+
30deg,
9+
rgb(255, 104, 162),
10+
rgb(248, 185, 185)
11+
);
612
}
7-
.card {
13+
14+
.darkAllieCardContainer {
15+
display: grid;
16+
grid-template-columns: 1fr 1fr;
17+
grid-template-rows: auto;
18+
// border: 2px solid blue;
19+
align-items: center;
20+
background-image: linear-gradient(30deg, rgb(190, 18, 196), rgb(184, 15, 80));
21+
color: white;
22+
}
23+
24+
.alliecard {
825
margin: auto;
926
//padding: 1rem 1rem 1rem 1rem;
1027
//align-items: right;
1128
text-align: center;
12-
//border: 2px solid white;
1329
}
14-
.image {
30+
31+
.allieimage {
1532
background-image: url(./allies_headshot.JPG);
1633
}
34+
1735
.allieImageContainer {
1836
//align-items: left;
1937
width: 120px;
2038
height: auto;
2139
margin: auto;
2240
border-radius: 50%;
23-
box-shadow: 5px 10px #00ffff44;
41+
box-shadow: 5px 10px #02272744;
42+
}
43+
44+
.allieLinkButton {
45+
background-color: rgba(40, 42, 212, 0.781);
46+
border-radius: 2rem;
47+
width: auto;
48+
margin-left: 0.2rem;
49+
margin-right: 0.2rem;
50+
}
51+
52+
.allieLink {
53+
color: white;
54+
font-size: 1rem;
55+
text-decoration: none;
56+
}
57+
58+
.allieLink:hover {
59+
color: rgba(255, 255, 255, 0.705);
60+
font-size: 1rem;
61+
text-decoration: none;
62+
}
63+
64+
.allieDarkButtonContainer {
65+
display: flex;
66+
justify-content: flex-end;
67+
align-items: flex-end;
68+
}
69+
70+
.allieDarkButton {
71+
border-radius: 2rem;
72+
font-size: 0.8rem;
73+
width: auto;
74+
height: 1.5rem;
75+
}
76+
77+
.lightAllieDarkButton {
78+
background-color: rgb(51, 206, 226);
79+
transition: all 0.5s;
80+
}
81+
82+
.lightAllieDarkButton:hover {
83+
background-color: rgb(29, 88, 177);
84+
color: white;
85+
}
86+
87+
.darkAllieDarkButton {
88+
background-color: rgb(29, 88, 177);
89+
color: white;
90+
transition: all 0.5s;
91+
}
92+
93+
.darkAllieDarkButton:hover {
94+
background-color: rgb(51, 206, 226);
95+
color: black;
2496
}

0 commit comments

Comments
 (0)