Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Colors/Colors.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Colors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Colors

### DEMO

<img src="./Colors.gif" />
24 changes: 24 additions & 0 deletions Colors/assets/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.main-container {
background-color: white;
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}

.color-event-button {
background-color: transparent;
border: 1px solid black;
color: black;
border-radius: 5px;
padding: 14px 12.5px;
font-size: 20px;
transition: all 0.15s;
}

.color-event-button:hover {
background-color: black;
color: white;
padding: 15px 12.5px;
}
129 changes: 129 additions & 0 deletions Colors/assets/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

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;
}
15 changes: 15 additions & 0 deletions Colors/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./assets/reset.css" />
<link rel="stylesheet" href="./assets/index.css" />
Comment on lines +7 to +8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전에 동영팀 스크럼때 reset.css 말씀해주셨던 것 같은데 이렇게 활용하는 거군요ㅎㅎ배워갑니다👍

<title>Document</title>
</head>
<body>
<main id="App"></main>
<script src="./src/main.js" type="module"></script>
</body>
</html>
40 changes: 40 additions & 0 deletions Colors/src/components/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Button from "./Button.js";

const COLOR_LIST = [
"Orangered",
"Blue",
"Yellow",
"Green",
"Orange",
"Cyan",
"DodgerBlue",
"Violet",
"Navy",
"Purple",
"YellowGreen",
"OrangeRed",
"SlateBlue",
"Salmon",
"Crimson",
"HotPink",
"Magenta",
];

export default function App({ $target }) {
const $main = document.createElement("div");
$main.className = "main-container";
$target.appendChild($main);

let ColorListIndex = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사소한 부분이지만 자바스크립트 변수 네이밍 컨벤션은 camelCase니까 colorListIndex로 하면 어떨까요?ㅎㅎ


new Button({
$target: $main,
text: "Click Me!",
onClick: () => {
if (ColorListIndex > COLOR_LIST.length - 1) {
ColorListIndex = 0;
}
Comment on lines +34 to +36
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고양이 사진 검색기에서도 나왔던 패턴이군요! 저는 랜덤 컬러를 랜덤으로 만드는 것으로 구현했는데 민석님은 원본 프로젝트를 꼼꼼히 살펴보시고 정해진 패턴대로 움직인다는 것을 파악하셨네요 👍👍👍

$main.style.backgroundColor = COLOR_LIST[ColorListIndex++];
},
});
}
9 changes: 9 additions & 0 deletions Colors/src/components/Button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function Button({ $target, text, onClick }) {
const $button = document.createElement("button");
$button.className = "color-event-button";
$target.appendChild($button);
$button.textContent = text;
$button.addEventListener("click", (e) => {
onClick();
});
}
4 changes: 4 additions & 0 deletions Colors/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import App from "./components/App.js";
const $app = document.querySelector("#App");
Comment on lines +1 to +2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint에서는 import 라인 뒤에 new line을 넣도록 권장하고 있는데 한번 참고하시면 좋을 것 같습니다ㅎㅎ

링크


new App({ $target: $app });
5 changes: 5 additions & 0 deletions Hex-Colors-Gradient/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Colors

### DEMO

<img src="./hex-colors.gif" />
41 changes: 41 additions & 0 deletions Hex-Colors-Gradient/assets/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.main-container {
background: linear-gradient(to right, #ffffff, #ffffff);
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
align-items: center;
}

.background-text {
font-size: 45px;
animation: 2s linear 1.5s infinite alternate colorChange;
margin: 5vh;
}

.color-event-button {
background-color: transparent;
border: 1px solid black;
color: black;
border-radius: 5px;
padding: 14px 12.5px;
font-size: 20px;
transition: all 0.15s;
}

.color-event-button:hover {
background-color: black;
color: white;
padding: 15px 12.5px;
}

@keyframes colorChange {
from {
color: #000000;
}
to {
color: #ffffff;
}
}
Comment on lines +34 to +41
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 setInterval로 구현했는데 역시 CSS잘알이셔서 애니메이션을 활용하셨군요!! 배워갑니다👍👍👍

Loading