-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mask Animation End + Animator from, to changes
- Loading branch information
Showing
23 changed files
with
1,065 additions
and
129 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
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
.circle-button { | ||
all: unset; | ||
|
||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
// 사지방에서 테스팅 해야함. | ||
position: sticky; | ||
bottom: 2em; | ||
margin-top: 2em; | ||
|
||
// sticky 되먼 이거로 하고싶음... 그게 아니면 평소에는 중간에 놓기 | ||
// align-self: flex-end; | ||
align-self: center; | ||
|
||
overflow: hidden; | ||
border-radius: 50%; | ||
|
||
background-color: $secondary-color; | ||
cursor: pointer; | ||
z-index: 1000; | ||
|
||
width: 3.6em; | ||
height: 3.6em; | ||
font-size: 20px; | ||
|
||
transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); | ||
|
||
&.hidden { | ||
transition: 0.25s cubic-bezier(0, 0, 0.2, 1); | ||
opacity: 0; | ||
font-size: 0; | ||
} | ||
|
||
i { | ||
color: white; | ||
} | ||
|
||
.ripple { | ||
position: absolute; | ||
background-color: black; | ||
opacity: 0.15; | ||
border-radius: 50%; | ||
width: 1.5em; | ||
height: 1.5em; | ||
transform: translate3d(-50%, -50%, 0); | ||
animation: ripple-effect cubic-bezier(0, 0, 0.2, 1) 0.8s forwards; | ||
} | ||
} | ||
|
||
@keyframes ripple-effect { | ||
0% { | ||
opacity: 0.15; | ||
width: 1.5em; | ||
height: 1.5em; | ||
} | ||
|
||
100% { | ||
opacity: 0; | ||
width: 12em; | ||
height: 12em; | ||
} | ||
} |
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,74 @@ | ||
import "./CircleButton.scss"; | ||
import Component from "../../../core/Component/Component"; | ||
import { setShadow } from "../../../lib/shadow/shadow"; | ||
|
||
interface ButtonOptions { | ||
shadowLevel?: number; | ||
hiddenAtStart?: boolean; | ||
} | ||
|
||
export default class CircleButton extends Component { | ||
private ripple: HTMLElement | null = null; | ||
|
||
constructor( | ||
private readonly onTouch: () => void, | ||
{ shadowLevel = 0, hiddenAtStart = false }: ButtonOptions = {} | ||
) { | ||
super({ | ||
tagName: "button", | ||
classNames: ["circle-button", hiddenAtStart ? "hidden" : ""], | ||
}); | ||
setShadow(this.container, shadowLevel); | ||
|
||
this.render(); | ||
} | ||
|
||
handleButtonEvent(e: PointerEvent) { | ||
e.stopPropagation(); | ||
this.onTouch(); | ||
} | ||
|
||
renderRipple(e: PointerEvent) { | ||
this.removeRipple(); | ||
|
||
this.ripple = document.createElement("div"); | ||
this.ripple.classList.add("ripple"); | ||
|
||
const bRect: DOMRect = this.container.getBoundingClientRect(); | ||
this.ripple.style.top = `${e.clientY - bRect.top}px`; | ||
this.ripple.style.left = `${e.clientX - bRect.left}px`; | ||
|
||
this.appendElementsTo("", this.ripple); | ||
} | ||
|
||
removeRipple() { | ||
if (!this.ripple) return; | ||
|
||
this.ripple.remove(); | ||
this.ripple = null; | ||
} | ||
|
||
render() { | ||
this.container.removeEventListener( | ||
"pointerup", | ||
this.handleButtonEvent.bind(this) | ||
); | ||
this.container.removeEventListener( | ||
"pointerdown", | ||
this.renderRipple.bind(this) | ||
); | ||
|
||
this.container.innerHTML = ` | ||
<i class="fa-solid fa-arrow-right"></i> | ||
`; | ||
|
||
this.container.addEventListener( | ||
"pointerdown", | ||
this.renderRipple.bind(this) | ||
); | ||
this.container.addEventListener( | ||
"pointerup", | ||
this.handleButtonEvent.bind(this) | ||
); | ||
} | ||
} |
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,51 @@ | ||
import "./HeadInfoCard.scss"; | ||
import Component from "../../../core/Component/Component"; | ||
import { executeAnimation } from "./HeadInfoCardMask.ani"; | ||
|
||
export default class HeadInfoCard extends Component { | ||
constructor() { | ||
super({ classNames: ["info-card", "head"] }); | ||
|
||
this.store.setDefaultState("maskTriggered", false); | ||
this.store.setAction("triggerMask", () => { | ||
return { maskTriggered: true }; | ||
}); | ||
|
||
this.render(); | ||
} | ||
|
||
public triggerMask() { | ||
this.store.dispatch("triggerMask", {}); | ||
} | ||
|
||
render() { | ||
this.container.innerHTML = ` | ||
<span class="title-text">반가워요!</span> | ||
<span class="sub-title-text">사용자님이 누군지 알려주세요.</span> | ||
`; | ||
if (!this.store.getState("maskTriggered")) { | ||
this.container.innerHTML = ` | ||
<span class="title-text">반가워요!</span> | ||
<span class="sub-title-text">사용자님이 누군지 알려주세요.</span> | ||
`; | ||
} else { | ||
this.container.innerHTML = ` | ||
<div class="dark-mask"></div> | ||
<div class="sub-mask"> | ||
<div class="result-profile-container"> | ||
<i class="fa-solid fa-chevron-left"></i> | ||
<div class="info-name-container"> | ||
<span class="info-name">환영합니다, 박상혁님.</span> | ||
<span class="info-remember">이제부터 박상혁님을 기억할게요.</span> | ||
</div> | ||
<div class="info-tag-container"></div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
requestAnimationFrame(() => { | ||
executeAnimation( | ||
this.container, | ||
this.qs(".dark-mask")!, | ||
this.qs(".sub-mask")! | ||
); | ||
}); | ||
} | ||
} | ||
} |
Oops, something went wrong.