HTMLify

style.css
Views: 37 | Author: cody
:root {
    --background: #3C343D;
    --background-border: #6B626C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;  
}

body {
    font-family: Poppins;
    height: 100vh;
    padding: 32px;
    display: grid;
    place-items: center;
    background-color: var(--background);
}

.gallery {
    display: flex;
    background-color: var(--background);
    gap: 16px;
}

.card {
    position: relative;
    left: 0px;
    width: 140px;
    height: 160px;
    background-color: var(--background);
    border-radius: 8px;
    transition: 1000ms all;
    transform-origin: center left;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.5);
    outline: 1px solid var(--background);
    overflow: hidden;
}

.card img {
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
}

.card:hover {
    cursor: pointer;
    transform: scale(1.15);
}

.card:hover figcaption {
    font-size: 0.6rem;
    position: absolute;
    height: 80px;
    width: 160px;
    display: flex;
    align-items: end;
    background: linear-gradient(
        to top, 
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0) 100%
    );
    color: white;
    left: 0px;
    bottom: 0px;
    padding-left: 12px;
    padding-bottom: 10px;
}

.card:hover ~ .card {
    font-weight: bold;
    cursor: pointer;
    transform: translateX(22px);
}

Comments