Better a diamond with a flaw than a pebble without.
흠집 없는 조약돌보다는 흠집 있는 다이아몬드가 낫다.
Better a diamond with a flaw than a pebble without.
흠집 없는 조약돌보다는 흠집 있는 다이아몬드가 낫다.
마우스 이펙트 - 조명 효과
<main>
<section id="mouseType03">
<div class="cursor"></div>
<div class="mouse__wrap">
<p>Better a <span>diamond</span> with a flaw than a <span>pebble</span> without.</p>
<p>흠집 없는 <span>조약돌</span>보다는 흠집 있는 <span>다이아몬드</span>가 낫다.</p>
</div>
</section>
</main>
.mouse__wrap {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
color: #fff;
width: 100%;
height: 100vh;
overflow: hidden;
cursor: none;
}
.mouse__wrap p {
font-size: 2.5vw;
line-height: 2;
font-weight: 300;
}
.mouse__wrap p:last-child {
font-size: 3vw;
font-weight: 400;
}
.mouse__wrap p span {
border-bottom: 0.15vw dashed goldenrod;
color: goldenrod;
}
.cursor {
position: absolute;
left: 0; top: 0;
width: 200px;
height: 200px;
z-index: -1;
border-radius: 50%;
background-image: url(img/img03.jpg);
background-size: cover;
background-position: center center;
background-attachment: fixed;
border: 5px solid #fff;
}
const circle3 = document.querySelector(".cursor").getBoundingClientRect();
function follow(e){
gsap.to(".cursor", {duration: 0.3, left: e.pageX - (circle3.width / 2), top: e.pageY - (circle3.height / 2)});
document.querySelector(".pageX").innerText = e.pageX;
document.querySelector(".pageY").innerText = e.pageY;
}
window.addEventListener("mousemove", follow);