7

Codepen Challenge: Huge Headers/Mega Menus

 3 years ago
source link: https://codepen.io/Sicontis/pen/OJzOWxq
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Pen Settings

HTML Preprocessor

Add Class(es) to <html>

Stuff for <head>

0 unsaved changes
xxxxxxxxxx
<div class="page-wrap">
  <header class="page-header">
    <nav>
      <h1>CPC | Travel</h1>
      <ul>
        <li>About Us</li>
        <li>Contact Us</li>
        <li id="burger">
          <span></span>
          <span></span>
          <span></span>
        </li>
      </ul>
    </nav>
    <main>
      <article id="hero-1" style="--i: 5">
        <div class="hero-info">
          <h2>Travel the</h2>
          <h1>World</h1>
          <h3>Pragser Wildsee, Italy</h3>
        </div>
        <div class="hero-image hi-1"></div>
xxxxxxxxxx
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;800&display=swap");
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
body {
  font-family: "Poppins", sans-serif;
  --black: #242424;
  --white: #f5f5f5;
  --pill: #e0d4be;
  --red: #cc033f;
}
ul {
  list-style: none;
xxxxxxxxxx
let burger = document.getElementById("burger");
let overlay = document.querySelector("section");
let heroImage = document.querySelector(".hero-image");
let showMenu = false;
let del = 3;
let i = 1;
let tl = gsap.timeline({
  repeat: -1,
  yoyo: true,
  ease: "expo.out"
});
overlay.style.display = "none";
burger.addEventListener("click", (e) => {
  showMenu = !showMenu;
  if (showMenu) {
    burger.classList.add("active");
    overlay.style.display = "block";
    gsap.to(overlay, 1, {

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK