Skip to content

[Project1~3/정예원] Colors, Hex colors gradient, Random quote generator #4

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Yeewon
Copy link
Member

@Yeewon Yeewon commented Sep 6, 2021

1. [project1] Colors 과제 설명

Colors

👩‍💻 요구 사항과 구현 내용

1. 버튼 정 가운데 배치

.container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

2. 버튼 클릭하면 배경색이 랜덤으로 변경

document.querySelector('.btn').addEventListener('click', () => {
    const colorCode = '#' + Math.round(Math.random() * 0xffffff).toString(16)
    document.querySelector('.container').style = `background-color: ${colorCode}`
})

랜덤으로 colorCode 를 생성해 background-color 를 바꿔준다.

2. [project2] Hex colors gradient 과제 설명

Hex colors gradient

👩‍💻 요구 사항과 구현 내용

1. 배경 그라데이션
랜덤으로 두가지 색상을 뽑아서 그라데이션을 표현한다.
selectRandomColor : 랜덤으로 색상을 뽑아주는 함수

   const selectRandomColor = () => {
       return '#' + Math.round(Math.random() * 0xffffff).toString(16);
   };

linear-gradient를 사용하여 그라데이션을 표현

    this.render = () => {
        document.querySelector('main').style = `background: linear-gradient(to right, ${hexcode1} , ${hexcode2}`;
    };

2. 글자 색상 변경 애니메이션

h1,
h2 {
    ...
    animation: change 5s infinite alternate;
}

@keyframes change {
    0% {
        color: #ffffff;
    }
    20% {
        color: #cccccc;
    }

    40% {
        color: #999999;
    }
    60% {
        color: #666666;
    }
    80% {
        color: #333333;
    }
    100% {
        color: #ffffff;
    }
}

3. [project3] Random quote generator 과제 설명

Random quote generator

👩‍💻 요구 사항과 구현 내용

1. 배경 그라데이션

background: radial-gradient(circle, #5181b0 200px, #605ea6, #6649a0);

2. 명언 랜덤으로 보여주기
명언 API 사용

@Yeewon Yeewon changed the title [Project1/정예원] Color [Project1/정예원] Colors Sep 6, 2021
@Yeewon Yeewon changed the title [Project1/정예원] Colors [Project1, 2/정예원] Colors Sep 14, 2021
@Yeewon Yeewon changed the title [Project1, 2/정예원] Colors [Project1, 2/정예원] Colors, Hex colors gradient Sep 14, 2021
@Yeewon Yeewon changed the title [Project1, 2/정예원] Colors, Hex colors gradient [Project1~3/정예원] Colors, Hex colors gradient, Random quote generator Sep 15, 2021
@datalater
Copy link
Collaborator

예원님~ 코드 잘 보고 갑니다! 되게 깔끔하네요ㅎㅎ

그리구 PR 올려주신 브랜치가 main으로 되어 있어서 개인 브랜치로 바꿔주셔야 할 것 같아요 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants