sdy

add main component style

1 import React from "react"; 1 import React from "react";
2 import styled from "styled-components"; 2 import styled from "styled-components";
3 +import Button from "./Button";
3 import Laptop from "../Imgs/laptop.jpg"; 4 import Laptop from "../Imgs/laptop.jpg";
5 +import Phone from "../Imgs/leftImage.jpg";
4 6
5 const Main = styled.main` 7 const Main = styled.main`
6 display: flex; 8 display: flex;
...@@ -8,8 +10,12 @@ const Main = styled.main` ...@@ -8,8 +10,12 @@ const Main = styled.main`
8 `; 10 `;
9 11
10 const Section = styled.section` 12 const Section = styled.section`
11 - padding: 10rem 0; 13 + padding-top: 8rem;
14 + padding-bottom: 5rem;
12 max-width: none; 15 max-width: none;
16 + &.color-section {
17 + background-color: #341f97;
18 + }
13 `; 19 `;
14 20
15 const SectionBox = styled.div` 21 const SectionBox = styled.div`
...@@ -21,15 +27,60 @@ const SectionBox = styled.div` ...@@ -21,15 +27,60 @@ const SectionBox = styled.div`
21 margin: 0 auto; 27 margin: 0 auto;
22 `; 28 `;
23 29
24 -const DescriptionBox = styled.div``; 30 +const DescriptionBox = styled.div`
31 + p {
32 + font-size: 1.1rem;
33 + word-spacing: 7px;
34 + line-height: 1.4;
35 + }
36 +`;
37 +
38 +const TitleBox = styled.div`
39 + margin-bottom: 10px;
40 + font-size: 2rem;
41 + font-weight: 600;
25 42
26 -const TitleBox = styled.div``; 43 + &.color-title {
44 + color: #ffffff;
45 + }
46 +`;
27 47
28 const IllustrationBox = styled.div``; 48 const IllustrationBox = styled.div``;
29 49
30 const Image = styled.img` 50 const Image = styled.img`
31 - src: url(${(props) => props.src}); 51 + width: 100%;
32 - alt: ${(props) => props.alt}; 52 + height: 100%;
53 +`;
54 +
55 +const ColorBox = styled.div`
56 + max-width: 80%;
57 + margin: 0 auto;
58 + display: flex;
59 + flex-direction: column;
60 + justify-content: center;
61 + align-items: center;
62 +`;
63 +
64 +const ButtonBox = styled.div`
65 + display: flex;
66 + flex-direction: row;
67 + padding: 10px;
68 + button {
69 + cursor: pointer;
70 + width: 200px;
71 + height: 50px;
72 + background-color: #474787;
73 + color: white;
74 + border-radius: 10px;
75 + &:not(:last-child) {
76 + margin-right: 10px;
77 + }
78 + &:last-child {
79 + background-color: white;
80 + border: 1px solid #474787;
81 + color: #474787;
82 + }
83 + }
33 `; 84 `;
34 85
35 export default () => { 86 export default () => {
...@@ -57,6 +108,37 @@ export default () => { ...@@ -57,6 +108,37 @@ export default () => {
57 </IllustrationBox> 108 </IllustrationBox>
58 </SectionBox> 109 </SectionBox>
59 </Section> 110 </Section>
111 + <Section>
112 + <SectionBox>
113 + <IllustrationBox>
114 + <Image src={Phone} alt={"Back Image"}></Image>
115 + </IllustrationBox>
116 + <DescriptionBox>
117 + <TitleBox>Why do we use it?</TitleBox>
118 + <p>
119 + It is a long established fact that a reader will be distracted by
120 + the readable content of a page when looking at its layout. The
121 + point of using Lorem Ipsum is that it has a more-or-less normal
122 + distribution of letters, as opposed to using 'Content here,
123 + content here', making it look like readable English. Many desktop
124 + publishing packages and web page editors now use Lorem Ipsum as
125 + their default model text, and a search for 'lorem ipsum' will
126 + uncover many web sites still in their infancy. Various versions
127 + have evolved over the years, sometimes by accident, sometimes on
128 + purpose (injected humour and the like).
129 + </p>
130 + </DescriptionBox>
131 + </SectionBox>
132 + </Section>
133 + <Section className="color-section">
134 + <ColorBox>
135 + <TitleBox className="color-title">Ipsum Lorem</TitleBox>
136 + <ButtonBox>
137 + <Button text={"Ipsum"} />
138 + <Button text={"Lorem"} />
139 + </ButtonBox>
140 + </ColorBox>
141 + </Section>
60 </Main> 142 </Main>
61 ); 143 );
62 }; 144 };
......