수업 중 다양한 버튼 실습을 해본 뒤, 직접 나만의 버튼을 만들어보았다.
.btn {
width: 200px;
height: 200px;
border: 10px solid rgb(0, 183, 255);
background:rgb(255, 243, 79);
border-radius: 20%;
margin: 300px 600px;
transition: all 1s;
font-size: 70px;
transition: all 2s;
overflow: hidden;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.btn::before {
content: '';
position: absolute;
color: white;
background-color: rgb(0, 183, 255);
top: 0;
left: 0;
width: 100%;
height: 100%;
transform: translateY(300px);
transition: all 2s;
display: flex;
align-items: center;
justify-content: center;
}
.btn:hover::before {
transform: translateY(0);
}
.click:hover {
animation: shake 0.5s;
animation-iteration-count: infinite;
}
@keyframes shake {
0% { transform: translate(5px, 5px) rotate(0deg); }
50% { transform: translate(-5px, 5px) rotate(-5deg); }
100% { transform: translate(5px, -5px) rotate(-5deg); }
}
<div class="btn">
<div class="click">🐟</div>
</div>