Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="content">
  <div class="bg-circle"></div>
  <svg id="main-icon" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
    <foreignObject class="bg-circle"></foreignObject>
    <circle cx="40" cy="40" r="39.5" stroke="white" />
    <circle cx="40" cy="40" r="32.5" stroke="white" />
    <path d="M34.5142 25.6008L49.5999 28.3374V52.4628L34.5142 55.2008V25.6008ZM30.3999 53.4221H33.1428V28.6294H30.3999V53.4221ZM38.8452 42.4149C39.7242 42.4149 40.4333 41.5121 40.4333 40.3994C40.4333 39.2881 39.7242 38.3853 38.8452 38.3853C37.9674 38.3853 37.257 39.2881 37.257 40.3994C37.257 41.5121 37.9674 42.4149 38.8452 42.4149Z" fill="white" />
  </svg>
  <p id="title">Guest Pass</p>
  <p id="subtitle">Select a reader to Unlock</p>
  <div id="buttons">
    <button>
      <svg class="icon" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path fill-rule="evenodd" clip-rule="evenodd" d="M24 1.50073V28.5007H6V1.50073H24ZM9.68182 14.5674C9.00401 14.5674 8.45455 15.1494 8.45455 15.8674C8.45455 16.5854 9.00401 17.1674 9.68182 17.1674C10.3596 17.1674 10.9091 16.5854 10.9091 15.8674C10.9091 15.1494 10.3596 14.5674 9.68182 14.5674Z" fill="#4377BB" />
      </svg>
      <svg class="openIcon" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.85714 1.50073L24 4.06635V26.6839L9.85714 29.2507V1.50073ZM6 27.5832H8.57143V4.34006H6V27.5832ZM13.9174 17.264C14.7416 17.264 15.4063 16.4176 15.4063 15.3745C15.4063 14.3326 14.7416 13.4862 13.9174 13.4862C13.0946 13.4862 12.4286 14.3326 12.4286 15.3745C12.4286 16.4176 13.0946 17.264 13.9174 17.264Z" fill="#4377BB"/>
</svg>
      <span class="button-label">Front Door</span>
      <div class="bar"></div>
  </div>
  </button>
  <button>
    <svg class="icon" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path fill-rule="evenodd" clip-rule="evenodd" d="M24 1.50073V28.5007H6V1.50073H24ZM9.68182 14.5674C9.00401 14.5674 8.45455 15.1494 8.45455 15.8674C8.45455 16.5854 9.00401 17.1674 9.68182 17.1674C10.3596 17.1674 10.9091 16.5854 10.9091 15.8674C10.9091 15.1494 10.3596 14.5674 9.68182 14.5674Z" fill="#4377BB" />
    </svg>
    <svg class="openIcon" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.85714 1.50073L24 4.06635V26.6839L9.85714 29.2507V1.50073ZM6 27.5832H8.57143V4.34006H6V27.5832ZM13.9174 17.264C14.7416 17.264 15.4063 16.4176 15.4063 15.3745C15.4063 14.3326 14.7416 13.4862 13.9174 13.4862C13.0946 13.4862 12.4286 14.3326 12.4286 15.3745C12.4286 16.4176 13.0946 17.264 13.9174 17.264Z" fill="#4377BB"/>
</svg>
    <span class="button-label">Side Door</span>
    <div class="bar"></div>
  </button>
  <button>
    <svg class="icon" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
      <path fill-rule="evenodd" clip-rule="evenodd" d="M24 1.50073V28.5007H6V1.50073H24ZM9.68182 14.5674C9.00401 14.5674 8.45455 15.1494 8.45455 15.8674C8.45455 16.5854 9.00401 17.1674 9.68182 17.1674C10.3596 17.1674 10.9091 16.5854 10.9091 15.8674C10.9091 15.1494 10.3596 14.5674 9.68182 14.5674Z" fill="#4377BB" />
    </svg>
    <svg class="openIcon" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.85714 1.50073L24 4.06635V26.6839L9.85714 29.2507V1.50073ZM6 27.5832H8.57143V4.34006H6V27.5832ZM13.9174 17.264C14.7416 17.264 15.4063 16.4176 15.4063 15.3745C15.4063 14.3326 14.7416 13.4862 13.9174 13.4862C13.0946 13.4862 12.4286 14.3326 12.4286 15.3745C12.4286 16.4176 13.0946 17.264 13.9174 17.264Z" fill="#4377BB"/>
</svg>
    <span class="button-label">Back Door</span>
    <div class="bar"></div>
  </button>
</div>
</div>
              
            
!

CSS

              
                body {
  background: #2A548C;
  margin: auto;
  padding: 0;
  overflow: hidden;
}

#content {
  z-index: 1;
  display: block;
  width: 375px;
  margin-top: 100px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-family: "roboto", sans-serif;
}

#main-icon {
  display: block;
  width: 80px;
  height: 80px;
  margin-left: auto;
  margin-right: auto;
}

.bg-circle{
  position: absolute;
  z-index: -1; 
  width: 0;
  height: 0;
  background: #314259;
  display: block;
  border-radius: 50%;
  left: 50%;
  top: 140px;
  margin: 0;
}

.growCircle{
  transform-origin: center center;
  animation: grow-circle 4s ease-in-out;
}

@keyframes grow-circle {
  0% {margin:0; width: 0; height: 0; opacity: 1;}
  35% {margin:-1500px 0 0 -1500px; width: 3000px; height: 3000px; opacity: 1;}
  50% {margin:-1500px 0 0 -1500px; width: 3000px; height: 3000px; opacity: 1;}
  100% {margin:-1500px 0 0 -1500px; width: 3000px; height: 3000px; opacity: 0;}
}

#title {
  font-size: 24px;
  color: white;
  font-weight: semi-bold;
  margin: 20px;
}

#subtitle {
  font-size: 21px;
  color: white;
  font-weight: normal;
}

h1, h2, h3 {
  color: white;
}

button {
  position: relative;
  display: block;
  width: 375px;
  margin-top: 10px;
  margin-bottom: 10px;
  padding-top: 18px;
  padding-bottom: 5px;
  padding-left: 0px;
  padding-right: 0px;
  border 0px;
  border-radius: 6px;
  background-color: white;
  color: #2A548C;
  font-size: 24px;
  overflow: hidden;
  white-space: nowrap;
  border-width: 0px;
}

button:hover {
  cursor: pointer;
/*   background-color: #E6E6E6; */
}

button:active {
  background-color: #E6E6E6;
}

.button-label {
  position: relative;
  display: block;
  z-index: 2;
}

.icon {
/*   background-color: #2A548C; */
  position: absolute;
  display: block;
  width: 30px;
  height: 30px;
  float: left;
  margin-left: 18px;
  z-index: 1;
}

.moveIcon {
  animation: move-icon 4.4s;
}

@keyframes move-icon {
  0% {margin-left: 18px; opacity: 100}
  17% {margin-left: 172.5px; opacity: 100}
  28% {margin-left: 172.5px; opacity: 0}
  29% {margin-left: -48px; opacity: 0}
  30% {margin-left: -48px; opacity: 100}
  86% {margin-left: -48px; opacity: 100}
  100% {margin-left: 18px; opacity: 100}
}

.openIcon {
  position: absolute;
  display: block;
  width: 30px;
  height: 30px;
  float: left;
  margin-left: 18px;
  opacity: 0;
  z-index: 1;
}

.moveOpenIcon {
  animation: moveOpenIcon 4.4s;
}

@keyframes moveOpenIcon {
  0% {margin-left: 172.5px; opacity: 0}
  17% {margin-left: 172.5px; opacity: 0}
  28% {margin-left: 172.5px; opacity: 0}
  29% {margin-left: 172.5px; opacity: 100}
  45% {margin-left: 172.5px; opacity: 100}
  59% {margin-left: 375px; opacity: 100}
  60% {margin-left: 375px; opacity: 0}
  100% {margin-left: 172.5px; opacity: 0}
}

.moveLabel {
  animation: move-label 3.6s;
}

@keyframes move-label {
  0% {left: 0; opacity: 100}
  17% {left: 300px; opacity: 100}
  18% {left: 300px; opacity: 0}
  19% {left: -300px; opacity: 0}
  20% {left: -300px; opacity: 100}
  83% {left: -300px; opacity: 100}
  100% {left: 0; opacity: 100}
}

.bar {
  display: block;
  opacity: 0;
  margin-top: 10px;
  margin-left: auto;
  margin-right: auto;
  height: 3px;
  width 0px;
  background-color: #4377BB;
}

.growBar {
  transform-origin: center center;
  animation: grow-bar 4.4s;
}

@keyframes grow-bar {
  0% {width: 0; opacity: 100}
  20% {background-color: #2A548C}
  30% {width: 375px; backgrounf-color: #008A00}
  45% {width: 375px; background-color: #008A00}
  100% {width: 0; background-color: #2A548C}
}
              
            
!

JS

              
                $("button").click(function () {
  
  $(this).find(".bar").addClass("growBar");
  $(this).find(".button-label").addClass("moveLabel");
  $(this).find(".openIcon").addClass("moveOpenIcon");
  $(this).find(".icon").addClass("moveIcon");
  $(".bg-circle").addClass("growCircle");
  console.log("test!");
  removeIt($("body"), $(".bg-circle"), "growCircle", 4000);
  removeIt($(this), ".bar", "growBar", 4400);
  removeIt($(this), ".button-label", "moveLabel", 3600);
  removeIt($(this), ".icon", "moveIcon", 4400);
  removeIt($(this), ".openIcon", "moveOpenIcon", 4400);
});

function removeIt(element, indiOne, indiTwo, timeout) {
  function remove() {
    element.find(indiOne).removeClass(indiTwo);
  }

  console.log("entering timeout");

  setTimeout(remove, timeout);
  console.log("removing..");
}

// function disableButtons()
              
            
!
999px

Console