-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from Kernel360/develop
Develop
- Loading branch information
Showing
12 changed files
with
183 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
src/main/java/kr/kernel/teachme/domain/lecture/dto/Pagination.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/main/java/kr/kernel/teachme/domain/lecture/dto/PaginationResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
const listStyleChangeStartY = 1300; | ||
const listStyleChangeEndY = 2085; | ||
|
||
const listItems = document.querySelectorAll(".list-item"); | ||
const listItemWrapper = document.getElementById("list-item-wrapper"); | ||
|
||
|
||
|
||
const division = (listStyleChangeEndY - listStyleChangeStartY) / listItems.length; | ||
window.addEventListener("resize", setDynamicPositions); | ||
window.addEventListener("scroll", handleScroll); | ||
|
||
window.addEventListener("scroll", () => { | ||
if(document.getElementById("on")) document.getElementById("on").removeAttribute("id"); | ||
function setDynamicPositions() { | ||
const wrapperRect = listItemWrapper.getBoundingClientRect(); | ||
const windowHeight = window.innerHeight; | ||
|
||
if(window.scrollY > listStyleChangeStartY && window.scrollY < listStyleChangeEndY) { | ||
const targetIndex = Math.round((window.scrollY - listStyleChangeStartY) /division) | ||
window.listStyleChangeStartY = wrapperRect.top + window.scrollY - (windowHeight / 2); | ||
window.listStyleChangeEndY = wrapperRect.bottom + window.scrollY - (windowHeight / 2); | ||
} | ||
|
||
if(listItems[targetIndex]) listItems[targetIndex].id = "on"; | ||
function handleScroll() { | ||
if (document.getElementById("on")) document.getElementById("on").removeAttribute("id"); | ||
|
||
if (window.scrollY > window.listStyleChangeStartY && window.scrollY < window.listStyleChangeEndY) { | ||
const division = (window.listStyleChangeEndY - window.listStyleChangeStartY) / listItems.length; | ||
const targetIndex = Math.round((window.scrollY - window.listStyleChangeStartY) / division); | ||
|
||
if (listItems[targetIndex]) listItems[targetIndex].id = "on"; | ||
} | ||
}) | ||
} | ||
|
||
// 최초 로드 시 위치 설정 | ||
setDynamicPositions(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/test/java/kr/kernel/teachme/common/exception/AlreadyRegisteredMemberExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package kr.kernel.teachme.common.exception; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class AlreadyRegisteredMemberExceptionTest { | ||
|
||
@Test | ||
void testExceptionWithCustomMessage() { | ||
String customMessage = "Custom error message"; | ||
AlreadyRegisteredMemberException exception = new AlreadyRegisteredMemberException(customMessage); | ||
|
||
assertEquals(customMessage, exception.getMessage()); | ||
} | ||
|
||
@Test | ||
void testExceptionWithDefaultMessage() { | ||
AlreadyRegisteredMemberException exception = new AlreadyRegisteredMemberException(); | ||
|
||
assertEquals("이미 등록된 유저입니다.", exception.getMessage()); | ||
} | ||
} |
Oops, something went wrong.