-
Notifications
You must be signed in to change notification settings - Fork 3
KDT0_KimMinSeob 인터파크 홈페이지 클론코딩 #63
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: main
Are you sure you want to change the base?
Changes from 1 commit
9857f16
bdacb96
d52cb2e
8f5fabe
42de03b
ae870af
5b6c632
3ab097d
617e08f
ecb18a0
5efd897
15e6aed
50d8f29
5010ced
68ef625
86954b2
0a013aa
7c6b5ba
19589cc
06e4ab1
3c42ea2
95f944c
4e905ba
0f6d227
662ba1d
e350f9f
6896fbe
0101229
cfa15d4
7196516
0ba56a2
4becc4d
6f54d7a
9458d91
f48751f
6093214
1374d8f
f03a500
4bdd5f4
8fc7595
5621db2
e62441b
f526127
f97a6ca
7e86fc1
c3162b0
d3a4585
34d16de
b30dbef
b4d4e5c
d84370c
7a9ea96
b4b2241
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 |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| */ | ||
|
|
||
| html { | ||
| height: 100%; | ||
| height: 600%; | ||
|
|
||
| font-size: 16px; | ||
| box-sizing: border-box; | ||
|
|
||
|
Author
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. Intersection Observer API를 활용해서 배너들이 뷰포트의 30%이상을 넘기면 fade in 효과를 적용해보았습니다. 하지만 관련 내용을 찾아보던 중 intersection observer api를 사용하면 scroll에 따른 user의 log를 볼 수 없다는 것을 알 수 있었습니다. 소비자 데이터를 수집하는 관점에서는 아직 intersection observer api를 사용하기에는 어렵다는 것을 알 수 있었습니다. 따라서 UI적으로 사용하는 관점에서는 사용을 해도 무방하나, 쇼핑몰 같은 소비자의 정보 log를 얻어야 하는 웹사이트에서는 기존의 scoll effect를 구현해야 한다는 것을 알 수 있었습니다. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,7 +129,7 @@ var swiper7 = new Swiper('.ad__container', { | |
|
|
||
| window.addEventListener('scroll', function () { | ||
| var header = document.querySelector('.fixed-header'); | ||
| var scrollTop = window.pageYOffset || document.documentElement.scrollTop; | ||
| var scrollTop = document.documentElement.scrollTop; | ||
|
|
||
| if (scrollTop > 100) { | ||
| // 특정 위치(여기서는 100px) 아래로 스크롤했을 때 | ||
|
|
@@ -138,3 +138,21 @@ window.addEventListener('scroll', function () { | |
| header.style.top = '-100px'; // 헤더를 숨기도록 설정 | ||
| } | ||
| }); | ||
|
|
||
| document.querySelectorAll('.footer__banner--title-modal').forEach(function (el, index) { | ||
| el.addEventListener('mouseover', function () { | ||
| document.querySelectorAll('.hover__menu')[index].classList.add('show'); | ||
| }); | ||
|
Comment on lines
142
to
155
Author
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.
|
||
| }); | ||
|
|
||
| document.querySelectorAll('.hover__menu').forEach(function (el, index) { | ||
| el.addEventListener('mouseleave', function () { | ||
| el.classList.remove('show'); | ||
| }); | ||
| }); | ||
|
|
||
| window.addEventListener('mouseleave', function () { | ||
| this.document.querySelectorAll('hover__menu').forEach(function (el) { | ||
| el.classList.remove('show'); | ||
| }); | ||
| }); | ||
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.
변경 내용
반복되는 요소들에 공통적인 CSS 프로퍼티를 주기 위해 where 선택자를 이용
발생 오류
해당되는 자식 선택자들에 대한 선택적인 CSS 프로퍼티를 주기 위해 중복되는 코드들이 사용되어 가독성이 매우 떨어짐
해결 과정
피드백을 통해 Where이라는 가상요소 선택자를 활용해서 구현
리뷰 관련
비록 이번 코드에서는 태그 선택자를 사용하지 않기 위해 각 모달창을 구현해야 하는 요소들의 클래스를 다르게 줌으로써 구현을 했지만 where이라는 가상요소 선택자에 대해서 알 수 있었음. 중복되는 h1, h2, p 같은 태그들을 사용해야 하는 경우가 온다면 where을 통해 가독성 높은 코드를 구현해보고자 함