|
1 | 1 | @layer components {
|
| 2 | + |
| 3 | + /* Carousel */ |
| 4 | + |
| 5 | + .pc-carousel { |
| 6 | + @apply relative w-full h-[400px] overflow-hidden bg-transparent; |
| 7 | + } |
| 8 | + |
| 9 | + .pc-carousel__button { |
| 10 | + @apply absolute inset-y-0 z-30 p-4 transition bg-black/10 hover:bg-black/30 focus:outline-none; |
| 11 | + } |
| 12 | + |
| 13 | + .pc-carousel__button--prev { |
| 14 | + @apply left-0; |
| 15 | + } |
| 16 | + |
| 17 | + .pc-carousel__button--next { |
| 18 | + @apply right-0; |
| 19 | + } |
| 20 | + |
| 21 | + .pc-carousel__icon { |
| 22 | + @apply text-white size-7; |
| 23 | + } |
| 24 | + |
| 25 | + .pc-carousel__slides { |
| 26 | + @apply relative w-full h-full; |
| 27 | + } |
| 28 | + |
| 29 | + .pc-carousel__slide { |
| 30 | + @apply absolute top-0 left-0 w-full h-full bg-white; |
| 31 | + will-change: transform, opacity; |
| 32 | + } |
| 33 | + |
| 34 | + .pc-carousel__slide--active { |
| 35 | + @apply z-10 opacity-100; |
| 36 | + } |
| 37 | + |
| 38 | + .pc-carousel__slide--inactive { |
| 39 | + @apply z-0 opacity-0; |
| 40 | + } |
| 41 | + |
| 42 | + /* Slide transition specific styles */ |
| 43 | + .pc-carousel[data-transition-type="slide"] .pc-carousel__slides { |
| 44 | + @apply overflow-hidden; |
| 45 | + } |
| 46 | + |
| 47 | + .pc-carousel[data-transition-type="slide"] .pc-carousel__slide { |
| 48 | + @apply transition-transform duration-500 ease-in-out; |
| 49 | + } |
| 50 | + |
| 51 | + .pc-carousel[data-transition-type="slide"] .pc-carousel__slide--active { |
| 52 | + @apply translate-x-0; |
| 53 | + } |
| 54 | + |
| 55 | + .pc-carousel[data-transition-type="slide"] .pc-carousel__slide--inactive { |
| 56 | + @apply translate-x-full; |
| 57 | + } |
| 58 | + |
| 59 | + .pc-carousel[data-transition-type="slide"] .pc-carousel__slide--inactive.prev { |
| 60 | + @apply -translate-x-full; |
| 61 | + } |
| 62 | + |
| 63 | + /* Fade transition specific styles */ |
| 64 | + .pc-carousel[data-transition-type="fade"] .pc-carousel__slide { |
| 65 | + @apply transition-opacity duration-500 ease-in-out; |
| 66 | + } |
| 67 | + |
| 68 | + .pc-carousel__slide-content { |
| 69 | + @apply relative w-full h-full; |
| 70 | + } |
| 71 | + |
| 72 | + .pc-carousel__image-wrapper { |
| 73 | + @apply absolute inset-0 z-0; |
| 74 | + } |
| 75 | + |
| 76 | + .pc-carousel__image { |
| 77 | + @apply object-cover w-full h-full; |
| 78 | + } |
| 79 | + |
| 80 | + .pc-carousel__content { |
| 81 | + @apply absolute inset-0 z-10 flex items-center justify-center; |
| 82 | + background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%); |
| 83 | + } |
| 84 | + |
| 85 | + .pc-carousel__content-wrapper { |
| 86 | + @apply flex flex-col w-full gap-5 p-8 sm:p-24; |
| 87 | + } |
| 88 | + |
| 89 | + .pc-carousel__title { |
| 90 | + @apply text-4xl font-bold text-white; |
| 91 | + } |
| 92 | + |
| 93 | + .pc-carousel__description { |
| 94 | + @apply text-xl text-white; |
| 95 | + } |
| 96 | + |
| 97 | + .pc-carousel__link { |
| 98 | + @apply absolute inset-0 z-20 block w-full h-full no-underline cursor-pointer; |
| 99 | + } |
| 100 | + |
| 101 | + .pc-carousel__indicators { |
| 102 | + @apply absolute inset-x-0 bottom-0 z-10 flex justify-center gap-3 py-2.5; |
| 103 | + } |
| 104 | + |
| 105 | + .pc-carousel__indicator { |
| 106 | + @apply w-6 h-1 transition-all duration-500 ease-in-out opacity-50 bg-gray-50 hover:opacity-100; |
| 107 | + } |
| 108 | + |
2 | 109 | /* Container */
|
3 | 110 |
|
4 | 111 | .pc-container {
|
|
0 commit comments