piekarnikgosipl/css/portfolio.css
2026-06-02 22:33:13 +02:00

114 lines
2.3 KiB
CSS

#portfolio-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
grid-auto-rows: 280px;
grid-auto-flow: dense;
gap: 1.5rem;
& > * {
overflow: hidden;
border-radius: var(--border-radius);
background: var(--surface-container-highest);
transition: transform 0.3s, box-shadow 0.3s;
position: relative;
cursor: pointer;
}
& > *:hover {
transform: translateY(-8px);
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}
& img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s;
}
& > *:hover img {
transform: scale(1.08);
}
& > :nth-child(7n) {
grid-column: span 2;
grid-row: span 2;
}
& > :nth-child(11n+5) {
grid-column: span 2;
}
& > :nth-child(13n+9) {
grid-row: span 2;
}
}
#lightbox {
position: fixed;
inset: 0;
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
opacity: 0;
pointer-events: none;
transition: opacity 0.3s;
&.open {
opacity: 1;
pointer-events: all;
}
& > img {
max-width: min(90vw, 1200px);
max-height: 85vh;
border-radius: var(--small-radius);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
object-fit: contain;
min-width: 200px;
min-height: 200px;
background: var(--surface-container-highest);
}
& > button {
position: absolute;
background: rgba(0, 0, 0, 0.5);
border: none;
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
width: 3rem;
height: 3rem;
border-radius: 50%;
transition: background 0.2s;
&:hover {
background: rgba(0, 0, 0, 0.8);
}
& svg {
width: 1.5rem;
height: 1.5rem;
}
}
& #lb-close {
top: 1.5rem;
right: 1.5rem;
}
& #lb-prev {
left: 1.5rem;
}
& #lb-next {
right: 1.5rem;
}
}