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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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 class="grid-container" >
    <div class="grid-item">
      <h3>Pancake Menu</h3>
      <div class="menuOne">
        <span></span>
        <span></span>
        <span></span>
      </div>
    </div>
    <div class="grid-item">
      <h3>Page Load Rotator</h3>
      <h5>Click the button</h5>
      <div id="loader" class="loader" style="display:none"></div>
      <div id="load_btn">
        <a href="#" class="btn btn-secondary" onclick="showLoader()">Reload</a>
      </div>
    </div>
    <div class="grid-item">
      <h3>Bouncing Ball</h3>
      <div class="ball"></div>
      <div class="ground"></div>
    </div>
<!--     <div class="grid-item">
      <div class="eye" id="eye"></div>
    </div> -->
  </div>
              
            
!

CSS

              
                body {
  text-align: center;
  height: 100%;
  background: rgba(9,117,200,.6);
}

.grid-container {
	display:grid;
	grid-template-columns: auto auto auto;
  grid-gap: 25px;
  margin:25px;
}
.grid-item {
  padding: 20px;
  font-size: 24px;
  text-align: center;
}

/* Menu One */
.menuOne {
  width:30px;
  height: 30px;
  margin: 10px;
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.menuOne span {
  background-color:white;
  position:absolute;
  border-radius: 2px;
  transition: .3s ease;
}
.menuOne:hover span {
  transform: scale(1.2);
  transition: .3s ease;
  box-shaddow: 0px 2px 3px rbga(0,0,0,0.4);
}
.menuOne span:nth-child(1){
  width: 100%;
  height:  4px;
  display: block;
  top: 0px;
  left: 0px;
}
.menuOne span:nth-child(2){
  width: 100%;
  height:  4px;
  display: block;
  top: 13px;
  left: 0px;
}
.menuOne span:nth-child(3){
  width: 100%;
  height:  4px;
  display: block;
  bottom: 0px;
  left: 0px;
}
.clickMenuOne span:nth-child(1) {
  transform: rotate(45deg);
  top: 13px;
}
.clickMenuOne span:nth-child(2) {
  transform: scale(.1);
}
.clickMenuOne span:nth-child(3) {
  transform: rotate(-45deg);
  top: 13px;
}
.clickMenuOne:hover span {
  transform: scale(1.2);
  transition: .3s ease;
  box-shaddow: 0px 2px 3px rbga(0,0,0,0.4);
}

/* Progress Loader */
.loader {
  margin: auto;
  border: 16px solid #f3f3f3;
  border-top: 16px solid #3498db;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
}
@keyframes spin {
  0% {transform: rotate(0deg);}
  100% {transform: rotate(360deg);}
}

/* Bouncing Ball */
.ball {
  margin: 0 auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: orange;
  animation: bounce 0.7s cubic-bezier(.5,0.05,1,.5);
  animation-direction: alternate;
  animation-iteration-count: infinite;
}
@keyframes bounce {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(0,200px,0); }
}
.ground {
  margin: 200px auto 0;
  width: 200px;
  height: 4px;
  background-color: black;
}

/* Rolling Eye */
.eye {
  margin: 0 auto;
  position: relative;
  display: inline-block;
  width: 120px;
  height: 120px;
  background-color: rgba(250,250,250,.8);
  border-radius: 100% 0px;
  transform: rotate(45deg);
}
.eye:after {
  /* pupil */
  position: absolute;
  bottom:36px;
  right:36px;
  width:45px;
  height:45px;
  background: black;
  border-radius: 50%;
  content: '';
  border:13px solid green;
}

              
            
!

JS

              
                // Menu One 
const menuOne = document.querySelector('.menuOne');

function addClickClass () {
  this.classList.toggle("clickMenuOne");
}

menuOne.addEventListener('click', addClickClass);

// Progress Loader
function showLoader() {
  event.preventDefault();
  document.getElementById("loader").style.display="block";
  document.getElementById("loader").style.transition="ease 300";
  document.getElementById("load_btn").style.display="none";
  document.getElementById("load_btn").style.transition="ease 300";
  setTimeout(resetLoader, 3000)
}
function resetLoader() {
  document.getElementById("loader").style.display="none";
  document.getElementById("loader").style.transition="ease 300";
  document.getElementById("load_btn").style.display="block";
  document.getElementById("load_btn").style.transition="ease 300";
}

// Rolling Eye
$('#mouseArea').mousemove(function(e) {
  const eye = $('.eye:after');
  const x = (eye.offset().left) + (eye.width() /2);
  const y = (eye.offset().top) + (eye.height() /2);
  const rad = Math.atan2(e.pageX - x, e.pageY - y);
  const rot = (rad * (180 / Math.PI) * -1) + 180; 
  eye.css({
    '-webkit-transform': 'rotate(' + rot + 'deg)',
    '-moz-transform': 'rotate(' + rot + 'deg)',
    '-ms-transform': 'rotate(' + rot + 'deg)',
    'transform': 'rotate(' + rot + 'deg)'
  });
});
              
            
!
999px

Console