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

              
                <nav>
  <div class="container">
    <div class="logo">      
      <span>SNAFU</span>
    </div>
    <div class="list">
      <div class="item">
        <span class="title-item">   
          Home
        </span>
      </div>
      <div class="item hoverable">
        <span class="title-item">        
          Features <span class="arrow">▼</span>  
        </span>
      </div>
      <div class="item hoverable">
        <span class="title-item">
          Use cases <span class="arrow">▼</span>
        </span>
      </div>
      <div class="item hoverable">
        <span class="title-item">          
          Docs & ressources <span class="arrow">▼</span>
        </span>
      </div>
      <div class="item">
        <span class="title-item">        
          Pricing
        </span>
      </div>
    </div>
  </div>
</nav>
<div id="menu" class="menu">
  <div class="content" id="content">
    <div class="left-part">
      <div class="list-submenu">
        <div class="item title">
          Blog
        </div>
      </div>
      <div class="list-submenu">
        <div class="item title">
          Community
        </div>
        <div class="item">
          Discord
        </div>
        <div class="item">
          Stackoverflow
        </div>
        <div class="item">
          Slack
        </div>
      </div>
      <div class="list-submenu">
        <div class="item title">
          Solution
        </div>
        <div class="item">
          API
        </div>
      </div>
      <div class="list-submenu">
        <div class="item title">
          Application
        </div>
        <div class="item">
          Mobile app
        </div>
        <div class="item">
          Web app
        </div>
      </div>
    </div>
    <div class="right-part">
      <div class="card">
        <img src="https://static.wixstatic.com/media/fc5f6e_17f2e6c95e4643fd909e5f3e46548420~mv2.png" alt="">
        <p>Look at my fancy use case</p>
        <button>Click to see more ></button>
      </div>
    </div>
  </div>
</div>
<div class="body">
  <div class="noise"></div>
<h1>Great mega menu</h1>
  <div class="moon-container">
      <div class="moon">
          <div class="circle"></div>
          <img class="img-moon" src="https://pngimg.com/uploads/moon/moon_PNG19.png" alt="">
      </div>
      <p class="titre">
          Hover <br>
          Menu items <br>
          Too see magic
      </p>
  </div>
</div>
              
            
!

CSS

              
                nav {
  display: flex;
  border-bottom: 1px solid #F2F4F6;
  position: relative;
  z-index: 99;
  .container {
    max-width: 1160px;
    width: 1160px;
    margin: auto;
    display: flex;
  }
}
.logo {
  font-size: 22px;
  font-family: monospace;
  color: #454545;
  margin: auto 50px auto 0;
  font-weight: bolder
}
.list {
    display: flex;
    flex-direction: row;
  .item {
    color: #454545;
    display: flex;
    padding: 24px;
    cursor: pointer;
    font-size: 16px;
    font-family: arial;
    position: relative; 
    .title-item {
      display: flex; 
      position:relative;
      user-select: none;
      &:before,
      &:after {
          content: "";
          position: absolute;
          width: 0px;
          height: 3px;
          margin: 5px 0 0;
          transition: all .25s cubic-bezier(0.340, 0.370, 0.055, 1.560);
          opacity: 1;
          background-color: #454545;
          left: 0;
          bottom: -8px;
      }
      
    }
    .arrow {
      font-size: 11px;
      margin-left: 8px;
      margin-top: 3px;
    }
    &:hover {
      .title-item {
        &:before,
          &:after {
            width: 100%;
            opacity: 1;
        }
      }
    }
  }
}
.menu {
  position: absolute;
  left: 50%;
  opacity: 0;
  height: 200px;  
  width: 1060px;
  position: absolute;
  top: 74px;
  padding: 0;
//  background-color: red;
  transform: perspective(1000px) translate3d(-50%, 0, 0);
  box-shadow: 0px 0px 15px rgba(0,0,0,0.08);
  transition: all .3s cubic-bezier(0.340, 0.370, 0.055, 1.560);
  overflow: hidden;
  visibility: hidden;
  &.open {
    opacity: 1;
    transform: perspective(1000px) translate3d(-50%, 0, 0);
    height: 275px;
    max-width: 1160px;
    width: 1160px;
    visibility: visible;
    z-index: 98;
  }
}

.content {
  transition:.10s;
  opacity: 1;
  position: relative;
  display: flex;
  height: 100%;
  font-family: arial;
  .left-part, .right-part {
    padding: 16px;
    height: 100%;
  }
  .left-part {
    background-color: #F2F4F6;
    flex: 3;
    display: flex;
    flex-direction: row;
    .list-submenu {
      margin: 8px 32px;
      .item {
        color: #454545;
        font-size: 16px;
        margin: 8px auto;
        cursor: pointer;
        &:hover {
          text-decoration: underline;
        }
        &.title {        
          font-weight: bolder;
          color: #0b7756;
          font-size: 20px;
        }
      }
    }
  }
  .right-part {
    background-color: #FFF;
    flex: 2
  }
}
.card {
  display: flex;
  flex-direction: column;
  img {
    width: 300px;
    margin: 16px auto
  }
  p {
    margin: auto auto 16px auto;
    text-align: center;
    color: #454545;
    font-family: arial; 
    font-size: 22px
  }
  button {
    background-color: white;
    border: none;
    color: #0b7756;
    font-size: 18px;
    font-weight: bolder;
    margin: auto auto 16px auto
  }
}

.body { 
  height: 100vh;
  position: relative;
  z-index:1;
  padding:0; 
  margin:0; 
  background-color:#1D1D2F;
  overflow: hidden;
}
.noise {
  height: 100vh;
  width: 100vw;
  position: fixed;
  background-image: url('https://andreivictor.ro/codepen/background-grain-effect/noise.gif');
  background-repeat: repeat;
  opacity: 0.03;
  z-index: -1;
}

h1 {
  font-family: 'Arial black', sans-serif;
  font-size: 100px;
  position: absolute;
  margin: auto 0;
  color: white;
  line-height: 90%;
  text-transform: uppercase;
  z-index: 1;
  position: absolute;
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  text-align: center;
  font-weight: bolder;
}
.titre {
  font-family: 'Arial black', sans-serif;
  font-size: 14px;
  color: #FFF;
  z-index: 9;
  position: absolute;
  right: -30px;
  bottom: 0;
}
.moon-container {
  position: absolute;
  height: 250px;
  width: 250px;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) scale(1.6);
}
.moon {
  animation: fly 5s linear infinite;
}
@keyframes fly {
  0% {transform: translate(0,0)}
  33% {transform: translate(0px,-2px)}
  66% {transform: translate(0px,2px)}
  100% {transform: translate(0,0)}
}
.circle {
  height: 250px;
  width: 250px;
  background-color: #FF6E61;
  border-radius: 50%;
  position: absolute;
}
.img-moon {
  width: 250px;
  position: absolute;
  opacity: 0.2;
}


.titre {
	animation: glitch-anim-text 0.5s 2s linear;
  animation-iteration-count: 2;
}


@keyframes glitch-anim-text {
	0% { 
		opacity: 1;
		transform: translate3d(-10px,0,0) scale3d(-1,-1,1);
		-webkit-clip-path: polygon(0 20%, 100% 20%, 100% 21%, 0 21%);
		clip-path: polygon(0 20%, 100% 20%, 100% 21%, 0 21%);
	}
	10% {
		-webkit-clip-path: polygon(0 33%, 100% 33%, 100% 33%, 0 33%);
		clip-path: polygon(0 33%, 100% 33%, 100% 33%, 0 33%);
	}
	20% {
		-webkit-clip-path: polygon(0 44%, 100% 44%, 100% 44%, 0 44%);
		clip-path: polygon(0 44%, 100% 44%, 100% 44%, 0 44%);
	}
	35% {
		-webkit-clip-path: polygon(0 50%, 100% 50%, 100% 20%, 0 20%);
		clip-path: polygon(0 50%, 100% 50%, 100% 20%, 0 20%);
	}
	50% {
		-webkit-clip-path: polygon(0 70%, 100% 70%, 100% 70%, 0 70%);
		clip-path: polygon(0 70%, 100% 70%, 100% 70%, 0 70%);
	}
	60% {
		-webkit-clip-path: polygon(0 80%, 100% 80%, 100% 80%, 0 80%);
		clip-path: polygon(0 80%, 100% 80%, 100% 80%, 0 80%);
	}
	70% {
		-webkit-clip-path: polygon(0 50%, 100% 50%, 100% 55%, 0 55%);
		clip-path: polygon(0 50%, 100% 50%, 100% 55%, 0 55%);
	}
	80% {
		-webkit-clip-path: polygon(0 70%, 100% 70%, 100% 80%, 0 80%);
		clip-path: polygon(0 70%, 100% 70%, 100% 80%, 0 80%);
	}
	90% {
		transform: translate3d(-10px,0,0) scale3d(-1,-1,1);
	}
	100% {
		opacity: 1;
		transform: translate3d(0,0,0) scale3d(1,1,1);
		-webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
		clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
	}
}

              
            
!

JS

              
                document.querySelectorAll(".hoverable").forEach(
  box =>  eventListener(box))

function reveal(e, isEnter) {
  var element = document.getElementById("menu");
  if(isEnter) element.classList.add("open");
  else element.classList.remove("open");
  console.log('event', e.getBoundingClientRect())
}

function eventListener(box) {
  box.addEventListener("mouseenter", () => reveal(box, true))
  box.addEventListener("mouseleave", () => reveal(box, false))
  
  document.getElementById("menu").addEventListener("mouseenter", () => reveal(box, true));
  document.getElementById("menu").addEventListener("mouseleave", () => reveal(box, false));
}
              
            
!
999px

Console