Skip to content
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

KDT0_CyinHayeon 디아블로 홈페이지 클론코딩 (기존 pr closed) #74

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

Conversation

Sinary00
Copy link

@Sinary00 Sinary00 commented Jul 30, 2023

디아블로4 홈페이지 클론 코딩

사이트 주소

작업 기간

2023년 7월 27일 ~ (진행중)
(과제 제출 후에도 보완 할 예정)

기술 스택

  • HTML
  • CSS
  • Javascript
  • Jquery

구현 내용

  • 시멘틱 태그 사용
  • CSS만을 이용한 드롭다운 메뉴
  • 동영상 재생 클릭 시, 연령 확인 후 쿠키 저장 -> 연령 미달 시 동영상 재생 불가 구현
  • 새소식 반응형을 고려하여 슬라이더로 대체
  • 마우스를 따라가는 백그라운드 이미지 설정
  • 비주얼 백그라운드 동영상 재생/정지 버튼 커스텀
  • 탭 기능 구현 (게임플레이/이야기)

아쉬운 점

  • 반응형을 고려하여 작업 진행했으나, 클론 코딩 사이트를 급하게 변경해 시간 부족으로 반응형 미구현
  • 사이트 로딩에 오래걸림, 최적화 작업 필요 해결(2)
  • 콘솔 오류 확인 필요
  • 구매하기 모달 창 및 메뉴 버튼 스크롤 js 미구현
  • swiper.js 사용하면 한 슬라이더에서 두개의 pagination 작동 불가, 다른 슬라이더 대체 또는 해결 방안 연구 필요
  • 크롬 외 모바일 / 맥OS 사파리 등 타 브라우저에서 연령 확인 js가 동작하지 않음 해결(1)

해결 내용

  1. 크롬 외 타 브라우저에서 required 적용되지 않음
    → button onclick으로 연령 인증 스크립트 구현하는 방식을 form action으로 변경
  2. 사이트 로딩에 오래걸림, 최적화 작업 필요
    → Img Loading lasy 추가, iframe 탭 활성화 시 src값 입력, window load 후 html fadeIn 효과

@seacrab808
Copy link
Member

아쉬웠던 점을 명확히 아시고 어려웠던 부분을 해결한 내용을 리드미에서 확인할 수 있어서 좋은 것 같습니다! 저도 이처럼 프로젝트를 하면서 기록을 많이 해 놔야겠다고 반성하고 갑니다

@KittelLee
Copy link

KittelLee commented Jul 31, 2023

리드미에 명시하는 방법자체가 너무 인상적이네요 많이 배우고 갑니다. 만드시느라 고생하셨습니다

@mysdpy30s
Copy link

디아블로 사이트 그 자체가 아닐까 싶을 정도로 폰트, 배치까지 모두 다 굉장히 디테일하게 구현해주신 것 같습니다. 그리고 Commit 내역을 작성해 주신 것에서도 요소별로 어떤 부분이 추가/변경 되었는지 직관적으로 알 수 있어 좋다는 생각이 드네요. 한 수 배워갑니다 :) 고생 많으셨어요~!

@junkue20
Copy link

getCookie 함수로 생년월일을 받아서 영상 재생 여부를 구현하신 부분이 매우 인상적입니다..!

Copy link
Member

@marshallku marshallku left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

asset/.DS_Store Outdated
Copy link
Member

Choose a reason for hiding this comment

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

이런 OS가 생성한 파일은 커밋되지 않게 .gitignore에 추가해둬주세요!

@@ -0,0 +1,70 @@
@font-face{font-display:swap;font-family:Roboto;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Me5Q.ttf) format("truetype")}
Copy link
Member

Choose a reason for hiding this comment

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

가급적이면 배포하는 단계에 minify를 진행하고 형상 관리하는 파일에는 formatting을 해두는 게 좋아 보입니다!

index.html Outdated Show resolved Hide resolved
css/main.css Outdated Show resolved Hide resolved
css/main.css Outdated Show resolved Hide resolved
$("#month").append("<option selected value='0"+ i +"'>"+ i + "월" +"</option>");
}else{
if (i < 10){
$("#month").append("<option value='0"+ i +"'>"+ i + "월" +"</option>");
Copy link
Member

Choose a reason for hiding this comment

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

String.prototype.padStart()를 활용하시면 가독성을 향상시킬 수 있을 것 같네요.

for(var y = (year); y >=(year-100); y--){
$("#year").append("<option value='"+ y +"'>"+ y + "년" +"</option>");
}
for(var i = 1; i <= 12; i++){
Copy link
Member

Choose a reason for hiding this comment

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

이정도는 알아보기 편하긴 하지만, magic number 사용은 가독성을 위해 가급적 지양하시는 게 좋습니다.

const YEAR_TO_MONTH = 12;

for(let i = 1; i <= YEAR_TO_MONTH; i++) {
// ...

month = month >= 10 ? month : '0' + month; //month 두자리로 저장
var day = date.getDate(); //d
day = day >= 10 ? day : '0' + day; //day 두자리로 저장
return year + '' + month + '' + day; //'-' 추가하여 yyyy-mm-dd 형태 생성 가능
Copy link
Member

Choose a reason for hiding this comment

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

${year}${month}${day}처럼 template literal을 사용하시면 가독성을 높일 수 있습니다.

var x, y;
var val = document.cookie.split(';');

for (var i = 0; i < val.length; i++) {
Copy link
Member

Choose a reason for hiding this comment

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

for loop의 조건문에서 length를 확인하면, 매 iteration마다 값을 확인해야합니다.

for (let i = 0, max = val.length; i < max; i++) {}

Array 고차 함수를 쓰는 것이 가독성에 좋고, 위와 같이 초기문에 iteration을 진행할 수를 작성해두는 게 성능에 좋습니다.

exdate.setDate(exdate.getDate() + days);
// 설정 일수만큼 현재시간에 만료값으로 지정

var cookie_value = escape(value) + ((days == null) ? '' : '; expires=' + exdate.toUTCString());
Copy link
Member

Choose a reason for hiding this comment

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

escape() 은 deprecated되었습니다.
encodeURIComponent()를 사용해 인코딩하시는 걸 권장드립니다.

Copy link
Author

Choose a reason for hiding this comment

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

@marshallku
헛 세세한 코멘트 감사드립니다 :)!
참고하여 수정하도록 하겠습니다 ㅎㅎ

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.

6 participants