Skip to content

Instantly share code, notes, and snippets.

@sumantaparida
Created February 3, 2021 19:16
Show Gist options
  • Save sumantaparida/e7758e22ed822bdf9c74783bccf2e88e to your computer and use it in GitHub Desktop.
Save sumantaparida/e7758e22ed822bdf9c74783bccf2e88e to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/butabusiyu
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.animateButton {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 15px 5px 0px;
color: red;
outline: none;
border: none;
background-color: transparent;
cursor: pointer;
position: relative;
background: linear-gradient(to left, transparent 50%, red 50%) right;
background-size: 200%;
transition: .5s cubic-bezier(0, 0, 0, 1.02);
border-radius: 50px;
overflow: hidden;
}
.animateButton > span {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin: auto;
width: 30px;
height: 30px;
border-radius: 50px;
background-color: red;
transition: all 1s;
margin-right: 10px;
}
.animateButton:hover {
background-position: left;
color: white;
}
.animateButton:hover > span.icon {
transform: rotate(180deg);
}
</style>
</head>
<body>
<button class="animateButton">
<span class="icon"><svg width="16" height="16" viewBox="0 0 21 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.0901 8L6.72325 1.27675L15.5563 8L6.72325 14.7232L11.0901 8Z" fill="white"/>
</svg>
</span>Optimise your marketing today</button>
<script id="jsbin-source-css" type="text/css">.animateButton {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 15px 5px 0px;
color: red;
outline: none;
border: none;
background-color: transparent;
cursor: pointer;
position: relative;
background: linear-gradient(to left, transparent 50%, red 50%) right;
background-size: 200%;
transition: .5s cubic-bezier(0, 0, 0, 1.02);
border-radius: 50px;
overflow: hidden;
}
.animateButton > span {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin: auto;
width: 30px;
height: 30px;
border-radius: 50px;
background-color: red;
transition: all 1s;
margin-right: 10px;
}
.animateButton:hover {
background-position: left;
color: white;
}
.animateButton:hover > span.icon {
transform: rotate(180deg);
}
</script>
</body>
</html>
.animateButton {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 15px 5px 0px;
color: red;
outline: none;
border: none;
background-color: transparent;
cursor: pointer;
position: relative;
background: linear-gradient(to left, transparent 50%, red 50%) right;
background-size: 200%;
transition: .5s cubic-bezier(0, 0, 0, 1.02);
border-radius: 50px;
overflow: hidden;
}
.animateButton > span {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin: auto;
width: 30px;
height: 30px;
border-radius: 50px;
background-color: red;
transition: all 1s;
margin-right: 10px;
}
.animateButton:hover {
background-position: left;
color: white;
}
.animateButton:hover > span.icon {
transform: rotate(180deg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment