Back to buttons

Live preview

Preview settings

Changes appear as you type. Use Tab to test keyboard focus.

⌘ / Ctrl + S saves locally

FlipCover

HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.

By @shraddha761

Remix button

Button submission checks

Checks will appear after the preview updates.

Buttons only: no full pages, forms, cards or navigation. Put scripts in the JavaScript tab. Tailwind uses utilities from HTML and JavaScript; use complete class names. Custom CSS supports plain CSS, without @apply, imports or plugins.

Accessibility quick check

Waiting for the rendered preview…

Try Tab, Enter and Space in the preview. Check the focus ring, hover and disabled states, then enable Reduce motion. These checks are guidance, not an accessibility certification.

Explore freely here. Remix to publish your version with credit to the creator.

About FlipCover

FlipCover is an animated CSS button by @shraddha761. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects, Icon, Social, 3D
Using this example
Copy the HTML or download index.html, style.css and app.js. Test keyboard focus, motion and contrast in your own project.

Usage, Tailwind and licensing questions

Read the source files

HTML

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>FlipCover </title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="./style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>

</head>
<body>
<!-- partial:index.partial.html -->
<div class="flip-cover-dribbble"></div>
<div class="flip-cover-twiter"></div>
<div class="flip-cover-linkedin"></div>
<div class="flip-cover-email"></div>
<!-- partial -->
  <script src='//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://raw.githubusercontent.com/vveleva/flipCover/master/flip_cover.js'></script><script  src="./app.js"></script>

</body>
</html>

CSS


html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image: -webkit-radial-gradient(center top, circle farthest-corner, #fff 0%, #d8dfe9 100%);
  background-image: radial-gradient(circle farthest-corner at center top, #fff 0%, #d8dfe9 100%);
  overflow: hidden;
}

@font-face {
  font-family: icon;
  src: url("https://bennettfeely.com/fonts/icons.woff");
}
.dribbble-section, .dribbble-section * {
  box-sizing: border-box;
}

.dribbble-section, .dribbble-section div {
  transition-duration: 0.6s;
}

.dribbble-section {
  margin-bottom: 10px;
  display: inline-block;
  position: relative;
  padding: 0.375em 0.375em 0;
  min-height: 2.5em;
  background: #A9ADB6;
  border-radius: 0.25em;
  perspective: 300;
  box-shadow: 0 -1px 2px #fff, inset 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0.25em 1em rgba(0, 0, 0, 0.1);
}

.dribbble-button {
  text-align: center;
  transition-timing-function: ease;
  opacity: 0;
}
.dribbble-button a {
  text-decoration: none;
  font-weight: bold;
  color: #fc1786;
}

.dribbble-cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform-origin: left bottom;
  transform-style: preserve-3d;
  font: 1.25em/2 "icon";
  color: white;
  text-align: center;
  pointer-events: none;
  z-index: 100;
}

.dribbble-inner, .dribbble-outer {
  position: absolute;
  width: 100%;
  height: 100%;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border-radius: 0.25em;
  background-image: -webkit-linear-gradient(top, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
}
.dribbble-inner:after, .dribbble-outer:after {
  content: "d";
}

.dribbble-outer {
  background-color: #fc1786;
  transform: translateZ(0.25em);
}

.dribbble-inner {
  background-color: #fd49a0;
}

.dribbble-section:hover {
  background: #EBEFF2;
}
.dribbble-section:hover .dribbble-button {
  opacity: 1;
}
.dribbble-section:hover .dribbble-cover {
  transform: rotateY(-120deg);
}
.dribbble-section:hover .dribbble-inner {
  background-color: #fc1786;
}
.dribbble-section:hover .dribbble-outer {
  background-color: #ab0254;
}
.dribbble-section:hover .dribbble-cover, .dribbble-section:hover .dribbble-inner, .dribbble-section:hover .dribbble-outer {
  transition-timing-function: cubic-bezier(0.2, 0.7, 0.1, 1.1);
}

.twiter-section, .twiter-section * {
  box-sizing: border-box;
}

.twiter-section, .twiter-section div {
  transition-duration: 0.6s;
}

.twiter-section {
  margin-bottom: 10px;
  display: inline-block;
  position: relative;
  padding: 0.375em 0.375em 0;
  min-height: 2.5em;
  background: #A9ADB6;
  border-radius: 0.25em;
  perspective: 300;
  box-shadow: 0 -1px 2px #fff, inset 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0.25em 1em rgba(0, 0, 0, 0.1);
}

.twiter-button {
  text-align: center;
  transition-timing-function: ease;
  opacity: 0;
}
.twiter-button a {
  text-decoration: none;
  font-weight: bold;
  color: #2ec8fa;
}

.twiter-cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform-origin: left bottom;
  transform-style: preserve-3d;
  font: 1.25em/2 "icon";
  color: white;
  text-align: center;
  pointer-events: none;
  z-index: 100;
}

.twiter-inner, .twiter-outer {
  position: absolute;
  width: 100%;
  height: 100%;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border-radius: 0.25em;
  background-image: -webkit-linear-gradient(top, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
}
.twiter-inner:after, .twiter-outer:after {
  content: "t";
}

.twiter-outer {
  background-color: #2ec8fa;
  transform: translateZ(0.25em);
}

.twiter-inner {
  background-color: #60d5fb;
}

.twiter-section:hover {
  background: #EBEFF2;
}
.twiter-section:hover .twiter-button {
  opacity: 1;
}
.twiter-section:hover .twiter-cover {
  transform: rotateY(-120deg);
}
.twiter-section:hover .twiter-inner {
  background-color: #2ec8fa;
}
.twiter-section:hover .twiter-outer {
  background-color: #0590bd;
}
.twiter-section:hover .twiter-cover, .twiter-section:hover .twiter-inner, .twiter-section:hover .twiter-outer {
  transition-timing-function: cubic-bezier(0.2, 0.7, 0.1, 1.1);
}

.linkedin-section, .linkedin-section * {
  box-sizing: border-box;
}

.linkedin-section, .linkedin-section div {
  transition-duration: 0.6s;
}

.linkedin-section {
  margin-bottom: 10px;
  display: inline-block;
  position: relative;
  padding: 0.375em 0.375em 0;
  min-height: 2.5em;
  background: #A9ADB6;
  border-radius: 0.25em;
  perspective: 300;
  box-shadow: 0 -1px 2px #fff, inset 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0.25em 1em rgba(0, 0, 0, 0.1);
}

.linkedin-button {
  text-align: center;
  transition-timing-function: ease;
  opacity: 0;
}
.linkedin-button a {
  text-decoration: none;
  font-weight: bold;
  color: #2672ae;
}

.linkedin-cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform-origin: left bottom;
  transform-style: preserve-3d;
  font: 1.25em/2 "icon";
  color: white;
  text-align: center;
  pointer-events: none;
  z-index: 100;
}

.linkedin-inner, .linkedin-outer {
  position: absolute;
  width: 100%;
  height: 100%;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border-radius: 0.25em;
  background-image: -webkit-linear-gradient(top, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
}
.linkedin-inner:after, .linkedin-outer:after {
  content: "in";
}

.linkedin-outer {
  background-color: #2672ae;
  transform: translateZ(0.25em);
}

.linkedin-inner {
  background-color: #348dd3;
}

.linkedin-section:hover {
  background: #EBEFF2;
}
.linkedin-section:hover .linkedin-button {
  opacity: 1;
}
.linkedin-section:hover .linkedin-cover {
  transform: rotateY(-120deg);
}
.linkedin-section:hover .linkedin-inner {
  background-color: #2672ae;
}
.linkedin-section:hover .linkedin-outer {
  background-color: #143b5a;
}
.linkedin-section:hover .linkedin-cover, .linkedin-section:hover .linkedin-inner, .linkedin-section:hover .linkedin-outer {
  transition-timing-function: cubic-bezier(0.2, 0.7, 0.1, 1.1);
}

.email-section, .email-section * {
  box-sizing: border-box;
}

.email-section, .email-section div {
  transition-duration: 0.6s;
}

.email-section {
  margin-bottom: 10px;
  display: inline-block;
  position: relative;
  padding: 0.375em 0.375em 0;
  min-height: 2.5em;
  background: #A9ADB6;
  border-radius: 0.25em;
  perspective: 300;
  box-shadow: 0 -1px 2px #fff, inset 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0.25em 1em rgba(0, 0, 0, 0.1);
}

.email-button {
  text-align: center;
  transition-timing-function: ease;
  opacity: 0;
}
.email-button a {
  text-decoration: none;
  font-weight: bold;
  color: #f80;
}

.email-cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform-origin: left bottom;
  transform-style: preserve-3d;
  font: 1.25em/2 "icon";
  color: white;
  text-align: center;
  pointer-events: none;
  z-index: 100;
}

.email-inner, .email-outer {
  position: absolute;
  width: 100%;
  height: 100%;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border-radius: 0.25em;
  background-image: -webkit-linear-gradient(top, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
}
.email-inner:after, .email-outer:after {
  content: "g";
}

.email-outer {
  background-color: #f80;
  transform: translateZ(0.25em);
}

.email-inner {
  background-color: #ffa033;
}

.email-section:hover {
  background: #EBEFF2;
}
.email-section:hover .email-button {
  opacity: 1;
}
.email-section:hover .email-cover {
  transform: rotateY(-120deg);
}
.email-section:hover .email-inner {
  background-color: #f80;
}
.email-section:hover .email-outer {
  background-color: #995200;
}
.email-section:hover .email-cover, .email-section:hover .email-inner, .email-section:hover .email-outer {
  transition-timing-function: cubic-bezier(0.2, 0.7, 0.1, 1.1);
}

JavaScript

function flipCover (css, options) {
    var options = options || {}
    if (typeof css === "object") {
      options = css
    } else {
      options.css = css
    }
  
    var css = options.css
    var url = options.url
    var text = options.text || css
    var width = options.width
    var height = options.height
  
    var $section = $(".flip-cover-" + css).addClass(css + "-section")
    var $button = $("<div>").addClass(css + "-button")
    var $cover = $("<div>").addClass(css + "-cover")
    var $outer = $("<div>").addClass(css + "-outer")
    var $inner = $("<div>").addClass(css + "-inner")
  
    if (width) {
      $section.css("width", width)
    }
  
    if (height) {
      $section.css("height", height)
  
      var lineHeight = ':after{ line-height: ' + height + ';}'
      var $outerStyle = $('<style>').text('.' + css + '-outer' + lineHeight)
      $outerStyle.appendTo($outer)
      var $innerStyle = $('<style>').text('.' + css + '-inner' + lineHeight)
      $innerStyle.appendTo($inner)
    }
  
    $cover.html($outer)
    $inner.insertAfter($outer)
  
    $button.html($("<a>").text(text).attr("href", url))
  
    $section.html($button)
    $cover.insertAfter($button)
   }
  
  
  
  flipCover({
    css: "dribbble",
    url: "https://dribbble.com/vveleva",
    text: "vveleva",
    width: "80px"
  })
  
  flipCover("twiter", {
    url: "https://twitter.com/vveleva",
    text: "vveleva",
    width: "80px"
  })
  
  flipCover("linkedin", {
    url: "https://linkedin.com/in/vveleva",
    text: "vveleva",
    width: "80px"
  })
  
  flipCover("email", {
    text: "vvveleva @gmail",
    width: "80px",
    height: "50px"
  })