마우스 버튼 아이콘
해당 소스는 Dribbble에서 확인하실 수 있습니다.
Also check little different version in attachment. Thanks. Here are code versions too Created by Awesome guys from codepen. SVG version by Mishka Pankvelashvili and CSS version by Ryan Mulligan
Full presentation on Behance
위 내용을 통해서 SVG 버전과 CSS 버전을 통해 소스를 얻을 수 있으며, 티스토리 HTML 스킨편집을 통해서 원하는 위치에 이 버튼을 삽입할 수 있습니다.
CSS/SVG site scroll micro animation (SVG) 버전을 통해 쉽게 적용이 가능하며, HTML 부분에 스킨을 적용하고 CSS에 마우스 버튼 아이콘을 추가하면 미려한 마우스 아이콘을 사용할 수 있습니다.
HTML
<div class="mouse-wrap">
<div class="mouse">
<div class="frame">
<svg version="1.1" id="mouse" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="0 0 54.9 91" style="enable-background:new 0 0 54.9 91;" xml:space="preserve"><path id="XMLID_173_" class="st0" linejoin="round" stroke-linecap="round" stroke-miterlimit="10" d="M27.4,3.6L27.4,3.6C14.2,3.6,3.5,14.3,3.5,27.5v36c0,13.2,10.7,23.9,23.9,23.9h0 c13.2,0,23.9-10.7,23.9-23.9v-36C51.4,14.3,40.7,3.6,27.4,3.6z"></path></svg>
</div>
<div class="mouse-left">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="0 0 27.4 91" style="enable-background:new 0 0 27.4 91;" xml:space="preserve"><path linejoin="round" stroke-linecap="round" stroke-miterlimit="10" class="Draw-Frame Animate-Draw" d="M27.4,87.5L27.4,87.5c-13.2,0-23.9-10.7-23.9-23.9v-36c0-13.2,10.7-23.9,23.9-23.9h0"></path></svg>
</div>
<div class="mouse-right">
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="0 0 27.4 91" style="enable-background:new 0 0 27.4 91;" xml:space="preserve"><path linejoin="round" stroke-linecap="round" stroke-miterlimit="10" class="Draw-Frame Animate-Draw" d="M0,3.6L0,3.6c13.2,0,23.9,10.7,23.9,23.9v36c0,13.2-10.7,23.9-23.9,23.9h0"></path></svg>
</div>
</div>
<p>
Scroll
</p>
</div>
CSS
@import url(https://fonts.googleapis.com/css?family=Raleway);
body {
background-color:#21272b;
}
.mouse-wrap {
display:inline-block;
position:absolute;
left:50%;
top:50%;
transform:translate(-50%,-50%);
}
p {
font-family:"Raleway",sans-serif;
letter-spacing:12px;
font-size:14px;
color:#ffffff;
animation:nudgeText 5.5s ease-out infinite;
position:absolute;
left:50%;
top:90px;
transform:translateX(-50%) translateY(0);
margin-left:6px;
}
.mouse {
top:0;
position:absolute;
left:50%;
transform:translateX(-50%);
width:48px;
animation:nudgeMouse 5.5s ease-out infinite;
}
.mouse:after {
content:'';
background-color:#ffffff;
width:7px;
height:7px;
border-radius:100%;
animation:trackBallSlide 5.5s linear infinite;
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
margin:auto;
transform:translateY(20px);
}
.mouse .frame {
width:100%;
position:absolute;
z-index:1;
}
.mouse .frame path {
fill:none;
stroke:#ffffff;
stroke-width:3;
opacity:0.5;
}
.mouse .mouse-left,.mouse .mouse-right {
width:50%;
position:absolute;
z-index:2;
}
.mouse .mouse-right {
right:0;
}
.mouse .Animate-Draw {
fill:none;
stroke:#FFFFFF;
stroke-width:3;
fill-opacity:1;
}
.mouse .mouse-left .Animate-Draw {
animation:DrawLine 5.5s ease-out infinite;
}
.mouse .mouse-right .Animate-Draw {
animation:DrawLineBack 5.5s ease-out infinite;
}
/*Keyframes*/ @keyframes DrawLine {
0% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:1;
}
22% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:1;
}
38% {
stroke-dashOffset:125;
stroke-dasharray:120;
stroke-opacity:1;
}
38.1% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:0;
}
48% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:1;
}
64% {
stroke-dashOffset:125;
stroke-dasharray:120;
stroke-opacity:1;
}
64.1% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:0;
}
74% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:1;
}
90% {
stroke-opacity:1;
stroke-dashOffset:125;
stroke-dasharray:120;
}
90.1% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:0;
}
}
@keyframes DrawLineBack {
0% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:1;
}
22% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:1;
}
38% {
stroke-dashOffset:-114;
stroke-dasharray:120;
stroke-opacity:1;
}
38.1% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:0;
}
48% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:1;
}
64% {
stroke-dashOffset:-114;
stroke-dasharray:120;
stroke-opacity:1;
}
64.1% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:0;
}
74% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:1;
}
90% {
stroke-opacity:1;
stroke-dashOffset:-114;
stroke-dasharray:120;
}
90.1% {
stroke-dashOffset:0;
stroke-dasharray:120;
stroke-opacity:0;
}
}
@keyframes nudgeMouse {
0% {
transform:translateY(0) translateX(-50%);
}
22% {
transform:translateY(0px) translateX(-50%);
}
38% {
transform:translateY(9px) translateX(-50%);
}
48% {
transform:translateY(0px) translateX(-50%);
}
64% {
transform:translateY(9px) translateX(-50%);
}
74% {
transform:translateY(0px) translateX(-50%);
}
90% {
transform:translateY(9px) translateX(-50%);
}
}
/*Text*/ @keyframes nudgeText {
0% {
transform:translateY(0) translateX(-50%) scaleY(1);
opacity:1;
}
22% {
transform:translateY(0px) translateX(-50%) scaleY(1);
opacity:1;
}
38% {
transform:translateY(5px) translateX(-50%) scaleY(0.9);
opacity:0.5;
}
48% {
transform:translateY(0px) translateX(-50%) scaleY(1);
opacity:1;
}
64% {
transform:translateY(5px) translateX(-50%) scaleY(0.9);
opacity:0.5;
}
74% {
transform:translateY(0px) translateX(-50%) scaleY(1);
opacity:1;
}
90% {
transform:translateY(5px) translateX(-50%) scaleY(0.9);
opacity:0.5;
}
}
/*Mouse wheel*/ @keyframes trackBallSlide {
0% {
transform:translateY(20px) scale(1);
opacity:1;
}
22% {
transform:translateY(20px) scale(1);
opacity:1;
}
26% {
transform:translateY(30px) scale(0.9);
opacity:1;
}
34% {
transform:translateY(55px) scale(0.1);
opacity:0;
}
41% {
transform:translateY(30px) scale(0);
opacity:0.3;
}
48% {
transform:translateY(20px) scale(1);
opacity:1;
}
52% {
transform:translateY(30px) scale(0.9);
opacity:1;
}
60% {
transform:translateY(55px) scale(0.1);
opacity:0;
}
67% {
transform:translateY(30px) scale(0);
opacity:0.3;
}
74% {
transform:translateY(20px) scale(1);
opacity:1;
}
78% {
transform:translateY(30px) scale(0.9);
opacity:1;
}
86% {
transform:translateY(55px) scale(0.1);
opacity:0;
}
93% {
transform:translateY(30px) scale(0);
opacity:0.3;
}
100% {
transform:translateY(20px) scale(1);
opacity: 1;
}
}
같이보기
'Web Development > CSS' 카테고리의 다른 글
텍스트 링크에 밑줄 없애는 법 CSS (0) | 2022.08.06 |
---|---|
CSS3 filter 속성과 함수 및 예제 (0) | 2022.08.05 |
스크롤바 없애는 CSS (0) | 2021.10.07 |
이미지 클릭 되지 않게 하는 방법 - pointer-events (0) | 2021.07.24 |
-webkit-이란 무엇인가? (0) | 2021.07.17 |
간단한 웹배너 만드는 방법 (0) | 2021.07.17 |
CSS 다중 선택자 참조 (0) | 2021.07.17 |
웹 디자인을 위한 디바이스 별 스크린 사이즈 (0) | 2021.07.17 |