- 
                Notifications
    You must be signed in to change notification settings 
- Fork 9
[Project1/조민철] Colors #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: JSmini_datalater
Are you sure you want to change the base?
Changes from 4 commits
13d7dd1
              346be0f
              d8ff78d
              03b312e
              3a0b1b7
              fa66e54
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| module.exports = { | ||
| env: { | ||
| browser: true, | ||
| es2021: true, | ||
| }, | ||
| extends: [ | ||
| 'airbnb-base', | ||
| ], | ||
| parserOptions: { | ||
| ecmaVersion: 12, | ||
| sourceType: 'module', | ||
| }, | ||
| rules: { | ||
| }, | ||
| }; | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| node_modules/ | ||
| .vscode | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <!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" /> | ||
| <title>Ramdon Color</title> | ||
| <link rel="stylesheet" href="style.css" /> | ||
| </head> | ||
| <body> | ||
| <button id="button">Click Me!</button> | ||
|          | ||
| <script src="./main.js"></script> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| const $button = document.getElementById('button'); | ||
|  | ||
| const $body = document.querySelector('body'); | ||
|  | ||
| const randomColorValue = () => Math.floor(Math.random() * 256); | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 제가 알기로는, Math.random()은 0이상 1미만의 난수를 생성하는것으로 알고있습니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아, 이게 최대값이 255여서 난수 0~1미만으로 곱셈한 결과가 최소값 0부터 최대 255까지 나오도록 256으로 했습니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 앗...! 그렇네요ㅋㅋ 잠시 최대값이 256이라고 생각했습니다. | ||
|  | ||
| const randomColor = () => `rgba(${randomColorValue()}, ${randomColorValue()}, ${randomColorValue()}`; | ||
|  | ||
| $button.addEventListener('click', () => { | ||
| $body.style.backgroundColor = randomColor(); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
깨알같은 부분이지만.. title에 오타가 있군요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
랜돈 컬러 ㅋㅋㅋ 매의 눈 감사합니다~~ 변경해서 반영하겠습니다
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3a0b1b7