Home > OS >  How to reduce backdrop filter from period of length
How to reduce backdrop filter from period of length

Time:08-08

I want to smooth out the nav bar backdrop filter so it's less noticeable.

But how can I reduce the backdrop filter from 100% to 0% to the bottom.

Image of what I have now

CodePudding user response:

Do you mean, something like this?

  <header >
    <div >
      <a href="#" >Backdrop filter</a>
      <nav >
        <ul >
          <li ><a href="#" >Blur</a></li>
          <li ><a href="#" >Contrast</a></li>
          <li ><a href="#" >Grayscale</a></li>
          <li ><a href="#" >Saturate</a></li>
        </ul>
      </nav>
    </div>
  </header>

  <div >
  </div>
  <div >
  </div>
  <div >
  </div>
  <div >
  </div>
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

:root {
  --title-font:"Poppins", sans-serif;
  --body-font:"Poppins", sans-serif;
}

body {
  font-family: var(--body-font);
}

.header {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  height: 54px;
  position: fixed;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(27, 33, 56, 0.1);
}
.header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 80%;
  margin: auto;
}

.logo {
  font-family: "Ubuntu";
  font-size: 1.3em;
  text-decoration: none;
  color: #fff;
  display: block;
}

.menu {
  list-style: none;
  display: flex;
}
.menu .menu__item {
  margin-right: 3em;
}
.menu .menu__item a {
  text-decoration: none;
  color: #fff;
  font-size: 0.8em;
  font-weight: 600;
}

.banner {
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  background: url("https://images.pexels.com/photos/192136/pexels-photo-192136.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260") center/cover;
  justify-content: center;
}

.img1 {
  background: url("https://images.pexels.com/photos/1029604/pexels-photo-1029604.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260") center/cover;
}

.img2 {
  background: url("https://images.pexels.com/photos/35188/child-childrens-baby-children-s.jpg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260") center/cover;
}
  • Related