Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
Gradientes en los bordes del carrusel deslizante

Quiero un comportamiento como el de esta página web de airbnb. Concretamente, el de la siguiente imagen. ingrese la descripción de la imagen aquí Como puede ver, en los bordes del carrusel, tiene un efecto de desvanecimiento solo en las diapositivas que están cortadas.

Esto es lo que tengo hasta ahora: https://jsfiddle.net/gpu5cafz/ .

HTML (asegúrese de instalar Swiper si no está usando jsfiddle):

 <div class="container"> <div class="swiper"> <!-- Additional required wrapper --> <div class="swiper-wrapper"> <!-- Slides --> <div class="swiper-slide">Slide 1</div> <div class="swiper-slide">Slide 2</div> <div class="swiper-slide">Slide 3</div> <div class="swiper-slide">Slide 4</div> <div class="swiper-slide">Slide 5</div> </div> </div> </div>

CSS:

 .swiper-slide { width: 300px !important; height: 200px !important; text-decoration: none; background-color: gray; border-radius: 10px; color: white; background: rgb(203, 203, 203); } .container { padding: 60px 120px 60px 120px; }

JS:

 const swiper = new Swiper('.swiper', { slidesPerView: 'auto', spaceBetween: 30, freeMode: true, freeModeSticky: false, watchSlidesProgress: true, watchSlidesVisibility: true, });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Tienes razón, no era exactamente lo que buscabas. Estás buscando este tipo de solución:

 <title>My Example</title> <style> div { background: linear-gradient(to right, white 20%, grey, white 80%); color: white; padding: 30px; height: 160px; font-family: sans-serif; font-size: 1.5em; } </style> <div> Three color stops. </div>``` I think in the end your gonna end up in this ballpark. I am not 100% sure how to get your exact endresult (they seem to use some kind of animation feature too). But maybe someone else can supplement. This example I am giving you here is based on what I built for a customer once where they had an image in the middle and they wanted to have a background color left/right and then have it fade out as it got closer to the middle of the screen.
about 4 years ago · Juan Pablo Isaza Report

0

Considere el uso de degradados en la propiedad de la mask .

Por ejemplo,

 .container { mask-image: linear-gradient(to right, transparent 0%, black 20% 80%, transparent 100%); }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!