Skip to content

Instantly share code, notes, and snippets.

@greystate
Created March 6, 2023 09:35
Show Gist options
  • Save greystate/524a33bb27a144f251267439a7cc1481 to your computer and use it in GitHub Desktop.
Save greystate/524a33bb27a144f251267439a7cc1481 to your computer and use it in GitHub Desktop.
Image Cloud
/**
* Image Cloud
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
--pos-x: 48;
--pos-y: 320;
}
.canvas {
display: flex;
gap: 10px;
align-items: center;
justify-content: center;
/*perspective: 1200px;*/
}
.img {
--multiplier: 0.5;
aspect-ratio: 1;
width: 200px;
background: rgba(0,0,0,0.3);
border-radius: 5%;
display: grid;
place-items: center;
font-size: 2rem;
z-index: 4;
transform: translateX(calc(var(--pos-x) * var(--multiplier) * 1px));
}
.lrg { width: 400px; font-size: 4rem; perspective: 200px; z-index: 6; --multiplier: 0.8; }
.smol { width: 100px; font-size: 1rem; transform: translateX(-40px); z-index: 2; --multiplier: 0.2; }
<div class="canvas">
<div class="img">1</div>
<div class="lrg img">2</div>
<div class="smol img">3</div>
<div class="img">4</div>
<div class="lrg img">5</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment