Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

201
Visualizações
How to achieve the exact effect of the dropdown menu of riot games' website

I have to submit a replica of a website to my teacher to get the certificate of frontend web development and I wanted to create riot games' website, however I couldn't find the same dropdown effect the website has. How do I achieve the same effect?

I have linked the website below: https://www.riotgames.com/en

Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use the clip-path and opacity CSS properties and animate it.
In the following demo, I have used 2 different keyframes to to achieve the effect. dropDownAnimation : At start would show up as a pentagon and then gradually becomes a rectangle by the end
fadeIn: Gradually makes the dropdown visible.

You can add more points in between for more control over the animation. For now I've just added 0%, 50% and 100%. Also, you might need to play with the animation-duration property.

const btnToggleDropdown = document.querySelector("#toggle-dropdown");
const content = document.querySelector("#content");
btnToggleDropdown.addEventListener("click", () => {
  content.classList.toggle("dropdown");
});
.content {
  opacity: 0;
  padding: 1rem;
}

.dropdown {
  animation: dropDownAnimation 200ms forwards, 
              fadeIn 1s forwards;
  opacity: 1;
  background-color: red;
}

@keyframes dropDownAnimation {
  0% {
    clip-path: polygon(0 0, 100% 0%, 100% 10%, 25% 10%, 0 10%);
  }

  50% {
    clip-path: polygon(0 0, 100% 0%, 100% 40%, 25% 70%, 0 40%);
  }

  100% {
    clip-path: polygon(0 0, 100% 0%, 100% 100%, 25% 100%, 0 100%);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0
  }

  100% {
    opacity: 1
  }
}
  <button id="toggle-dropdown">Toggle Efffect</button>
  <div id="content" class="content">
    Lorem ipsum, dolor sit amet consectetur adipisicing elit.
    Lorem ipsum, dolor sit amet consectetur adipisicing elit.
    Lorem ipsum, dolor sit amet consectetur adipisicing elit.
    Lorem ipsum, dolor sit amet consectetur adipisicing elit.
    Lorem ipsum, dolor sit amet consectetur adipisicing elit.
  </div>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda