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

165
Visualizações
How to make a smooth background fill from left to right along with input and submit when hovering

Sorry for my poor english. How to implement this? It is necessary to smoothly appear and disappear when pointing. I tried, but it turns out quite differently. it is necessary that it is not just filled in with a rectangle, but that it is rounded. also, so that when passing "input" and "submit", he also painted them over. everything is as in the picture (enter image description here

.feedback {
  display:flex;
  padding: 40px;
  background: linear-gradient(to right, 
#000 50%, #FA5C45 50%);
  background-size: 200% 100%;
  background-position: 100%;
  transition:all 2s ease;

}

.title__block {
  width: 50%;
}

form {
  display: flex;
  flex-direction: column;
}

.input {
  margin-bottom: 20px;
}

.feedback:hover {
    background-position: 0 100%;
}

h3 {
  color: #fff;
}
<div class="feedback">
  <div class="title__block"> 
    <h3> Оставьте заявку</h3>
  </div>
  <div class="form__block">
    <form>
      <input type="name" class="input">
      <input type="phone" class="input">
      <input type="submit" class="submit">


    </form>
  </div>

</div>

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

0

it took me a while but i hope it will work for you :)

I changed it from linear-gradient to radial-gradient, the reason is because you can't get rounded shape with a linear-gradient.

Then I resized it a little bit so it looks almost the same as you showed us the screenshots, changed the background size to go off the screen , i tried to use % but it didn't work so instead of that i used viewport for both width and height.After that i changed the position so it goes out from the viewport range and on your :hover function just changed back the position so it fills up your div.

If you find the animation too slow, its because i put too big numbers into the viewport sizes, therefore if you want it to be faster, just change the transition value in your .feedback div to a smaller value.

https://codepen.io/qnecro/pen/PomdVLr

.feedback {
  display:flex;
  padding: 40px;
  background: radial-gradient(ellipse, 
#000 40%, #FA5C45 40%);
  background-size: 500vw 300vh;
  background-position: -392vw 50%;
  transition:all 2s ease;
}

.title__block {
  width: 50%;
}

form {
  display: flex;
  flex-direction: column;
}

.input {
  margin-bottom: 20px;
}

.feedback:hover {
  background-position: -288vw 50%;
}

h3 {
  color: #fff;
}

But be AWARE!

I made an Ellipse, so now it looks like this when you look at it from far away and you don't trigger your :hover function: enter image description here

So when your :hover function triggers, you move the black Ellipse to the right side as the blue arrow shows you in your :hover function, you end up with this: enter image description here

But if you change your viewport value to too big, it can end up looking like this: enter image description here

Your div on the left side will be no longer covered by the black ellipse.

about 4 years ago · Juan Pablo Isaza Relatório

0

For you issue better away use pseudo-element like extra layer. And for input tags to set background: transparent.

.feedback {
  display: flex;
  padding: 40px;
  background-color: #fa5c45;
  position: relative;
  overflow: hidden;
}

.feedback::after {
  content: '';
  position: absolute;
  height: 300px;
  width: calc(100% + 300px);
  top: 50%;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #000;
  border-radius: 0 300px 300px 0 / 0 250px 250px 0;
  transform: translate(-110%, -50%);
  transition: all 2s ease;
  z-index: 1;
}

.feedback:hover::after {
  transform: translate(0%, -50%);
}

.title__block {
  width: 50%;
  position: relative;
  z-index: 5;
}

form {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
}

.input {
  margin-bottom: 20px;
  background: transparent;
  border: none;
}

.input[type='name'],
.input[type='phone'] {
  width: 100%;
  padding: 8px 0;
  color: white;
  border-bottom: 1px solid white;
}

::placeholder {
  color: white;
}

.feedback:hover {
  background-position: 0 100%;
}

h3 {
  color: #fff;
}
<div class="feedback">
  <div class="title__block">
    <h3>Оставьте заявку</h3>
  </div>
  <div class="form__block">
    <form>
      <input type="name" class="input" placeholder="Имя" />
      <input type="phone" class="input" placeholder="Телефон" />
      <input type="submit" class="submit" />
    </form>
  </div>
</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