@use "sass:math"; .tech-mosaic { display: flex; flex-wrap: wrap; overflow: hidden; .item { position: relative; box-sizing: border-box; background-color: rgba(231, 231, 231, 0.425); flex-basis: percentage(math.div(1, 8)); } .item::before { content: ''; display: block; padding-top: 100%; } .item .item-inside { position: absolute; top: 0; left: 0; height: 100%; width: 100%; } .item-bg { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; justify-content: center; align-items: center; overflow: hidden; img { width: 100%; } padding: 2em; } .item-bg img.img-stretch { width: auto; height: 100%; } .item-content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; color: white; display: flex; justify-content: center; align-items: center; opacity: 1; background-color: rgba(95, 196, 99, 0.46); transition: all 0.2s; } .item-content > div { opacity: 0; font-size: 1.1em; text-align: center; padding: .5em; line-height: 1.5em; max-width: 100%; } .item:hover .item-content { background-color: rgba(0, 0, 0, 0); } } .tech-mosaic-btn-container { position: absolute; bottom: 0; width: 100%; display: flex; justify-content: center; align-items: center; margin-top: 1em; .btn { margin-bottom: 1em; } } .tech-mosaic-container { position: relative; &.opened .tech-mosaic-btn-container { display: none; } &.closed .tech-mosaic-btn-container { @include scrimGradient(white, 0deg); height: 11em; } &.closed .tech-mosaic { max-height: 20em; } } @media (min-width: 400px) { .item-bg { padding: 1em !important; } } @media (max-width: 1000px) { .tech-mosaic { .item { flex-basis: percentage(math.div(1, 5)); } } } @media (max-width: 800px) { .tech-mosaic { .item { flex-basis: percentage(math.div(1, 4)); } } } @media (max-width: 400px) { .tech-mosaic { .item { flex-basis: percentage(math.div(1, 2)); } } }