메뉴의 텍스트를 마우스로 오버시 위 아래로 움직이며 텍스트가 변경되는 효과를 부여하려고 할 때 이용하세요.
<div class="back color-1">
<div class="row columns">
<ul class="menu align-center expanded text-center SMN_effect-31">
<li>
<a href="" data-hover="홈"><span>Home</span></a>
</li>
<li>
<a href="" data-hover="회사소개"><span>About</span></a>
</li>
<li>
<a href="" data-hover="갤러리"><span>Gallery</span></a>
</li>
<li>
<a href="" data-hover="메모"><span>Notes</span></a>
</li>
<li>
<a href="" data-hover="문의하기"><span>Contact</span></a>
</li>
</ul>
</div>
</div>
.SMN_effect-31 {display:flex;}
.SMN_effect-31 li {margin-right:30px;width:120px;}
.SMN_effect-31 li:last-child {margin-right:0px;}
.SMN_effect-31 a {
position: relative;
overflow: hidden;
display: block;
text-align: center;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
padding: 0;
}
.SMN_effect-31 a span {
display: block;
-webkit-transition: -webkit-transform 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
transition: -webkit-transform 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
transition: transform 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
transition: transform 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55), -webkit-transform 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.SMN_effect-31 a:after {
position: absolute;
top: 100%;
left: 0;
right: 0;
content: attr(data-hover);
display: inline;
text-align: center;
-webkit-transition: top 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
transition: top 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.SMN_effect-31 a:hover {
color: #f89420;
}
.SMN_effect-31 a:hover span {
color: #f89420;
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
}
.SMN_effect-31 a:hover:after {
top: 0;
}
.SMN_effect-31 a:active {
-webkit-animation-name: rubberBand;
animation-name: rubberBand;
}
'코딩 > HTML ㅣ CSS' 카테고리의 다른 글
전체페이지 스크롤 fullpage.js 사용법 알아보기 (0) | 2024.08.27 |
---|---|
[HTML/CSS] iframe 유튜브 동영상 반응형으로 사이즈 조절하기 (0) | 2024.08.14 |
[CSS] 한눈에 보는 Flex 속성 이해하기 (0) | 2024.07.31 |