LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

Pure CSS panels

by Mattia Astorino

CSS
/* basic style definition */
/* •••••••••••••••••••••••••••••••• */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Roboto Slab', serif;
}
h1 {
  margin: 0;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  text-align: center;
  font-weight: 300;
}
p {
  font-weight: 300;
  color: #546E7A;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  text-align: center;
  margin: 0;
}
a {
  text-align: center;
  text-decoration: none;
  color: #FFF;
}
/* Navigation menu */
/* •••••••••••••••••••••••••••••••• */
.menu {
  position: fixed;
  width: 100vw;
  pointer-events: none;
  margin-top: 10vh;
  text-align: center;
  z-index: 2;
}
/* Menu link item */
.menu__link {
  display: inline-block;
  text-decoration: none;
  border: 2px solid #263238;
  color: #263238;
  pointer-events: auto;
  line-height: 40px;
  position: relative;
  padding: 0 50px;
  box-sizing: border-box;
  margin: 0;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  overflow: hidden;
  border-radius: 50px;
}
.menu__link::before {
  content: attr(data-hover);
  background-color: #263238;
  color: #FFF;
  position: absolute;
  top: 100%;
  bottom: 0;
  left: 0;
  -webkit-transition: all 300ms cubic-bezier(0.19, 1, 0.56, 1);
  transition: all 300ms cubic-bezier(0.19, 1, 0.56, 1);
  right: 0;
}
.menu__link:hover::before {
  top: 0;
}
/* Panels Style*/
/* •••••••••••••••••••••••••••••••• */
/* Common panel style */
.panel {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: auto;
  z-index: 999;
  color: #000;
  box-sizing: border-box;
  background-color: #ECEFF1;
}
/* panel content (only for animation delay after open) */
.panel-content {
  opacity: 0;
  will-change: margin-top;
  -webkit-transition: all 700ms;
  transition: all 700ms;
  -webkit-transition-delay: 600ms;
          transition-delay: 600ms;
  padding: 100px 200px;
  margin-top: -5%;
}
/* Panel content animation after open */
.panel:target .panel-content {
  opacity: 1;
  margin-top: 0;
}
/*  Specific "Home "panel */
/* •••••••••••••••••••••••••••••••• */
.panel#home {
  z-index: 1;
  background: -webkit-radial-gradient(center ellipse, #ffffff 0%, #CFD8DC 100%);
  background: radial-gradient(ellipse at center, #ffffff 0%, #CFD8DC 100%);
  /* Particle.js demo */
}
.panel#home canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
}
/*  Specific panel "Slice" */
/* •••••••••••••••••••••••••••••••• */
.panel#slice {
  background-color: #E53935;
  -webkit-transition: all 800ms cubic-bezier(0.19, 1, 0.56, 1);
  transition: all 800ms cubic-bezier(0.19, 1, 0.56, 1);
  -webkit-transform: translate3d(0, -100%, 0);
          transform: translate3d(0, -100%, 0);
}
.panel#slice:target {
  -webkit-transform: translate3d(0, 0, 0);
          transform: translate3d(0, 0, 0);
}
/*  Specific panel "Fade" effect */
/* •••••••••••••••••••••••••••••••• */
.panel#fade {
  background-color: #00C853;
  opacity: 0;
  -webkit-transition: all 800ms;
  transition: all 800ms;
  pointer-events: none;
}
.panel#fade:target {
  opacity: 1;
  pointer-events: auto;
}
/* Sample Particle background */
/* •••••••••••••••••••••••••••••••• */
#particles {
  opacity: 0.6;
}
Host Instantly Drag and Drop Website Builder

 

Description

This is an example of onepage panels navigation made with only CSS.
Term
Mon, 11/27/2017 - 21:52

Related Codes

Pen ID
Pen ID
Pen ID