diff --git a/angular.json b/angular.json index 1c07f58..faa069a 100644 --- a/angular.json +++ b/angular.json @@ -38,8 +38,8 @@ }, { "type": "anyComponentStyle", - "maximumWarning": "4kB", - "maximumError": "8kB" + "maximumWarning": "5kB", + "maximumError": "5kB" } ], "outputHashing": "all" diff --git a/src/components/tech-stack-carousel/tech-stack-carousel.css b/src/components/tech-stack-carousel/tech-stack-carousel.css index fd7e591..3d80b57 100644 --- a/src/components/tech-stack-carousel/tech-stack-carousel.css +++ b/src/components/tech-stack-carousel/tech-stack-carousel.css @@ -28,6 +28,7 @@ h2 { .stack-carousel-shell { --carousel-nav-space: 4.25rem; + --carousel-edge-fade-size: clamp(1.25rem, 3vw, 2.75rem); position: relative; width: calc(100% + (var(--carousel-nav-space) * 2)); margin-inline: calc(var(--carousel-nav-space) * -1); @@ -35,8 +36,36 @@ h2 { } .stack-carousel-column { + position: relative; + --left-fade-size: 0px; + --right-fade-size: 0px; width: calc(100% - (var(--carousel-nav-space) * 2)); margin-inline: auto; + overflow: hidden; + -webkit-mask-image: linear-gradient( + to right, + transparent 0, + #000 var(--left-fade-size), + #000 calc(100% - var(--right-fade-size)), + transparent 100% + ); + mask-image: linear-gradient( + to right, + transparent 0, + #000 var(--left-fade-size), + #000 calc(100% - var(--right-fade-size)), + transparent 100% + ); + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; +} + +.stack-carousel-column.has-left-fade { + --left-fade-size: var(--carousel-edge-fade-size); +} + +.stack-carousel-column.has-right-fade { + --right-fade-size: var(--carousel-edge-fade-size); } .stack-carousel { @@ -180,6 +209,7 @@ h2 { @media (max-width: 760px) { .stack-carousel-shell { --carousel-nav-space: 0; + --carousel-edge-fade-size: 1rem; width: 100%; margin-inline: 0; } @@ -199,7 +229,8 @@ h2 { @media (min-width: 1000px) { .stack-slide { - flex-basis: calc((100% - 2rem) / 3); + flex-basis: calc((100% - 3rem) / 4); } } + diff --git a/src/components/tech-stack-carousel/tech-stack-carousel.html b/src/components/tech-stack-carousel/tech-stack-carousel.html index 8f69ecc..ca2df20 100644 --- a/src/components/tech-stack-carousel/tech-stack-carousel.html +++ b/src/components/tech-stack-carousel/tech-stack-carousel.html @@ -17,11 +17,12 @@ -