The power to turn a negative me into a positive me, Emotions are habits
부정의 나를 긍정의 나로 바꾸는 힘, 감정은 습관이다.
The power to turn a negative me into a positive me, Emotions are habits
부정의 나를 긍정의 나로 바꾸는 힘, 감정은 습관이다.
마우스 이펙트 - 따라다니기
<main>
<section id="mouseType01">
<div class="cursor"></div>
<div class="mouse__wrap">
<p>The power to turn a <span class="style1">negative me</span> into a <span class="style2">positive me</span>,
Emotions are <span class="style3">habits</span></p>
<p><span class="style4">부정의 나</span>를 <span class="style5">긍정의 나</span>로 바꾸는 힘,
감정은 <span class="style6">습관</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 #fff;
}
.cursor {
position: absolute;
left: 0; top: 0;
width: 50px;
height: 50px;
border-radius: 50%;
border: 3px solid #fff;
background-color: rgba(255,255,255,0.1);
user-select: none;
pointer-events: none;
transition:
background-color 0.2s,
border-color 0.2s,
transform 0.6s,
border-radius 0.2s;
}
.cursor.style1 {
background-color: rgba(15, 201, 93, 0.4);
border-color: green;
}
.cursor.style2 {
background-color: rgba(140, 0, 255, 0.4);
border-color: rgb(140, 0, 255);
transform: rotate(720deg) scale(2);
}
.cursor.style3 {
background-color: rgb(0, 47, 255, 0.4);
border-color: rgb(0, 47, 255);
transform: scale(1.5) rotate(45deg);
border-radius: 10px;
}
.cursor.style4 {
background-color: rgb(121, 235, 197, 0.4);
border-color: rgb(121, 235, 197);
transform: scale(10) rotateY(360deg);
}
.cursor.style5 {
background-color: rgb(255, 0, 85, 0.4);
border-color: rgb(255, 0, 85);
transform: rotateY(720deg) scale(0.1);
}
.cursor.style6 {
background-color: rgba(255, 238, 0, 0.4);
border-color: rgb(255, 338, 0);
transform: rotateX(360deg) scale(1.5);
}
window.addEventListener("mousemove", (e)=>{
document.querySelector(".clientX").innerText = e.clientX
document.querySelector(".clientY").innerText = e.clientY
document.querySelector(".offsetX").innerText = e.offsetX
document.querySelector(".offsetY").innerText = e.offsetY
document.querySelector(".pageX").innerText = e.pageX
document.querySelector(".pageY").innerText = e.pageY
document.querySelector(".screenX").innerText = e.screenX
document.querySelector(".screenY").innerText = e.screenY
})
window.addEventListener("mousemove", (e) => {
document.querySelector(".cursor").style.left = e.clientX -25 + "px"
document.querySelector(".cursor").style.top = e.clientY -25 + "px"
});
document.querySelector(".style1").addEventListener("mouseover", ()=>{
document.querySelector(".cursor").classList.add("style1");
})
document.querySelector(".style1").addEventListener("mouseout", ()=>{
document.querySelector(".cursor").classList.remove("style1");
})
document.querySelector(".style2").addEventListener("mouseover", ()=>{
document.querySelector(".cursor").classList.add("style2");
})
document.querySelector(".style2").addEventListener("mouseout", ()=>{
document.querySelector(".cursor").classList.remove("style2");
})
document.querySelector(".style3").addEventListener("mouseover", ()=>{
document.querySelector(".cursor").classList.add("style3");
})
document.querySelector(".style3").addEventListener("mouseout", ()=>{
document.querySelector(".cursor").classList.remove("style3");
})
document.querySelector(".style4").addEventListener("mouseover", ()=>{
document.querySelector(".cursor").classList.add("style4");
})
document.querySelector(".style4").addEventListener("mouseout", ()=>{
document.querySelector(".cursor").classList.remove("style4");
})
document.querySelector(".style5").addEventListener("mouseover", ()=>{
document.querySelector(".cursor").classList.add("style5");
})
document.querySelector(".style5").addEventListener("mouseout", ()=>{
document.querySelector(".cursor").classList.remove("style5");
})
document.querySelector(".style6").addEventListener("mouseover", ()=>{
document.querySelector(".cursor").classList.add("style6");
})
document.querySelector(".style6").addEventListener("mouseout", ()=>{
document.querySelector(".cursor").classList.remove("style6");
})