Skip to content

Commit 43fdd60

Browse files
authored
Merge pull request #43 from FAC-Sixteen/feature/styling-factpage
Feature/styling factpage
2 parents 1f2c3b7 + d90f354 commit 43fdd60

File tree

5 files changed

+105
-15
lines changed

5 files changed

+105
-15
lines changed

src/assets/FactBubble.png

49.1 KB
Loading

src/assets/GreenComicBG.jpg

31.3 KB
Loading

src/components/factPage/FactPage.js

+35-12
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,47 @@ import { Link } from "react-router-dom";
33
import Header from "../header/Header";
44
import Main from "../main/Main";
55

6+
import {
7+
StyledFactPage,
8+
FactBubble,
9+
FactBubbleContainer,
10+
FactBubbleFact,
11+
WiseManContainer,
12+
WiseMan,
13+
WiseManText,
14+
} from "./FactPage.style";
15+
import { LargeButton } from "../button/Button";
16+
import FactBubbleImg from "../../assets/FactBubble.png";
17+
import WiseManSvg from "../avatars/wise-man.svg";
18+
619
const FactPage = ({ location: { score, data } }) => {
720
return (
821
<React.Fragment>
922
<Header text="Results" />
1023
<Main>
11-
<p>
12-
Hey, well done! Just before we see your score, did you know:
13-
</p>
14-
<div>{data[0].Fact}</div>
15-
<Link
16-
to={{
17-
pathname: "/results",
24+
<StyledFactPage>
25+
<WiseManContainer>
26+
<WiseManText>
27+
Hey, well done! Just before we see your score, did
28+
you know:
29+
</WiseManText>
30+
<WiseMan src={WiseManSvg} />
31+
</WiseManContainer>
32+
33+
<FactBubbleContainer>
34+
<FactBubbleFact>{data[0].Fact}</FactBubbleFact>
35+
<FactBubble src={FactBubbleImg} />
36+
</FactBubbleContainer>
1837

19-
score: score,
20-
}}
21-
>
22-
See Your Results!
23-
</Link>
38+
<Link
39+
to={{
40+
pathname: "/results",
41+
score: score,
42+
}}
43+
>
44+
<LargeButton>See Your Results!</LargeButton>
45+
</Link>
46+
</StyledFactPage>
2447
</Main>
2548
</React.Fragment>
2649
);
+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import styled from "styled-components";
2+
import GreenComicBG from "../../assets/GreenComicBG.jpg";
3+
import FactBubbleImg from "../../assets/FactBubble.png";
4+
5+
const StyledFactPage = styled.div`
6+
background-image: url(${GreenComicBG});
7+
background-repeat: no-repeat;
8+
background-size: cover;
9+
background-position: center center;
10+
font-family: Bangers;
11+
font-style: normal;
12+
font-weight: normal;
13+
display: flex;
14+
flex-wrap: wrap;
15+
justify-content: center;
16+
`;
17+
const FactBubbleContainer = styled.div`
18+
width: 40em;
19+
height: 32em;
20+
position: relative;
21+
display: flex;
22+
justify-content: center;
23+
`;
24+
25+
const FactBubble = styled.img`
26+
width: 40em;
27+
height: auto;
28+
`;
29+
const FactBubbleFact = styled.div`
30+
width: 16em;
31+
text-align: center;
32+
font-size: 1.5em;
33+
margin: auto;
34+
position: absolute;
35+
height: inherit;
36+
display: flex;
37+
flex-direction: column;
38+
justify-content: center;
39+
transform: rotate(-20deg);
40+
`;
41+
42+
const WiseManContainer = styled.div`
43+
width: 32em;
44+
`;
45+
46+
const WiseManText = styled.div`
47+
width: fit-content;
48+
border: 4px solid black;
49+
border-radius: 1em;
50+
background-color: white;
51+
padding: 1em;
52+
margin: 3em;
53+
`;
54+
55+
const WiseMan = styled.img`
56+
width: 16em;
57+
`;
58+
59+
export {
60+
StyledFactPage,
61+
FactBubble,
62+
FactBubbleContainer,
63+
FactBubbleFact,
64+
WiseManContainer,
65+
WiseMan,
66+
WiseManText,
67+
};

src/components/game/Game.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Main from "../main/Main";
1414

1515
const Game = ({ data }) => {
1616
const [score, setScore] = React.useState(0);
17-
const [time, setTime] = React.useState(10);
17+
const [time, setTime] = React.useState(2);
1818
const [items, setItems] = React.useState(formatData(data));
1919
const [showModal, setShowModal] = React.useState(false);
2020
const [active, setActive] = React.useState(false);
@@ -79,7 +79,7 @@ const Game = ({ data }) => {
7979
);
8080

8181
return (
82-
<React.Fragment data-testid="game">
82+
<div data-testid="game">
8383
<Header text="Game" />
8484
<Main>
8585
<div>
@@ -134,7 +134,7 @@ const Game = ({ data }) => {
134134
</Link>
135135
</ReactModal>
136136
</Main>
137-
</React.Fragment>
137+
</div>
138138
);
139139
};
140140

0 commit comments

Comments
 (0)