| <!doctype html>
|
| <html>
|
| <head>
|
| <meta charset="utf-8">
|
| <title> Heart Beat Animation </title>
|
| <style>
|
| *{
|
| margin: 0;
|
| padding: 0;
|
| font-family: "Montserrat",sans-serif;
|
| }
|
| body{
|
| height: 100vh;
|
| display: flex;
|
| align-items: center;
|
| justify-content: center;
|
| background: #786fa6;
|
| }
|
| .text{
|
| font-size: 60px;
|
| color: #f1f1f1;
|
| cursor: pointer;
|
| }
|
| .box{
|
| width: 200px;
|
| height: 100px;
|
| background: #f19066;
|
| margin: 40px auto;
|
| cursor: pointer;
|
| }
|
| .text:hover,
|
| .box:hover{
|
| animation: heartBeat 1.5s infinite;
|
| }
|
| @keyframes heartBeat{
|
| from{
|
| transform: scale(1);
|
| }
|
| 14%{
|
| transform: scale(1.3);
|
| }
|
| 28%{
|
| transform: scale(1);
|
| }
|
| 42%{
|
| transform: scale(1.3)
|
| }
|
| 70%{
|
| transform: scale(1);
|
| }
|
| }
|
| }
|
| </style>
|
| </head>
|
| <h3 class="text"> HeartBeat</h3>
|
| <div class="box">
|
|
|
| </div>
|
| <body>
|
| </body>
|
| </html>
|
| |