Skip to content

Conversation

@Eugene-A-01
Copy link
Contributor

개요

  • 리스트 이미지 저장 기능 구현

작업 사항

  • 저장될 이미지를 모달로 약 1초 띄워준 후, 이미지 저장 성공 토스트메시지와 함께 listywave_{리스트제목}.png로 저장


스크린샷

image

2025-03-03.6.59.45.mov

리뷰어에게

  • 저희 공용 모달, zindex, locale 등 공용&글로벌 부분들을 개발에 활용하지 못했습니다. 리팩토링 커밋 추가로 금방 올리겠습니다!
  • 저장되는 리스트의 디자인을 알아서 해봤는데, 많은 피드백이 필요해보입니다..ㅎㅎ 많피부!

@vercel
Copy link

vercel bot commented Mar 3, 2025

@Eugene-A-01 is attempting to deploy a commit to the Eujin Ahn's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@seoyoung-min seoyoung-min left a comment

Choose a reason for hiding this comment

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

LGGGGGGGTM 👍

Comment on lines +27 to +57
useEffect(() => {
const timer = setTimeout(() => {
if (captureRef.current) {
const clonedCapture = captureRef.current.cloneNode(true) as HTMLDivElement;
clonedCapture.style.width = `${window.innerWidth}px`;
clonedCapture.style.height = `${window.innerHeight}px`;
clonedCapture.style.padding = '50px 30px';

document.body.appendChild(clonedCapture);

toPng(clonedCapture, { backgroundColor: '#fff' })
.then((dataUrl) => {
const link = document.createElement('a');
link.download = `listywave_${data.title}.png`;
link.href = dataUrl;
link.click();
toasting({ type: 'success', txt: '이미지를 저장하였습니다' });
})
.catch((err) => {
console.error('이미지 저장 오류:', err);
toasting({ type: 'error', txt: '이미지 저장을 실패했습니다.' });
})
.finally(() => {
document.body.removeChild(clonedCapture);
onClose();
});
}
}, 1000);

return () => clearTimeout(timer);
}, [data.title, onClose]);
Copy link
Contributor

Choose a reason for hiding this comment

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

모달로 띄워지고 자동으로 닫히고 저장까지 너무 완벽하게 구현해주셔서 놀랐어요!!🥹 ver2때 만들어 둔 디자인은 있는데 ver3용은 없네요ㅠ, ver3에 맞게 어떻게 바꿀 수 있을지 고민해보겠습니다!!

Copy link
Contributor

Choose a reason for hiding this comment

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

참고로 ver2 디자인 후보가 아래와 같았는데요! 최대 10개까지 아이템이 있고, 아이템당 100자까지 작성 가능한 점을 고려하여 아래와 같은 조건을 세웠습니다.

[조건]

  • 제목/작성자/날짜/순위 포함하기
  • 이미지 제외, 텍스트로만 이루어져 행간 줄이기
  • 리스트에 맞게 높낮이 조정가능
Screenshot 2025-03-03 at 7 12 35 PM

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