Home https://paint-box.com 2
Post
Cancel

https://paint-box.com 2

style.scss

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
@import url("https://fonts.googleapis.com/css?family=Montserrat:400,500&display=swap");
@import url("https://fonts.googleapis.com/css?family=Caladea:400&display=swap");
@import "_variables";
@import "_titles";

* {
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: inherit;
  @extend %miniTitle;
}

body {
  font-family: "Caladea"; // 두번째 url 에서 뽑아온것
  padding-top: 70px;
}

body > *:not(.footer) {
  padding: 0px 140px;
} // 맨위의 코드에서 모든 태그가 border-box 안으로 들어가게 했다. 근데 원본을 보면 footer부분은 width가 삐져나온걸 알 수 있다.
// 그래서 직계자손중 footer만 저 값을 준다는 뜻이다. 만약 ">"는 직계자손을 선택한다는 뜻. "*" 는 모두를 선택한다는뜻. 즉, 직계자손 전부라는 뜻.
// 만약 "*"만 있으면 안에 있는 모든 태그를 다 선택한다는 뜻이다.

header {
  z-index: 1; // 위쪽으로 항상 튀어나오게 하는 property
  position: fixed;
  width: 100%;
  top: 0; // 맨 위로 가게 함.
  left: 0;
  padding: 0px 40px; // 위아래 왼쪽오른쪽 이렇게 설정됨
  background-color: white;
  height: 70px;
  display: flex;
  align-items: center;

  nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    img {
      width: 70px;
      height: 55px;
    }
    ul {
      display: flex;
      justify-content: space-between;
      @extend %miniTitle;
      &:first-child {
        li {
          margin-right: 60px;
        }
      }
    }
  }
}

.hero {
  height: 100vh;
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)),
    url("https://images.unsplash.com/photo-1535137755190-8a0b337717e9?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=80");
  background-size: cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  margin: 0px $sideSpace;

  h4 {
    @extend %miniTitle;
    margin-bottom: 90px;
  }
  h3 {
    font-size: 40px;
    width: 35%;
    text-align: center;
    margin-bottom: 70px;
    font-weight: 50;
  }
  a {
    width: 10%;
    border: solid 2px;
    padding: 10px 8px;
    text-align: center;
    text-decoration: none;
    color: rgb(255, 255, 255);
    @extend %miniTitle;
    transition: color 0.3s linear, background 0.3s linear; // 글자 color 가 0.3초 동안 일정하게 바뀜, 배경 색이 0.3초동안 일정하게 바뀜.
    &:hover {
      background-color: white;
      color: black;
    }
  }
}

.under_hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  padding: 100px;
  width: 100%;
  .under_hero_content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: $bg;
    .wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      h4 {
        @extend %miniTitle;
        margin-bottom: 30px;
      }
      h3 {
        font-size: 26px;
        text-align: center;
        margin-bottom: 50px;
        width: 55%;
      }
      a {
        width: 50%;
        border: solid 2px;
        padding: 10px 8px;
        text-align: center;
        text-decoration: none;
        color: black;
        @extend %miniTitle;
        transition: color 0.3s linear, background 0.3s linear; // 글자 color 가 0.3초 동안 일정하게 바뀜, 배경 색이 0.3초동안 일정하게 바뀜.
        &:hover {
          background-color: black;
          color: white;
        }
      }
    }
  }
}

.blog {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, 60vh);
  margin-bottom: 80px;
  padding: 0px 150px;
  .blog_post {
    background-color: $bg;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    &:nth-child(even) {
      img {
        order: 1; // 두번째 blog_post 에 속해있는 img 를 의미
      }
    }
    img {
      width: 100%;
      height: 100%;
      //blog_post 에 속해있는 모든 이미지를 의미. 위의 코드가 없으면 사진이 삐져나옴.
    }
    .post_content {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      .post_date {
        @extend %miniTitle;
        margin-bottom: 70px;
      }
      h4 {
        font-size: 32px;
        margin-bottom: 40px;
        @extend %miniTitle;
        text-align: center;
        font-weight: 100;
      }
      a {
        @extend %miniTitle;
        text-decoration: none;
        font-size: 12px;
        font-weight: 500;
      }
    }
  }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, auto);
  grid-template-rows: repeat(2, auto);

  padding: 0px 120px;

  .gallery_poster {
    height: 100%;
    width: 100%;
    cursor: pointer;
    img {
      max-width: 100%;
      height: 100%;
      transition: opacity 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
      &:hover {
        opacity: 0.5;
      }
    }
  }
}
.footer {
  margin-top: 100px;
  background-color: $bg;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 65px 0px;
  .footer_column {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 5px;
    @extend %miniTitle;
    .column_title {
      margin-bottom: 50px;
      opacity: 0.5;
    }
    ul {
      text-align: center;
      li {
        margin-bottom: 15px;
      }
    }
    &:nth-child(2) {
      border-right: 1px solid black;
      border-left: 1px solid black;
    }
  }
}

배운것

  • grid
  • 직계자손에서 특정 자손 제외 하는 selector(>*:not())
  • 배경화면 어둡게 하는 property(background-gradient)
  • transition, hover 랑 같이 묶여서 코딩됨. (a 태그)
  • google font 에서 font 를 import 해옴.

결과

cloneweb2

This post is licensed under CC BY 4.0 by the author.