<template id="test-blobby" >
<style data-src="/src/external/font-awesome/css/font-awesome.css"></style>
<style data-src="/templates/livelystyle.css"></style>
<style>
/*
 * gracefully stolen from Lucas Bebber: https://css-tricks.com/gooey-effect/
 */
:host {
  background: #009688;
  color: white;
  text-align: center;
}

a {
  color: inherit;
}

h1, h2, h3, h4 {
  margin: 0;
  margin-bottom: 10px;
  margin-top: 10px;
}

h1 {
  font-size: 3em;
}

.menu {
  -webkit-filter: url("#shadowed-goo");
          filter: url("#shadowed-goo");
}

.menu-item, .menu-open-button {
  background: #ffc107;
  border-radius: 100%;
  width: 80px;
  height: 80px;
  margin-left: -40px;
  position: absolute;
  top: 20px;
  color: white;
  text-align: center;
  line-height: 80px;
  -webkit-transform: translate3d(0, 0, 0);
          transform: translate3d(0, 0, 0);
  -webkit-transition: -webkit-transform ease-out 200ms;
  transition: -webkit-transform ease-out 200ms;
  transition: transform ease-out 200ms;
  transition: transform ease-out 200ms, -webkit-transform ease-out 200ms;
}

.menu-open {
  display: none;
}

.hamburger {
  width: 25px;
  height: 3px;
  background: white;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -12.5px;
  margin-top: -1.5px;
  -webkit-transition: -webkit-transform 200ms;
  transition: -webkit-transform 200ms;
  transition: transform 200ms;
  transition: transform 200ms, -webkit-transform 200ms;
}

.hamburger-1 {
  -webkit-transform: translate3d(0, -8px, 0);
          transform: translate3d(0, -8px, 0);
}

.hamburger-2 {
  -webkit-transform: translate3d(0, 0, 0);
          transform: translate3d(0, 0, 0);
}

.hamburger-3 {
  -webkit-transform: translate3d(0, 8px, 0);
          transform: translate3d(0, 8px, 0);
}

.menu-open:checked + .menu-open-button .hamburger-1 {
  -webkit-transform: translate3d(0, 0, 0) rotate(45deg);
          transform: translate3d(0, 0, 0) rotate(45deg);
}

.menu-open:checked + .menu-open-button .hamburger-2 {
  -webkit-transform: translate3d(0, 0, 0) scale(0.1, 1);
          transform: translate3d(0, 0, 0) scale(0.1, 1);
}

.menu-open:checked + .menu-open-button .hamburger-3 {
  -webkit-transform: translate3d(0, 0, 0) rotate(-45deg);
          transform: translate3d(0, 0, 0) rotate(-45deg);
}

.menu {
  position: absolute;
  left: 50%;
  margin-left: -80px;
  padding-top: 20px;
  padding-left: 80px;
  width: 650px;
  height: 150px;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  font-size: 20px;
  text-align: left;
}

.menu-item:hover {
  background: white;
  color: #ffc107;
}

.menu-item:nth-child(3) {
  -webkit-transition-duration: 180ms;
          transition-duration: 180ms;
}

.menu-item:nth-child(4) {
  -webkit-transition-duration: 180ms;
          transition-duration: 180ms;
}

.menu-item:nth-child(5) {
  -webkit-transition-duration: 180ms;
          transition-duration: 180ms;
}

.menu-item:nth-child(6) {
  -webkit-transition-duration: 180ms;
          transition-duration: 180ms;
}

.menu-open-button {
  z-index: 2;
  -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
          transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-transition-duration: 400ms;
          transition-duration: 400ms;
  -webkit-transform: scale(1.1, 1.1) translate3d(0, 0, 0);
          transform: scale(1.1, 1.1) translate3d(0, 0, 0);
  cursor: pointer;
}

.menu-open-button:hover {
  -webkit-transform: scale(1.2, 1.2) translate3d(0, 0, 0);
          transform: scale(1.2, 1.2) translate3d(0, 0, 0);
}

.menu-open:checked + .menu-open-button {
  -webkit-transition-timing-function: linear;
          transition-timing-function: linear;
  -webkit-transition-duration: 200ms;
          transition-duration: 200ms;
  -webkit-transform: scale(0.8, 0.8) translate3d(0, 0, 0);
          transform: scale(0.8, 0.8) translate3d(0, 0, 0);
}

.menu-open:checked ~ .menu-item {
  -webkit-transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
          transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
}

.menu-open:checked ~ .menu-item:nth-child(3) {
  -webkit-transition-duration: 170ms;
          transition-duration: 170ms;
  -webkit-transform: translate3d(80px, 0, 0);
          transform: translate3d(80px, 0, 0);
}

.menu-open:checked ~ .menu-item:nth-child(4) {
  -webkit-transition-duration: 250ms;
          transition-duration: 250ms;
  -webkit-transform: translate3d(160px, 0, 0);
          transform: translate3d(160px, 0, 0);
}

.menu-open:checked ~ .menu-item:nth-child(5) {
  -webkit-transition-duration: 330ms;
          transition-duration: 330ms;
  -webkit-transform: translate3d(240px, 0, 0);
          transform: translate3d(240px, 0, 0);
}

.menu-open:checked ~ .menu-item:nth-child(6) {
  -webkit-transition-duration: 410ms;
          transition-duration: 410ms;
  -webkit-transform: translate3d(320px, 0, 0);
          transform: translate3d(320px, 0, 0);
}

  /* ========================================================= */
  @-webkit-keyframes demonstration {
  0% {
    -webkit-filter: blur(0) contrast(1);
            filter: blur(0) contrast(1);
  }
  25% {
    -webkit-filter: blur(0) contrast(1);
            filter: blur(0) contrast(1);
  }
  30% {
    -webkit-filter: blur(20px) contrast(1);
            filter: blur(20px) contrast(1);
  }
  55% {
    -webkit-filter: blur(20px) contrast(1);
            filter: blur(20px) contrast(1);
    -webkit-animation-timing-function: ease-in;
            animation-timing-function: ease-in;
  }
  80% {
    -webkit-filter: blur(20px) contrast(30);
            filter: blur(20px) contrast(30);
  }
  100% {
    -webkit-filter: blur(20px) contrast(30);
            filter: blur(20px) contrast(30);
  }
}

@keyframes demonstration {
  0% {
    -webkit-filter: blur(0) contrast(1);
            filter: blur(0) contrast(1);
  }
  25% {
    -webkit-filter: blur(0) contrast(1);
            filter: blur(0) contrast(1);
  }
  30% {
    -webkit-filter: blur(20px) contrast(1);
            filter: blur(20px) contrast(1);
  }
  55% {
    -webkit-filter: blur(20px) contrast(1);
            filter: blur(20px) contrast(1);
    -webkit-animation-timing-function: ease-in;
            animation-timing-function: ease-in;
  }
  80% {
    -webkit-filter: blur(20px) contrast(30);
            filter: blur(20px) contrast(30);
  }
  100% {
    -webkit-filter: blur(20px) contrast(30);
            filter: blur(20px) contrast(30);
  }
}

.blobs {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: white;
  width: 400px;
  height: 200px;
  margin: auto;
  -webkit-filter: blur(20px) contrast(30);
          filter: blur(20px) contrast(30);
  -webkit-animation: demonstration 10s linear infinite;
          animation: demonstration 10s linear infinite;
}

.blob {
  background: black;
  width: 100px;
  height: 100px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -50px;
  margin-left: -50px;
  border-radius: 100%;
}

@-webkit-keyframes blob-anim-left {
  0% {
    -webkit-transform: translateX(-10px);
            transform: translateX(-10px);
  }
  100% {
    -webkit-transform: translateX(-55px);
            transform: translateX(-55px);
  }
}

@keyframes blob-anim-left {
  0% {
    -webkit-transform: translateX(-10px);
            transform: translateX(-10px);
  }
  100% {
    -webkit-transform: translateX(-55px);
            transform: translateX(-55px);
  }
}

.blob:first-child {
  -webkit-animation: blob-anim-left ease-in-out 0.8s infinite alternate;
          animation: blob-anim-left ease-in-out 0.8s infinite alternate;
}

@-webkit-keyframes blob-anim-right {
  0% {
    -webkit-transform: translateX(10px);
            transform: translateX(10px);
  }
  100% {
    -webkit-transform: translateX(55px);
            transform: translateX(55px);
  }
}

@keyframes blob-anim-right {
  0% {
    -webkit-transform: translateX(10px);
            transform: translateX(10px);
  }
  100% {
    -webkit-transform: translateX(55px);
            transform: translateX(55px);
  }
}

.blob:last-child {
  -webkit-animation: blob-anim-right ease-in-out 0.8s infinite alternate;
          animation: blob-anim-right ease-in-out 0.8s infinite alternate;
}
  
  
  .group {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  -webkit-filter: url("#old-goo");
          filter: url("#old-goo");
}

.group-new {
  left: 50%;
  -webkit-filter: url("#fancy-goo");
          filter: url("#fancy-goo");
}

.rect {
  width: 100px;
  height: 100px;
  background: black;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -50px;
  margin-left: -50px;
}

@-webkit-keyframes rect-anim-left {
  0% {
    -webkit-transform: translateX(-10px);
            transform: translateX(-10px);
  }
  100% {
    -webkit-transform: translateX(-60px);
            transform: translateX(-60px);
  }
}

@keyframes rect-anim-left {
  0% {
    -webkit-transform: translateX(-10px);
            transform: translateX(-10px);
  }
  100% {
    -webkit-transform: translateX(-60px);
            transform: translateX(-60px);
  }
}

.rect {
  -webkit-animation: rect-anim-left ease-in-out 2s infinite alternate;
          animation: rect-anim-left ease-in-out 2s infinite alternate;
}

@-webkit-keyframes rect-anim-right {
  0% {
    -webkit-transform: translateX(10px);
            transform: translateX(10px);
  }
  100% {
    -webkit-transform: translateX(60px);
            transform: translateX(60px);
  }
}

@keyframes rect-anim-right {
  0% {
    -webkit-transform: translateX(10px);
            transform: translateX(10px);
  }
  100% {
    -webkit-transform: translateX(60px);
            transform: translateX(60px);
  }
}

.rect + .rect {
  height: 150px;
  margin-top: -75px;
  -webkit-animation: rect-anim-right ease-in-out 2s infinite alternate;
          animation: rect-anim-right ease-in-out 2s infinite alternate;
}

.label {
  position: absolute;
  top: 30px;
  left: 0;
  width: 50%;
  text-align: center;
}

.label-new {
  left: 50%;
}
</style>
<h2>Gooey Menu Using CSS and SVG Filters</h2>

<nav class="menu">
  <input type="checkbox" href="#" class="menu-open" name="menu-open" id="menu-open"/>
  <label class="menu-open-button" for="menu-open">
    <span class="hamburger hamburger-1"></span>
    <span class="hamburger hamburger-2"></span>
    <span class="hamburger hamburger-3"></span>
  </label>
  
  <a href="#" class="menu-item"> <i class="fa fa-bar-chart"></i> </a>
  <a href="#" class="menu-item"> <i class="fa fa-plus"></i> </a>
  <a href="#" class="menu-item"> <i class="fa fa-heart"></i> </a>
  <a href="#" class="menu-item"> <i class="fa fa-envelope"></i> </a>
</nav>


<!-- filters -->
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
    <defs>
      <filter id="shadowed-goo">
          
          <feGaussianBlur in="SourceGraphic" result="blur" stdDeviation="10" />
          <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7" result="goo" />
          <feGaussianBlur in="goo" stdDeviation="3" result="shadow" />
          <feColorMatrix in="shadow" mode="matrix" values="0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 -0.2" result="shadow" />
          <feOffset in="shadow" dx="1" dy="1" result="shadow" />
          <feComposite in2="shadow" in="goo" result="goo" />
          <feComposite in2="goo" in="SourceGraphic" result="mix" />
      </filter>
      <filter id="goo">
          <feGaussianBlur in="SourceGraphic" result="blur" stdDeviation="10" />
          <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7" result="goo" />
          <feComposite in2="goo" in="SourceGraphic" result="mix" />
      </filter>
    </defs>
</svg>
  
    
  <h2>Basic Animation</h2>

  <div class="blobs">  <div class="blob"></div>  <div class="blob"></div></div>
  
  <h2>Rect Goo</h2>

  <div class="group group-old">
  <div class="rect"></div>
  <div class="rect"></div>
</div>
<div class="label label-old">Regular</div>
<div class="group group-new">
  <div class="rect"></div>
  <div class="rect"></div>
</div>
<div class="label label-new">Masked (with feComposite operator="atop")</div>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <defs>
    <filter id="old-goo">
      <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
      <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7" result="goo" />
      <feBlend in="SourceGraphic" in2="goo" />
    </filter>
    <filter id="fancy-goo">
      <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
      <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 19 -9" result="goo" />
      <feComposite in="SourceGraphic" in2="goo" operator="atop"/>
    </filter>
  </defs>
</svg>
</template>


