์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- typescript
- tailwindcss
- ์น ๋ธ๋ผ์ฐ์ ๋ ๋๋ง
- ๋ฐ๋๋ผ JS๋ก ํฌ๋กฌ ์ฑ ๋ง๋ค๊ธฐ
- ๋ฐ๋๋ผ JS๋ก ๊ทธ๋ฆผํ ๋ง๋ค๊ธฐ
- ์น ๋ธ๋ผ์ฐ์ ๊ตฌ์กฐ
- HTML
- ๋ ธ๋ง๋ ์ฝ๋
- jest
- JS
- JAVA Script
- queryprovider
- ์ฝ๋ฉ๋ ํ
- next.js
- ํ๋ก ํธ์๋
- canvas image
- HTML ํ์ผ๊ตฌ์กฐ
- react
- ์ฝ์ฝ์ํก ํด๋ก ์ฝ๋ฉ
- ๋ ธ๋ง๋์ฝ๋
- ์ํ์ฝ๋ฉ
- axios-mock-adapte
- javascript
- clone coding
- canvas js
- CSS
- canvas
- tanstack-query
- negative margin
- ์ฝ๋ฉ์ผ๊ธฐ
- Today
- Total
Coding Archive
๋ ธ๋ง๋ ์ฝ๋ - ์ฝ์ฝ์ํก ํด๋ก ์ฝ๋ฉ ์ฐ์ต(2) ๋ณธ๋ฌธ
๋ ธ๋ง๋ ์ฝ๋ - ์ฝ์ฝ์ํก ํด๋ก ์ฝ๋ฉ ์ฐ์ต(2)
์ฝ๋ฑ์ด 2022. 4. 19. 00:13CLONING TIME
5. Status Bar CSS
HTML์ CSS๋ฅผ ์์ฑํ๊ณ ์ถ์ ๋, "link:css"๋ผ ํ๊ณ ์ํฐ๋ฅผ ์น๋ฉด ์๋ ์์ฑ๋๋ค.
ํ์ CSS๋ฅผ link ํด์ค๋ค.
<link rel="stylesheet" href="css/styles.css" />
font-family๋ฅผ ์ด์ฉํ์ฌ ์์ฒด๋ฅผ ๋ณ๊ฒฝํ ์ ์๋ค.
https://fonts.google.com/ ์์ ์ํ๋ ํฐํธ๋ฅผ ๊ฐ์ ธ๋ค ์ฐ๋ฉด ๋๋ค. (web font)
link ๋ณด๋ค import๋ฅผ ์ถ์ฒํ๋ค.
import๋ style.css ์ ์ผ ์๋จ์ ์ถ๊ฐํ๋ค.
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap");
body์ font-family๋ฅผ ์ถ๊ฐํ๋ค. ์ด๋ ์ฌ์ฉํ ์ฌ์ฉํ ํฐํธ๋ง ์ถ๊ฐํ๋ค. ๋ชจ๋ ํฐํธ๋ฅผ ์ถ๊ฐํ๋ฉด ์น์ฌ์ดํธ ๋ฌด๊ฑฐ์์ง๊ธฐ ๋๋ฌธ์ด๋ค.
body {
color: #2e363e;
font-family: "Open Sans", sans-serif;
}
CSS hack (justify-content ๋์ ์ฌ์ฉ ๊ฐ๋ฅ)
CSS hack(๊ธฐ์ ) → ๋ ์ํผ ๊ฐ์ด ์ด๋๋ ์ธ ์ ์๋ค. ์ด์ํ์ง๋ง ์๋ํ๋ค.
1) ์์ ๋ฐ์ค : justify-content: center; →์ค์์ผ๋ก ๋ชฐ๋ฆผ
2) ๋ด๋ถ ๋ฐ์ค ๋ฒ์ : width: 33%; →์ผ์ชฝ์ผ๋ก ๋ชฐ๋ ค์ ๋ฒ์ ๋ฒ์ด์ง, ์ผ์ชฝ ์์นํ ๋ฐ์ค๋ ์ผ์ชฝ์ ๋ถ์ด์ ์ ๋ ฌ๋จ
3) ์ค์์ ์์นํ ๋ฐ์ค : display: flex; justify-content: center; →์ค์์ ์์นํ ๋ฐ์ค๋ง ์ค์์ ์์นํจ
4) ์ค๋ฅธ์ชฝ์ ์ ๋ ฌํ ๋ฐ์ค : display: flex; justify-content: flex-end; align-items: center; →์ค๋ฅธ์ชฝ์ ๋ถ์ด์ ์ ๋ ฌ๋จ, ์์ด์ฝ๋ค ๊ฐ์ด๋ฐ๋ก ์ ๋ ฌ
.status-bar {
position: fixed;
top: 0%;
width: 100%;
display: flex;
justify-content: center;
padding: 5px 3px;
box-sizing: border-box;
}
.status-bar__column {
width: 33%;
}
.status-bar__column:first-child span {
margin-right: 5px;
}
.status-bar__column:nth-child(2) {
display: flex;
justify-content: center;
}
.status-bar__column:last-child {
display: flex;
justify-content: flex-end;
align-items: center;
}
์์ด์ฝ์ ํฌ๊ธฐ๋ฅผ ํค์์ฃผ๋ ค๋ฉด HTML์์ ์์ด์ฝ ์ด๋ฆ์ 2x or lg ๋ฑ์ ๋ถ์ฌ์ค๋ค. (fontawesome์์ ์์ด์ฝ ๊ฐ์ ธ์ฌ ๋ ์ฌ์ด์ฆ ์ต์ ๋ ๋์์์ด ์ํ๋ ์ฌ์ด์ฆ ์ฐธ๊ณ ํด์ ํ๋ฉด ๋๋ค.)
6. Sign Up Screen part Three
๊ธฐ๋ณธ์ ์ผ๋ก ๋ธ๋ผ์ฐ์ ๊ฐ ๊ฐ์ง๊ณ ์๋ ์คํ์ผ์ ์์ ๋ ๋ฐฉ๋ฒ→reset.css
reset.css๋ cssํ์ผ๋ก ๋๋ถ๋ถ์ ํ๊ทธ์ margin: 0, padding: 0, border: 0๋ฑ์ ๊ฐ์ง ํ์ผ์ด๋ค.
1) ๋ฐ์ ํ์ผ์ cssํด๋์ reset.cssํ์ผ์ ๋ง๋ค๊ณ , ๋ถ์ฌ ๋ฃ๋๋ค.
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: "";
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
input:focus {
outline: none;
}
a {
color: inherit;
text-decoration: none;
}
2) reset.cssํ์ผ์ styles.cssํ์ผ์ import๋ก ์ถ๊ฐํด์ค๋ค.
@import "reset.css";
css๋ฅผ ๋ถํ ํ ํฉ์น๋ ๋ฐฉ๋ฒ์ผ๋ก styles.css๋ฅผ ์ฌ์ฉํ๋ค. (styles.css์ ๊ฐ๊ฐ์ cssํ์ผ๋ค์ import)
7. Log In Form part One
variables.css ์ฌ์ฉํ ๋๋ cssํด๋์ variables.cssํ์ผ์ ๋ง๋ค๊ณ , style.css ์์ ๊ผญ! import ํ๊ธฐ!
๋ณ์๋ฅผ ์ง์ ํด์ค ๋
:root {
--yellow: #fae100;
๋ณ์๋ฅผ ์ฌ์ฉํ ๋
#login-form input:focus {
border-color: var(--yellow);
}
#login-form input[type="submit"] {
background-color: var(--yellow);
}
+) ๊ตฌ๊ธ ํ์ฅ ํ๋ก๊ทธ๋จ colorzilla ํ์ฉํด์ ์์ ์ถ์ถํ ์ ์๋ค.
8. Log In Form part Two
#login-form input {
border: none;
padding: 15px 0px;
font-size: 18px;
margin-bottom: 25px;
transition: border-color 0.3s ease-in-out;
}
#login-form input:not([type="submit"]) {
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
transition: border-color 0.3s ease-in-out;
}
#login-form input::placeholder {
color: rgba(0, 0, 0, 0.4);
}
#login-form input:focus {
border-color: var(--yellow);
}
#login-form input[type="submit"] {
background-color: var(--yellow);
cursor: pointer;
padding: 20px 0px;
border-radius: 5px;
:not() → ๋ญ๊ฐ๊ฐ ์ ์ฉ๋๋ ๊ฑธ ์ํ์ง ์์ ๋ ์ฌ์ฉํ๋ฉฐ, () ์ฌ์ด์ ์ฐ์ธ ๊ฒ๋ค์ ํน์ฑ ์ ํ์(attribute selector)์ด๋ค.
not์ "์ด๊ฒ์ ์ ์ธํ ๋๋จธ์ง์ ์ ์ฉํ๊ณ ์ถ์ด์"๋ผ๋ ๋ง์ด๋ผ์, #login-form input ์๋ ๋๊ฐ์ด ์ฐ๋ฉด ์ค๋ณต ์ ์ฉ๋๊ธฐ ๋๋ฌธ์ not ์ชฝ์๋ง ์จ์ผ ํ๋ค.
cursor: pointer; ๋ก ๋ฒํผ ์์ ์ปค์๋ฅผ ๋ณ๊ฒฝํ ์ ์๋ค.
color: inherit;๋ ๋ถ๋ชจ๋ก๋ถํฐ ์์ ์์๋ฐ๋ ๊ฒ์ด๋ค.
์ถ๊ฐ๋ก css์ cascading์ ์ํ์ฌ, #login-form input: not([type="submit"])์ transition์ด ๋ค์ด๊ฐ๊ธฐ ๋๋ฌธ์,
#login-form input: focus ๋ณด๋ค ์์ ์์ด์ผ focus์ ๋ค์ด๊ฐ border-color์ ๋ณํ๊ฐ์ด ๋ํ๋๋ค.
ํญ์ cascading์ ์ฃผ์!
9. Recap and Forms
- bem ๋ฐฉ์์ด ์ฝ๋๊ฐ ์ดํดํ๊ธฐ ์ฌ์ ์๋ฌด๋๋ ๋ ์ข์ ๋ฐฉ๋ฒ์ด๋ค.
- CSS ํ์ผ์์ ์ฃผ์์ฒ๋ฆฌ๋ /* */๋ก ๊ฐ์ธ์ฃผ๋ฉด ๋๋ค.
- styles.css ํ์ผ์๋ font-family (or ๋ชจ๋ ์คํฌ๋ฆฐ์ background-color)์ ๊ฐ์ด ๋ชจ๋ ์คํฌ๋ฆฐ์ ์ ์ฉ๋ ์ ์๋ ์คํ์ผ์ ์จ๋๋๋ค. ์ด๋ ํ๋์ ๋ฐฉ์์ด๊ณ , ์์ ๋ง์ ํธํ ๋ฐฉ์์ ํํ๋ฉด ๋๋ค.
- form์ ์ค์ํ 2๊ฐ์ง ์์ฑ(attribute)์ ๊ฐ์ง๊ณ ์๋ค.
ํ๋๋ action์ด๊ณ , ๋ค๋ฅธ ํ๋๋ method์ด๋ค.
1) action
action์ ์ด๋ค ํ์ด์ง๋ก data๋ฅผ ๋ณด๋ผ ๊ฑด์ง ์ง์ ํ ์ ์๋ค.
action์ ์ ์ด ๋์ URL์ ํด๋นํ๋ ํ์ผ์ด ๋ฐ๋์ ์กด์ฌํด์ผ ํ๋ค.
2) method
method๋ 2๊ฐ์ง ๋ฐฉ์ ์ค ํ๋๋ฅผ ์ธ ์ ์๋ค. ํ๋๋ POST์ด๊ณ , ๋ค๋ฅธ ํ๋๋ GET์ด๋ค.
POST๋ ๋ฐฑ์๋ ์๋ฒ์ ์ ๋ณด๋ฅผ ์ ์กํ๋ ๋ฐฉ์์ด๋ผ ์ด๋ฒ ๊ฐ์์์๋ ์ฌ์ฉํ ์ ์๋ค.
GET ๋ฐฉ์์ ๋ณด์์ ์ทจ์ฝํ๊ธฐ ๋๋ฌธ์ username์ด๋ password๋ฅผ GET ๋ฐฉ์์ผ๋ก ๋ณด๋ด์ ์๋๋ค. URL์ ํฌํจ๋์ด๋ ์๊ด์๋ ์ ๋ณด๋ค์ GET ๋ฐฉ์์ผ๋ก ๋ณด๋ด๋ ๊ฒ์ด๋ค. - Components๋ ์ํ ํ์์ค๊ณผ ๊ฐ์ด ๋ฐ๋ณต๋๋ ์์๋ฅผ ์ ์ฅํ๋ค.
์์ง๊น์ง ํฌ๊ฒ ์ด๋ ค์ด ๋ถ๋ถ์ ์์๋ค. ์ธ๋ถ์ ์ธ ๋ถ๋ถ์ ๊ณ์ ๋ฐฐ์ฐ๋ค ๋ณด๋ ๋ด์ฉ์ด ์ ์ ๋ง์์ ธ ํท๊ฐ๋ฆด ๊ฒ ๊ฐ๋ค๋ ๊ฒ ๊ฑฑ์ ์ด์ง๋ง......, ๊ทธ๋๋ ํ์ผ์ด๋ ์ฝ๋๋ค์ ๋์ฑ ๊น๋ํ๊ฒ, ์์๋ณด๊ธฐ ์ฝ๊ฒ ์ ๋ฆฌํ ๋๋ง๋ค ์ฝ๊ฐ์ ํฌ์ด์ด ๋๊ปด์ง๋ค.ใ ใ
'๐ฅ๏ธ Clone Coding' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋ ธ๋ง๋ ์ฝ๋ - ์ฝ์ฝ์ํก ํด๋ก ์ฝ๋ฉ ์ฐ์ต(6) (0) | 2022.05.19 |
---|---|
๋ ธ๋ง๋ ์ฝ๋ - ์ฝ์ฝ์ํก ํด๋ก ์ฝ๋ฉ ์ฐ์ต(5) (0) | 2022.04.23 |
๋ ธ๋ง๋ ์ฝ๋ - ์ฝ์ฝ์ํก ํด๋ก ์ฝ๋ฉ ์ฐ์ต(4) (0) | 2022.04.21 |
๋ ธ๋ง๋ ์ฝ๋ - ์ฝ์ฝ์ํก ํด๋ก ์ฝ๋ฉ ์ฐ์ต(3) (0) | 2022.04.19 |
๋ ธ๋ง๋ ์ฝ๋ - ์ฝ์ฝ์ํก ํด๋ก ์ฝ๋ฉ ์ฐ์ต (0) | 2022.04.17 |