codestates / codestates/Bobpago

[πŸ“šDev Log] κΉ€μš°μ„ / 2021.09.30

Open
#117 0 comments 0 reactions 1 assignee Claimed by @VVSOGI View on GitHub
dev log
Dominant language
TypeScript
Stars
5
Forks
3
PR merge metrics
No merged PRs in 30d

Description

### μ˜€λŠ˜μ€ μ–΄λ–»κ²Œ ν”„λ‘œμ νŠΈμ— κΈ°μ—¬ν–ˆλ‚˜μš”?
- 메인 상세 νŽ˜μ΄μ§€ axios κ΅¬ν˜„ 및 버그 ν”½μŠ€
- 섀문쑰사 νŽ˜μ΄μ§€λ‘œ λ‹€μ‹œ μ΄λ™ν–ˆμ„ λ•Œ, λ²„νŠΌμ΄ μΌœμ ΈμžˆλŠ” 버그 ν”½μŠ€
- 폰트 데이터 μˆ˜μ •

### 였늘의 ν”„λ‘œμ νŠΈμ—μ„œ νž˜λ“  점은 λ¬΄μ—‡μΈκ°€μš”?

- 상세 λ ˆμ‹œν”Ό νŽ˜μ΄μ§€ κ΅¬ν˜„ν•˜λŠ”λ° μžˆμ–΄μ„œ useEffect와 λ‘œλ”©μ˜ κ΄€λ ¨λœ λ‘œμ§μ„ μ§œλŠ” 것이 κ½€ μ‹œκ°„μ΄ μ˜€λž˜κ±Έλ Έλ‹€.

```js
// μ½”λ“œλ₯Ό 첨뢀해도 μ’‹μŠ΅λ‹ˆλ‹€.
useEffect(() => {
handlePageData();
}, []);

useEffect(() => {
}, [handlePageData]);

useEffect(() => {
if (recipeData !== null) {
gsap.registerPlugin(ScrollToPlugin, ScrollTrigger);
setLoading(false);
return () => {};
}
}, [recipeData]);

useEffect(() => {
if (loading === false) {
dispatch({ type: SET_DETAIL_DATA, payload: recipeData });
setStart(true);
const totalLength = recipeData.recipe.descriptions.length;
const moveRatio = 100 / totalLength;

const goToSection = (i: number, anim?: any) => {
gsap.to(window, {
scrollTo: { y: i * window.innerHeight, autoKill: false },
duration: 0.5,
});
const image = document.body.querySelector(
".image"
) as HTMLParagraphElement;
const rightScroll = document.body.querySelector(
".rightScroll"
) as HTMLParagraphElement;
const topBox = document.body.querySelector(
".topbox"
) as HTMLParagraphElement;
const leftBox = document.body.querySelector(
".leftbox"
) as HTMLParagraphElement;
const rightBox = document.body.querySelector(
".rightbox"
) as HTMLParagraphElement;
const main = document.body.querySelector(
".main"
) as HTMLParagraphElement;
const sub = document.body.querySelector(".sub") as HTMLParagraphElement;
const totalMap = document.body.querySelectorAll(
".totalMap"
) as NodeListOf;
[...totalMap].map((item: any) => {
if ([...item.classList].includes(String(i))) {
item.classList.add("mapActive");
} else {
item.classList.remove("mapActive");
}
});
if (
rightScroll &&
topBox &&
leftBox &&
rightBox &&
image &&
main &&
sub
) {
rightScroll.style.transform = `translateY(${i * -262}px)`;
topBox.style.transform = `translateY(${i * -100}%)`;
leftBox.style.transform = `translateX(${i * -moveRatio}%)`;
rightBox.style.transform = `translateX(${
moveRatio - 100 - moveRatio * -i
}%)`;
image.style.transform = `translateY(${i * -100}%)`;
main.style.transform = `translateY(${i * -100}%)`;
sub.style.transform = `translateY(${i * -100}%)`;
}

if (anim) {
anim.restart();
}
};
```

### 내일은 ν”„λ‘œμ νŠΈμ— κΈ°μ—¬ν•˜κΈ° μœ„ν•΄ 무엇을 ν•΄μ•Ό ν•˜λ‚˜μš”?

- [ ] μ†Œκ°œ νŽ˜μ΄μ§€ κ΅¬ν˜„μ„ μœ„ν•΄ 힘써보렀고 ν•œλ‹€.
- [ ] μš°μ„  였늘 axios 톡신을 마무리 μ§€μ–΄μ•Όν•œλ‹€.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.