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

              
                
<body>
	<header id="header">
		<nav>
			<div id="topicon">
				<div  title="scroll to top">
					<span class="icon-top">
						<span class="s-line"></span>
						<span class="l-line"></span>
						<span class="d-line top"></span>
						<span class="d-line bottom"></span>
						<span class="s-line"></span>
					</span>
				</div>
			</div>
			<div id="menu">
				<ul class="menu-links">
					<li class="item-spans item-first triggeroverflow">
						<a href="#section1" class="magnetic">
							<span><sup>01 </sup>Home</<span>
						</a>
					</li>
					<li class="item-spans triggeroverflow">
						<a href="#section2" class="magnetic">
							<span><sup>02 </sup>Work</<span>
						</a>
					</li>
					<li class="item-spans triggeroverflow">
						<a href="#section3" class="magnetic">
							<span><sup>03 </sup>About</<span>
						</a>
					</li>
					<li class="item-spans triggeroverflow">
						<a href="#section4" class="magnetic">
							<span><sup>―</sup> Let's Talk.</<span>
						</a>
					</li>
				</ul>
				<div id="logo">
          <h1>LOGO</h1>
				</div>
				<ul id="social">
					<li class="triggeroverflow"><a href="#" target="_blank" title="follow @Instagram"><span><i class="fab fa-instagram"></span></i></a></li>
					<li class="triggeroverflow"><a href="#" target="_blank" title="follow @Dribbble"><span><i class="fab fa-dribbble"></span></i></a></li>
					<li class="triggeroverflow"><a href="#" target="_blank" title="follow @Behance"><span><i class="fab fa-behance"></span></i></a></li>
					<li class="triggeroverflow"><a href="#" target="_blank" title="follow @Codepen"><span><i class="fab fa-codepen"></span></i></a></li>
					<li class="triggeroverflow"><a href="#" target="_blank" title="send me an e-mail"><span><i class="far fa-envelope"></span></i></a></li>
				</ul>
			</div> 
		</nav>
	</header>
	
	<main>
    
		<div id="section1" class="snap">
      <div id="left-panel">
        <div id="left-vertical-slice"></div>
      </div>
      <div id="right-panel">
        <div id="right-vertical-slice"></div>
      </div>
		</div>
		<div id="section2" class="snap">
			<h1>section two</h1>
		</div>
		<div id="section3" class="snap">
			<h1>section three</h1>
		</div>
		<div id="section4" class="snap">
			<h1>section four</h1>
		</div>

	</main>

	<footer>Footer Content — Header.com 2020</footer> 

</body>


              
            
!

CSS

              
                
:root {
	--main-blue-color: blue;
	--main-bluealpha-color: #0000ffb5;
	--secondary-blue-color: darkblue;
	--accent-yellow-color: #34eba4;
	--opaque-dim-grey: dimgrey;
	--light-main-color: white;
	--dark-main-color: black;
	--bg-main-color: #020202;
	scrollbar-width: none;	
	scroll-behavior: smooth; /* no safari and IE support */
	--baseSize: 2rem;
}	

body {
  font-family: system-ui, sans-serif;
  display: grid;
  height: auto;
  grid-template-rows: auto 1fr auto;
}

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

h1 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  margin: 0;
}

h4 {
  font-size: calc(0.39em + 1vmin);
  margin: 0;
}


.add-primary-color {color: var(--main-blue-color);}
.add-secondary-color {color: var(--secondary-blue-color);}
.add-accent-color {color: var(--accent-yellow-color);}
.add-opaque-color {color: var(--opaque-dim-grey);}
.add-light-color {color: var(--light-main-color);}
.add-dark-color {color: var(--dark-main-color);}

.fa, .fab, .fal, .far, .fas {font-size: 1.500em;}


.changeoverflow {
  overflow: visible !important;
  pointer-events: all;
}
 
/*----------------------------------------------------*/
/*	M E N U  -- ICON TOP
/*----------------------------------------------------*/
 
.icon-top {
	position: absolute;
	top: 18px;
	left: 5px;
	width: 55px;
	height: 18px;
	transform: rotate(-180deg);
	z-index: 4;
	cursor: pointer;
}

.icon-top span {
	position: absolute;
	height: 2px;
	border-radius: 100px;
	background: var(--light-main-color);
	transition: all 0.5s ease;
}

.s-line {right: 9px; width: 30px;}
.s-line:first-child {top: 0px}
.s-line:last-child {bottom: 0px;}
.l-line {top: 0; right: 9px; bottom: 0; width: 45px; margin: auto;}
.d-line {left: -2px; width: 12px; margin: auto;}
.d-line.top {top: 4px; height: 2px; -webkit-transform: rotate(-45deg);	transform: rotate(-45deg);}
.d-line.bottom {bottom: 4px; height: 2px; -webkit-transform: rotate(45deg);	transform: rotate(45deg);}	

.morpharrow span:not(.d-line) {width: 0;}
.morpharrow .d-line {width: 15px;}

.morpharrow .d-line.top {
  -webkit-transform: translate(25px, 4px) rotate(-45deg);
          transform: translate(25px, 4px) rotate(-45deg);
}
.morpharrow .d-line.bottom {
  -webkit-transform: translate(15px, -3px) rotate(45deg);
          transform: translate(15px, -3px) rotate(45deg);
}


header {
  background: transparent;
  border-bottom: 1px solid white;
  width: 100%;
  position: fixed;
  z-index: 5;
}

header div h1 {
  font-size: 12pt;
}

.item-spans {
	padding-inline-start: 20px;
	padding-inline-end: 20px;
}

.menu-links li:first-child {
  padding-block-start: clamp(5em, 1vh, 5em);
}	 

.menu-links li:last-child {
  padding-block-end: 5vw;
}
	 
#menu .menu-links li a {color: var(--light-main-color); text-decoration: none; text-transform: uppercase; cursor: pointer; overflow: hidden; white-space: nowrap;} 
 
#menu { 
  display: grid;
  grid: auto-flow / auto;
  height: auto;
}
.magnetic span {
  display: inline-block;
  pointer-events: none;
}
#menu .menu-links {
  display: flex;
  justify-content: space-evenly;
  align-items: start;
  flex-direction: column;
  margin: 0;
  padding: 0;
  width: 60vw;
  height: auto;
  background: var(--main-bluealpha-color);
  list-style: none;
  z-index: 0;
  gap: 1.8em;
  order: 2;
  grid-row: 1 / -2;
  grid-column: 1 / 2;
}

#menu .menu-links li a span  {
  font-size: clamp(1.45em, 5vw, 5em);   
} 

#logo {
  order:1;
  grid-column-start: 2;
  grid-column-end: 3;
  display: flex;
  justify-content: center;
  padding-inline-end: 0px;
}

.logo { width: 100px; height: 54px; }
header div h1 { place-self: center;}


#social {
  display: flex;
  justify-content: space-evenly;
  list-style: none;
  width: 60vw;
  align-items: center;
  margin: 0;
  height: 54px;
  padding: 0;
  z-index: 5;
  background: var(--main-bluealpha-color);
  order: 3;
  grid-column-start: 1;
  grid-column-end: 2;
  /* transform: translateX(-100%); */
  /* display:none; */
}

#social li a span { 
  color: #fff;
}

#social li {
  font-size: clamp(0.85rem, 4vw, 1rem);
  padding-right: clamp(10px, 2vw, 20px);
}

#social li:first-child {
  padding-left: clamp(10px, 2vw, 20px);
}


main {
  display: grid;
  background: coral;
  grit-template-rows: repeat(4, 1fr);
}

footer {
  background: wheat;
  padding: 2rem;
  text-align: center;
}

#section1 {
  height: 100vh;
  background: black;
  display: flex;
  flex-flow: row;
  overflow: clip;
}

#left-panel {
  background: grey;
  flex: 1 1 22.9375em;
  width: 50vw;
}

#left-vertical-slice {
  display: grid;
  grid-template-columns: repeat(1, auto);
  grid-template-rows: repeat(2, auto);
  height: 100%;
}

#right-panel {
  background: #ccc;
  flex: 1 1 22.9375em;
  width: 50vw;
}

#right-vertical-slice {
  display: grid;
  grid-template-columns: repeat(1, auto);
  grid-template-rows: repeat(2, auto);
  height: 100%;
}

#section2 {
  height: 100vh;
  background: blue;
}

 
#section3 {
  height: 100vh;
  background: green;
}

#section4 {
  height: 100vh;
  background: aqua;
}

@media screen and (min-width: 23.438em) and (orientation : landscape) {
	#menu .menu-links li a span {
		font-size: clamp(1em, 3vw, 3em);
	}
	.menu-links li:first-child {
	  padding-block-start: 20vh;
	}	 
	.menu-links li:last-child {
	  padding-block-end: 10vh;
	}
} 

@media only screen and (min-width: 45.8125em) {
	#logo {
	  grid-column: 1 / 2;
	  grid-row: 1 / -2;
	}
}
 
@media only screen and (max-width: 45.8125em) {
	#section1 {
      height: 100vh;
      background: red;
      display: flex;
      flex-flow: column;
	}
	#logo {
	  order:1;
      grid-column-end: 2;
	  display: flex;
	  justify-content: flex-end;
	  padding-inline-end: 5px;
	}
	#left-panel, #right-panel {width: 100vw; height: 50vh;}
}

@media screen and (max-width: 52.875em) and (max-height: 25.875em) and (orientation : landscape) {
	#menu .menu-links { gap: 0.75em; width: 40vw; }
	#social { width: 40vw; }
}

@media screen and (min-width: 75em){
	html, body { scroll-snap-type: y mandatory; }
	.snap { scroll-snap-align: start; }
	header { width: 100%;	}	 
	
	#logo {
	  grid-column-start: 2;
	  grid-column-end: 3;
	  display: flex;
	  justify-content: center;
	  padding-inline-end: 5px;
	}
	#menu { 
	  display: grid;
	  grid-auto-flow: column;
	  height: auto;
	  grid-template-columns: 35% auto 35%;
	}
	.menu-links li:first-child {
	  padding-block-start: 0%;
	  padding-inline-start: 80px;
	  padding-inline-end: 20px;
	} 
	.menu-links li:last-child {
	  padding-block-end: 0;
	}
	.item-spans {
	  padding-inline-start: 0;
	  padding-inline-end: 20px;
	}
	
	#menu .menu-links li a span { font-size: calc(0.39em + 1vmin); } 

	#menu .menu-links {
	  display: flex !important;
	  justify-content: start;
	  align-items: center;
	  background: none;
	  flex-direction: row;
	  grid-column-start: 1;
	  grid-column-end: 2;
	  gap: 30px;
	} 
	
	#social {
      grid-column-start: 3;
      grid-column-end: 4;
      width: 100%;
	    background: none;
      justify-content: flex-end;
	}
} 

              
            
!

JS

              
                
$(function () {
  $('.triggeroverflow').hover(function () {
    $('#menu ul li a').toggleClass('changeoverflow')
  })
})

$(function () {
  var icon = document.querySelector('.icon-top')

  icon.onmouseenter = function () {
    this.classList.toggle('morpharrow')
  }

  icon.onmouseleave = function () {
    this.classList.toggle('morpharrow')
  }
})

//////////// GSAP ///////////////////
/////////////////////////////////////

$(window).ready(function () {
  var tl = new gsap.timeline({
    paused: true,
  })

  $('nav #menu').each(function (i, el) {
    // media query event handler
    if (matchMedia) {
      var mq = window.matchMedia('(min-width: 733px)')
      WidthChange(mq)
    }
    // media query change
    function WidthChange(mq) {
      if (mq.matches) {
        $('.icon-top').on('mouseenter', function () {
          tl.play()
        })

        $(el).on('mouseleave', function () {
          tl.reverse()
        })
      } else {
        $('.icon-top').off('mouseenter', function () {
          tl.kill()
        })

        $(el).off('mouseleave', function () {
          tl.kill()
        })

        $('.icon-top').click(function () {
          tl.restart()
        })

        $(document).on('click', function (event) {
          if (!$(event.target).closest('.icon-top').length) {
            tl.reverse()
          }
        })

        tl.from(
          $(el).find('#social'),
          { duration: 0.4, autoAlpha: 0 },
          'Sametime'
        )
      }

      tl.from(
        $(el).find('.menu-links'),
        { duration: 0.4, autoAlpha: 0 },
        'Sametime'
      ).from(
        $(el).find('.menu-links > li > a > span'),
        { duration: 0.4, x: '-100%', opacity: 0, ease: 'sine.inOut' },
        0.05,
        'Sametime'
      )
    }
  })
})

              
            
!
999px

Console