@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
box-sizing: border-box;
}
body {
width: calc(100vw - 12px);
min-height: calc(100vh - 12px);
counter-reset: section;
font-family: "Exo", Arial, sans-serif;
font-size: 20px;
font-weight: 600;
padding: 10px;
box-sizing: border-box;
background-color: #222;
border: 1px dashed #fff;
margin: 5px;
}
.item {
border-radius: 10px;
background-size: cover;
background-position: center;
height: 10vh;
position: relative;
border: 1px solid rgba(255, 255, 255, 0.8);
}
.item::before {
counter-increment: section;
content: counter(section);
background-image: radial-gradient(
50% 105%,
#fffff5 15%,
#fff3d5 31%,
#ffd484 100%
),
radial-gradient(51% 200%, #fffcf5 100%, rgba(251, 213, 142, 0) 100%),
radial-gradient(50% 103%, #ff5f49 15%, #ff1919 100%);
background-origin: border-box;
background-clip: padding-box, padding-box, border-box;
border: 2px solid transparent;
box-shadow: 0 2px 10px 0 rgba(96, 43, 43, 0.5);
border-radius: 50%;
padding: 5px;
font-size: 1em;
display: inline-flex;
justify-content: center;
align-items: center;
position: absolute;
right: 10px;
bottom: 10px;
color: #fff;
text-shadow: 1px 0px 0 rgb(103 105 171), 0px 1px 0 rgb(221 17 17),
-1px 0px 0 rgb(113 12 206), 0px -1px 0 rgb(207 107 225),
2px 0px 0 rgb(103 105 171), 0px 2px 0 rgb(221 17 17),
-2px 0px 0 rgb(113 12 206), 0px -2px 0 rgb(207 107 225);
width: 32px;
height: 32px;
mix-blend-mode: difference;
filter: hue-rotate(180deg);
backdrop-filter: saturate(0.8);
}
.item:nth-child(2n) {
height: 14vh;
}
.item:nth-child(3n) {
height: 18vh;
}
.item:nth-child(4n) {
height: 22vh;
}
.item:nth-child(5n) {
height: 24vh;
}
.item:nth-child(6n) {
height: 30vh;
}
.item:nth-child(7n) {
height: 34vh;
}
.item:nth-child(8n) {
height: 40vh;
}
footer {
position: fixed;
left: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
bottom: 0;
z-index: 999;
padding: 15px;
background-color: rgba(0, 0, 0, 0.65);
color: #fff;
}
footer label {
margin: 0 5px;
}
body {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: masonry;
gap: 10px;
align-tracks: start, center, end, space-between;
}
for (let i = 0; i <= 10; i++) {
const div = document.createElement("div");
div.classList.add("item");
div.style.backgroundImage = `url(https://picsum.photos/500/500?random=${i})`;
document.body.appendChild(div);
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.