Skip to content

CSS Pulse Button

HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
     <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="1.page.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>
    
    <a href="#">Button</a>

</body>
</html>

CSS CODE:

body{
    padding: 0;
    margin: 0;
}
a{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) skewX(-20deg);
    padding: 10px 30px;
    border:2px solid #000;
    font-family: sans-serif;
    color: #000;
    background-color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 24px;
    display: block;
    box-sizing:border-box;
}
a:hover{
    animation: ani 0.3s linear;
    animation-delay: 0.7s;
}
a:before{
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    bottom: 2px;
    right: 2px;
    background-color: #fff;
    mix-blend-mode: difference;
    transform: scaleX(0);
    transition: 0.5s;
}
a:hover:before{
    transform: scaleX(1);
    transition-delay:1.2s;
}
@keyframes ani{
    0%{
        transform: translate(-50%,-50%) skewX(-20deg); 
    }
    25%{
        transform: translate(-50%,-50%) skewX(20deg); 
    }
    50%{
        transform: translate(-50%,-50%) skewX(-20deg); 
    }
    75%{
        transform: translate(-50%,-50%) skewX(20deg); 
    }
    100%{
        transform: translate(-50%,-50%) skewX(-20deg); 
    }
}

1 Comment »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: