Pain is temporary Quitting lasts forever.
Pain is temporary Quitting lasts forever.
블랜딩 이펙트 - 도형 효과 주기
<main>
<div class="cursor"></div>
<article class="mouseCont">
<p>Pain is <em>temporary</em>Quitting lasts forever.</p>
<h2>고통은 잠깐이다. <em>포기는</em>영원히 남는다.</h2>
</article>
</main>
.mouseCont {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
color: #fff;
height: 100vh;
width: 100%;
overflow: hidden;
font-family: 'NEXONLv1Gothic';
cursor: none;
}
.mouseCont p {
font-size: 2.5vw;
line-height: 2.3;
font-weight: 300;
}
.mouseCont h2 {
font-size: 3vw;
font-weight: normal;
font-weight: 400;
}
.mouseCont em {
font-style: normal;
border-bottom: 0.2vw dashed orange;
color: orange;
}
.cursor {
position: absolute;
left: 0;
top: 0;
width: 20px;
height: 20px;
border-radius: 50%;
z-index: 9999;
background-color: #fff;
user-select: none;
pointer-events: none;
transition: transform 0.3s, opacity 0.2s;
mix-blend-mode: difference;
/* 디퍼런스 효과 정리하기 */
}
.cursor.active {
transform: scale(20);
}
.info.left.list li.active {
text-decoration: underline;
color: orange;
}
const w = $(".cursor").width()/2;
const h = $(".cursor").height()/2;
//움직임 효과
$(window).mousemove(function(e){
gsap.to(".cursor", {duation:0.4, left: e.pageX, top: e.pageY});
});
//오버 효과
$(".mouseCont em").hover(function(){
$(".cursor").addClass("active");
}, function(){
$(".cursor").removeClass("active");
});
//출력용 리무브 클래스로 클릭ㄱ시 에디트를 전부 삭제 그후 디스로 에드클래스
$(".info.left.list li").click(function(){
$(".info.left.list li").removeClass();
$(this).addClass("active");
// const text = $(this).text();
$(".cursor").css("mix-blend-mode", $(this).text());
})