Day 333

My third and last entry into the responsive CSS Grid realm...
#CodingPhase #TheCodingWay #365CodingPhaseChallenge

**********

/* Features! */
.features {
  display: grid;
  grid-gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.feature {
  background: white;
  padding: 10px;
  border: 1px solid white;
  text-align: center;
  box-shadow: 0 0 4px  rgba(0,0,0,0.1);
}
.feature .icon {
  font-size: 50px;
}
.feature p {
  color: rgba(0,0,0,0.5);
}

/* About Section */
.about {
  background: white;
  padding:50px;
  display: grid;
  grid-template-columns: 400px 1fr;
  align-items: center;
}

/* Gallery! */
.gallery {
  display: grid;
  grid-gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.gallery img {
  width: 100%;
}
.gallery h2 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-gap: 20px;
  align-items: center;
}
.gallery h2:before, .gallery h2:after {
  display: block;
  content: '';
  height: 10px;
  background: linear-gradient(to var(--direction, left), var(--yellow), transparent);
}
.gallery h2:after {
  --direction: right;
}

@media (max-width: 1000px) {
  .menu {
    order: -1;
    perspective: 800px;
  }
  [aria-controls="menu-list"] {
    display: block;
    margin-bottom: 10px;
  }
  .menu ul {
    max-height: 0;
    overflow: hidden;
    transform: rotateX(90deg);
    transition: all 0.5s;
  }
  [aria-expanded="true"] ~ ul {
    display: grid;
    max-height: 500px;
    transform: rotateX(0);
  }
  [aria-expanded="false"] .close {
    display: none;
  }
  [aria-expanded="true"] .close {
    display: inline-block;
  }
  [aria-expanded="true"] .open {
    display: none;
  }
}

@media (max-width: 700px) {
  .top {
    grid-template-areas:
      "hero hero"
      "cta1 cta2"
  }
  /* About */
  .about {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .top {
    grid-template-areas:
      "hero"
      "cta1"
      "cta2"
  }
}

Comments

Popular posts from this blog

Day 1

Day 365 + 1

Day 365 + 2