<footer>
<div class="control">
<label for="justify-content">justify-content:</label>
<select name="justify-content" id="justify-content">
<option value="normal">normal</option>
<optgroup label="content-distribution">
<option value="space-between">space-between</option>
<option value="space-around">space-around</option>
<option value="space-evenly">space-evenly</option>
<option value="stretch">stretch</option>
</optgroup>
<optgroup label="overflow-position">
<option value="unsafe">unsafe</option>
<option value="safe">safe</option>
</optgroup>
<optgroup label="content-position">
<option value="center">center</option>
<option value="start">start</option>
<option value="end">end</option>
<option value="flex-start">flex-start</option>
<option value="flex-end">flex-end</option>
</optgroup>
<option value="left">left</option>
<option value="right">right</option>
</select>
</div>
<div class="control">
<label for="align-content">align-content:</label>
<select name="align-content" id="align-content">
<option value="normal">normal</option>
<optgroup label="baseline-position">
<option value="baseline">baseline</option>
<option value="first baseline">first baseline</option>
<option value="last baseline">last baseline</option>
</optgroup>
<optgroup label="content-distribution">
<option value="space-between">space-between</option>
<option value="space-around">space-around</option>
<option value="space-evenly">space-evenly</option>
<option value="stretch">stretch</option>
</optgroup>
<optgroup label="overflow-position">
<option value="unsafe">unsafe</option>
<option value="safe">safe</option>
</optgroup>
<optgroup label="content-position">
<option value="center">center</option>
<option value="start">start</option>
<option value="end">end</option>
<option value="flex-start">flex-start</option>
<option value="flex-end">flex-end</option>
</optgroup>
</select>
</div>
<div class="control">
<label for="align-tracks">align-tracks:</label>
<select name="align-tracks" id="align-tracks">
<option value="normal">normal</option>
<optgroup label="baseline-position">
<option value="baseline">baseline</option>
<option value="first baseline">first baseline</option>
<option value="last baseline">last baseline</option>
</optgroup>
<optgroup label="content-distribution">
<option value="space-between">space-between</option>
<option value="space-around">space-around</option>
<option value="space-evenly">space-evenly</option>
<option value="stretch">stretch</option>
</optgroup>
<optgroup label="overflow-position">
<option value="unsafe">unsafe</option>
<option value="safe">safe</option>
</optgroup>
<optgroup label="content-position">
<option value="center">center</option>
<option value="start">start</option>
<option value="end">end</option>
<option value="flex-start">flex-start</option>
<option value="flex-end">flex-end</option>
</optgroup>
</select>
</div>
</footer>
@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;
}
:root {
--justify-content: normal;
--align-content: normal;
--align-tracks: normal;
}
body {
display: grid;
grid-template-columns: repeat(4, 160px);
grid-template-rows: masonry;
gap: 10px;
justify-content: var(--justify-content);
align-content: var(--align-content);
align-tracks: var(--align-tracks);
}
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);
}
const rootElement = document.documentElement;
const selects = document.querySelectorAll("select");
selects.forEach((select) =>
select.addEventListener("change", (e) => {
rootElement.style.setProperty(`--${e.target.id}`, e.target.value);
})
);
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.