/* =============================================================================
  DEMO STUFF
============================================================================= */
.demo-title {
  margin-bottom: 24px;
  color: #ff9650;
  font-size: 28px;
}

.items {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-flex-wrap: wrap;
      -ms-flex-wrap: wrap;
          flex-wrap: wrap;
  margin-bottom: 24px;
}

.item {
  margin: 12px;
}

/* =============================================================================
  MENU TOGGLE SWITCHES
============================================================================= */
/**
 * Toggle Switch Globals
 *
 * All switches should take on the class `cmn-toggle-switch` as well as their
 * variant that will give them unique properties. This class is an overview
 * class that acts as a reset for all versions of the icon.
 */
.cmn-toggle-switch {
  display: block;
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
  width: 108px;
  height: 96px;
  font-size: 0;
  text-indent: -9999px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none;
  border-radius: none;
  border: none;
  cursor: pointer;
  -webkit-transition: background 0.3s;
          transition: background 0.3s;
}

.cmn-toggle-switch:focus {
  outline: none;
}

.cmn-toggle-switch span {
  display: block;
  position: absolute;
  top: 45px;
  left: 18px;
  right: 18px;
  height: 6px;
  background: white;
}

.cmn-toggle-switch span::before,
.cmn-toggle-switch span::after {
  position: absolute;
  display: block;
  left: 0;
  width: 100%;
  height: 6px;
  background-color: #fff;
  content: "";
}

.cmn-toggle-switch span::before {
  top: -27px;
}

.cmn-toggle-switch span::after {
  bottom: -27px;
}

/**
 * Style 1
 *
 * Rotating hamburger icon (rot), that simply rotates 90 degrees when activated.
 * Nothing too fancy, simple transition.
 */
.cmn-toggle-switch__rot {
  background-color: #28aadc;
}

.cmn-toggle-switch__rot span {
  -webkit-transition: -webkit-transform 0.3s;
          transition: transform 0.3s;
}

/* active state, i.e. menu open */
.cmn-toggle-switch__rot.active {
  background-color: #166888;
}

.cmn-toggle-switch__rot.active span {
  -webkit-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
          transform: rotate(90deg);
}

/**
 * Style 2
 *
 * Hamburger to "x" (htx). Takes on a hamburger shape, bars slide
 * down to center and transform into an "x".
 */
.cmn-toggle-switch__htx {
  background-color: #ff3264;
}

.cmn-toggle-switch__htx span {
  -webkit-transition: background 0 0.3s;
          transition: background 0 0.3s;
}

.cmn-toggle-switch__htx span::before,
.cmn-toggle-switch__htx span::after {
  -webkit-transition-duration: 0.3s, 0.3s;
          transition-duration: 0.3s, 0.3s;
  -webkit-transition-delay: 0.3s, 0;
          transition-delay: 0.3s, 0;
}

.cmn-toggle-switch__htx span::before {
  -webkit-transition-property: top, -webkit-transform;
          transition-property: top, transform;
}

.cmn-toggle-switch__htx span::after {
  -webkit-transition-property: bottom, -webkit-transform;
          transition-property: bottom, transform;
}

/* active state, i.e. menu open */
.cmn-toggle-switch__htx.active {
  background-color: #cb0032;
}

.cmn-toggle-switch__htx.active span {
  background: none;
}

.cmn-toggle-switch__htx.active span::before {
  top: 0;
  -webkit-transform: rotate(45deg);
      -ms-transform: rotate(45deg);
          transform: rotate(45deg);
}

.cmn-toggle-switch__htx.active span::after {
  bottom: 0;
  -webkit-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
          transform: rotate(-45deg);
}

.cmn-toggle-switch__htx.active span::before,
.cmn-toggle-switch__htx.active span::after {
  -webkit-transition-delay: 0, 0.3s;
          transition-delay: 0, 0.3s;
}

/**
 * Style 3
 *
 * Hamburger to left-arrow (htla). Hamburger menu transforms to a left-pointing
 * arrow. Usually indicates an off canvas menu sliding in from left that
 * will be close on re-click of the icon.
 */
.cmn-toggle-switch__htla {
  background-color: #32dc64;
}

.cmn-toggle-switch__htla span {
  -webkit-transition: -webkit-transform 0.3s;
          transition: transform 0.3s;
}

.cmn-toggle-switch__htla span::before {
  -webkit-transform-origin: top right;
      -ms-transform-origin: top right;
          transform-origin: top right;
  -webkit-transition: -webkit-transform 0.3s, width 0.3s, top 0.3s;
          transition: transform 0.3s, width 0.3s, top 0.3s;
}

.cmn-toggle-switch__htla span::after {
  -webkit-transform-origin: bottom right;
      -ms-transform-origin: bottom right;
          transform-origin: bottom right;
  -webkit-transition: -webkit-transform 0.3s, width 0.3s, bottom 0.3s;
          transition: transform 0.3s, width 0.3s, bottom 0.3s;
}

/* active state, i.e. menu open */
.cmn-toggle-switch__htla.active {
  background-color: #18903c;
}

.cmn-toggle-switch__htla.active span {
  -webkit-transform: rotate(180deg);
      -ms-transform: rotate(180deg);
          transform: rotate(180deg);
}

.cmn-toggle-switch__htla.active span::before,
.cmn-toggle-switch__htla.active span::after {
  width: 50%;
}

.cmn-toggle-switch__htla.active span::before {
  top: 0;
  -webkit-transform: translateX(42px) translateY(3px) rotate(45deg);
      -ms-transform: translateX(42px) translateY(3px) rotate(45deg);
          transform: translateX(42px) translateY(3px) rotate(45deg);
}

.cmn-toggle-switch__htla.active span::after {
  bottom: 0;
  -webkit-transform: translateX(42px) translateY(-3px) rotate(-45deg);
      -ms-transform: translateX(42px) translateY(-3px) rotate(-45deg);
          transform: translateX(42px) translateY(-3px) rotate(-45deg);
}

/**
 * Style 4
 *
 * Hamburger to right-arrow (htra). Hamburger menu transforms to a
 * right-pointing arrow. Usually indicates an off canvas menu sliding in from
 * right that will be close on re-click of the icon.
 */
.cmn-toggle-switch__htra {
  background-color: #ff9650;
}

.cmn-toggle-switch__htra span {
  -webkit-transition: -webkit-transform 0.3s;
          transition: transform 0.3s;
}

.cmn-toggle-switch__htra span::before {
  -webkit-transform-origin: top left;
      -ms-transform-origin: top left;
          transform-origin: top left;
  -webkit-transition: -webkit-transform 0.3s, width 0.3s, top 0.3s;
          transition: transform 0.3s, width 0.3s, top 0.3s;
}

.cmn-toggle-switch__htra span::after {
  -webkit-transform-origin: bottom left;
      -ms-transform-origin: bottom left;
          transform-origin: bottom left;
  -webkit-transition: -webkit-transform 0.3s, width 0.3s, bottom 0.3s;
          transition: transform 0.3s, width 0.3s, bottom 0.3s;
}

/* active state, i.e. menu open */
.cmn-toggle-switch__htra.active {
  background-color: #e95d00;
}

.cmn-toggle-switch__htra.active span {
  -webkit-transform: rotate(180deg);
      -ms-transform: rotate(180deg);
          transform: rotate(180deg);
}

.cmn-toggle-switch__htra.active span::before,
.cmn-toggle-switch__htra.active span::after {
  width: 50%;
}

.cmn-toggle-switch__htra.active span::before {
  top: 0;
  -webkit-transform: translateX(-6px) translateY(3px) rotate(-45deg);
      -ms-transform: translateX(-6px) translateY(3px) rotate(-45deg);
          transform: translateX(-6px) translateY(3px) rotate(-45deg);
}

.cmn-toggle-switch__htra.active span::after {
  bottom: 0;
  -webkit-transform: translateX(-6px) translateY(-3px) rotate(45deg);
      -ms-transform: translateX(-6px) translateY(-3px) rotate(45deg);
          transform: translateX(-6px) translateY(-3px) rotate(45deg);
}
</style>

<style>
.box{
    width: 300px;
    height: 200px;
    margin: 200px auto;
}
div.bd div{background: #e50065; position:absolute;-webkit-transition:all .2s ease-in-out .2s;transition:all .2s ease-in-out .2s;}

.active .bd div{background: #f00;}
.active .bd div.bdT{width: 100%; height:1px; top:0; left:0;}
.active .bd div.bdB{width: 100%; height:1px; bottom:0; right:0;}
.active .bd div.bdR{height:100%; width :1px; right:0; top:0;}
.active .bd div.bdL{height:100%; width :1px; left:0; bottom:0;}

div.bdT{width: 0;}
div.bdB{width: 0;}
div.bdR{height:0;}
div.bdL{height:0;}

.box:hover .bd div.bdT{width: 0;}
.box:hover .bd div.bdB{width: 0;}
.box:hover .bd div.bdR{height:0;}
.box:hover .bd div.bdL{height:0;}

.path{
    stroke:#e50065;
    fill:none;
    stroke-width:1;
    stroke-dasharray: 3000;
    stroke-dashoffset:3000;
    -moz-animation:DASH 2s ease-in-out 1s forwards;
    -webkit-animation:DASH 2s ease-in-out 1s forwards;
    -o-animation:DASH 2s ease-in-out 1s forwards;
    animation:DASH 2s ease-in-out 1s forwards;
    -webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;
}

@keyframes DASH{
    0%  {stroke-dashoffset:3000;fill:#000;}
    60% {stroke-dashoffset:2000;fill:#e50065;}
    100%{stroke-dashoffset:0;fill:#e50065;}
}

@-moz-keyframes DASH{
    0%  {stroke-dashoffset:3000;fill:#000;}
    60% {stroke-dashoffset:2000;fill:#e50065;}
    100%{stroke-dashoffset:0;fill:#e50065;}
}

@-webkit-keyframes DASH{
    0%  {stroke-dashoffset:3000;fill:#000;}
    60% {stroke-dashoffset:2000;fill:#e50065;}
    100%{stroke-dashoffset:0;fill:#e50065;}
}

@-o-keyframes DASH{
    0%  {stroke-dashoffset:3000;fill:#000;}
    60% {stroke-dashoffset:2000;fill:#e50065;}
    100%{stroke-dashoffset:0;fill:#e50065;}
}

@-ms-keyframes DASH{
    0%  {stroke-dashoffset:3000;fill:#000;}
    60% {stroke-dashoffset:2000;fill:#e50065;}
    100%{stroke-dashoffset:0;fill:#e50065;}
}
