content logo

Bootstrap Buttons:

Bootstrap Button with Various Rotating Border Effects

Creating the right styles and designs for your buttons is one of the most important parts of web design process. Each state must have clear affordances which are able to distinguish it from the rest of the states and the layout surrounding it; though, keep in mind that it should not change a component too much or create a lot of busy pictures and visual noise. Like other features in a website, button also come in different shapes, sizes and various colours. The most common shape a button uses is rectangle with rounded corners. These buttons can be easily identified in a site and look extremely nice besides an input field.

In this post we are sharing some beautiful Bootstrap flat buttons with really nice button click effects. Normally, these button click events are quite interesting and pleasing to watch so the users would probably want to click on it just to see the animation. Also, as the name suggests, the events occur only when you click the button. the buttons in this code have an effect with rotating point in button. it features different coloured button with the phrase “Click me!” written on each one. upon clicking on the button, different effects will occur. It could be a line, a dot, or multiple lines that rotate on the border of the buttons with different speeds.

#

Bootstrap Flat Button

#

Button Click Event

#

Rotating point in Button

#

Button Click Effect

<!-- This script got from frontendfreecode.com -->
bullet3<div class="button-wrapper">
    <button id="myButton" class="btn btn-default">
        Click me!
        <div class="bullet white"></div>
    </button>
</div>
<div class="button-wrapper">
    <button id="myButton2" class="btn btn-danger">
        Click me!
        <div class="bullet red"></div>
    </button>
</div>
<div class="button-wrapper">
    <button id="myButton3" class="btn btn-default">
        Click me!
        <div class="bullet aqua"></div>
    </button>
</div>
<div class="button-wrapper">
    <button id="myButton4" class="btn btn-success">
        Click me!
        <div class="bullet green"></div>
    </button>
</div>
<div class="button-wrapper">
    <button id="myButton5" class="btn btn-success">
        Click me!
        <div class="bullet multiple"></div>
        <div class="bullet bullet2 multiple"></div>
        <div class="bullet bullet3 multiple"></div>
    </button>
</div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
@keyframes bullet {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
body {
  background: #2d2d2d;
}
.button-wrapper {
  margin: auto;
  margin-top:20px;
  position: relative;
  overflow: hidden;
  top: 10vh;
  width: 89px;
  padding: 2px;
  border-radius: 6px;
}
.button-wrapper button {
  position: relative;
  top: 0;
  left: 0;
  border: 2px solid transparent !important;
  outline: none !important;
}
.button-wrapper button.clicked .bullet {
  display: inline-block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 4px;
  z-index: -1 !important;
  transform-origin: 0% 50%;
}
.button-wrapper button.clicked .bullet.white {
  animation: bullet 2s linear infinite forwards;
  background: white;
  box-shadow: 0 0 4px white;
}
.button-wrapper button.clicked .bullet.red {
  animation: bullet 2s infinite forwards;
  background: red;
  box-shadow: 0 0 4px red;
}
.button-wrapper button.clicked .bullet.aqua {
  animation: bullet 2s linear infinite forwards;
  background: aquamarine;
  box-shadow: 0 0 4px 8px aquamarine;
}
.button-wrapper button.clicked .bullet.green {
  animation: bullet 2s linear infinite forwards;
  background: lightgreen;
  box-shadow: 0 0 0px 0px lightgreen;
}
.button-wrapper button.clicked .bullet.multiple {
  background: white;
  box-shadow: 0 0 0px 0px white;
  animation: bullet 2s linear infinite forwards;
}
.button-wrapper button.clicked .bullet2.multiple {
  background: red;
  box-shadow: 0 0 0px 0px white;
  animation: bullet 3s infinite forwards;
}
.button-wrapper button.clicked .bullet3.multiple {
  background: aquamarine;
  box-shadow: 0 0 0px 0px white;
  animation: bullet 5s ease-in infinite forwards;
}
.button-wrapper button.clicked .bullet4.multiple {
  background: lightgreen;
  box-shadow: 0 0 0px 0px white;
  animation: bullet 6s ease-out infinite forwards;
}
$("#myButton").click(function(e) {
  $(this).addClass("clicked");
});
$("#myButton2").click(function(e) {
  $(this).addClass("clicked");
});
$("#myButton3").click(function(e) {
  $(this).addClass("clicked");
});
$("#myButton4").click(function(e) {
  $(this).addClass("clicked");
});
$("#myButton5").click(function(e) {
  $(this).addClass("clicked");
});
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>
<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>
<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<style>
@keyframes bullet {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
body {
  background: #2d2d2d;
}
.button-wrapper {
  margin: auto;
  margin-top:20px;
  position: relative;
  overflow: hidden;
  top: 10vh;
  width: 89px;
  padding: 2px;
  border-radius: 6px;
}
.button-wrapper button {
  position: relative;
  top: 0;
  left: 0;
  border: 2px solid transparent !important;
  outline: none !important;
}
.button-wrapper button.clicked .bullet {
  display: inline-block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 4px;
  z-index: -1 !important;
  transform-origin: 0% 50%;
}
.button-wrapper button.clicked .bullet.white {
  animation: bullet 2s linear infinite forwards;
  background: white;
  box-shadow: 0 0 4px white;
}
.button-wrapper button.clicked .bullet.red {
  animation: bullet 2s infinite forwards;
  background: red;
  box-shadow: 0 0 4px red;
}
.button-wrapper button.clicked .bullet.aqua {
  animation: bullet 2s linear infinite forwards;
  background: aquamarine;
  box-shadow: 0 0 4px 8px aquamarine;
}
.button-wrapper button.clicked .bullet.green {
  animation: bullet 2s linear infinite forwards;
  background: lightgreen;
  box-shadow: 0 0 0px 0px lightgreen;
}
.button-wrapper button.clicked .bullet.multiple {
  background: white;
  box-shadow: 0 0 0px 0px white;
  animation: bullet 2s linear infinite forwards;
}
.button-wrapper button.clicked .bullet2.multiple {
  background: red;
  box-shadow: 0 0 0px 0px white;
  animation: bullet 3s infinite forwards;
}
.button-wrapper button.clicked .bullet3.multiple {
  background: aquamarine;
  box-shadow: 0 0 0px 0px white;
  animation: bullet 5s ease-in infinite forwards;
}
.button-wrapper button.clicked .bullet4.multiple {
  background: lightgreen;
  box-shadow: 0 0 0px 0px white;
  animation: bullet 6s ease-out infinite forwards;
}
</style>

</head>
<body>
bullet3<div class="button-wrapper">
    <button id="myButton" class="btn btn-default">
        Click me!
        <div class="bullet white"></div>
    </button>
</div>
<div class="button-wrapper">
    <button id="myButton2" class="btn btn-danger">
        Click me!
        <div class="bullet red"></div>
    </button>
</div>
<div class="button-wrapper">
    <button id="myButton3" class="btn btn-default">
        Click me!
        <div class="bullet aqua"></div>
    </button>
</div>
<div class="button-wrapper">
    <button id="myButton4" class="btn btn-success">
        Click me!
        <div class="bullet green"></div>
    </button>
</div>
<div class="button-wrapper">
    <button id="myButton5" class="btn btn-success">
        Click me!
        <div class="bullet multiple"></div>
        <div class="bullet bullet2 multiple"></div>
        <div class="bullet bullet3 multiple"></div>
    </button>
</div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>
<script>
$("#myButton").click(function(e) {
  $(this).addClass("clicked");
});
$("#myButton2").click(function(e) {
  $(this).addClass("clicked");
});
$("#myButton3").click(function(e) {
  $(this).addClass("clicked");
});
$("#myButton4").click(function(e) {
  $(this).addClass("clicked");
});
$("#myButton5").click(function(e) {
  $(this).addClass("clicked");
});
</script>

</body>
</html>
Preview