728x90
버튼 디자인 2
좋아요 버튼 등으로 활용할 수 있는 버튼이다.
✔️ HTML
<button class="like">
<span class="material-icons-outlined before">favorite_border</span>
<span class="material-icons-outlined after">favorite</span>
<span class="text">Like</span>
</button>
✔️ CSS
.like {
display: flex;
gap: 10px;
justify-content: space-between;
align-items: center;
padding: 15px;
background-color: #fc8989;
border-radius: 35px;
border: 0px;
font-size: 25px;
margin: 0 auto;
color: #fff;
cursor: pointer;
transition: all .5s;
}
.like:hover {
background-color: #ff6e6e;
}
.like:hover .before {
opacity: 0;
}
.like .after {
position: absolute;
opacity: 0;
color: #fff;
}
.like:hover .after {
opacity: 1;
animation: beat 1s infinite;
}
@keyframes beat {
0% {
transform: scale(1);
}
15% {
transform: scale(1.15);
}
30% {
transform: scale(1);
}
45% {
transform: scale(1.15);
}
60% {
transform: scale(1);
}
}
✔️ GitHub
반응형
'개발 > UI' 카테고리의 다른 글
체크박스 디자인-2 (checkbox Design-2 with CSS) (10) | 2023.05.21 |
---|---|
체크박스 디자인-1 (checkbox Design-1 with CSS) (9) | 2023.05.09 |
스위치 디자인-1 (Switch Design-1 with CSS) (1) | 2023.05.02 |
알림 디자인-1 (notification Design-1 with CSS) (2) | 2023.05.02 |
버튼 디자인-1 (button Design-1 with CSS) (1) | 2023.04.26 |
댓글