[html]
<style>
:root {
--hue: 223;
--bg: hsl(var(--hue),10%,90%);
--fg: hsl(var(--hue),10%,10%);
--trans-dur: 0.3s;
font-size: calc(16px + (24 - 16) * (100vw - 320px) / (2560 - 320));
}
.icon-btns {
display: grid;
grid-gap: 3em;
grid-template-columns: repeat(2,1fr);
margin: auto;
padding: 3em 0;
}
.icon-btn {
background-color: transparent;
outline: transparent;
position: relative;
width: 4.5em;
height: 4.5em;
perspective: 24em;
transform-style: preserve-3d;
-webkit-tap-highlight-color: transparent;
border: none;
}
.icon-btn__back,
.icon-btn__front,
.icon-btn__label {
transition:
opacity var(--trans-dur) cubic-bezier(0.83,0,0.17,1),
transform var(--trans-dur) cubic-bezier(0.83,0,0.17,1);
}
.icon-btn__back,
.icon-btn__front {
border-radius: 1.25em;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.icon-btn__back {
background: linear-gradient(hsl(var(--hue),10%,50%),hsl(208,10%,50%));
box-shadow: 0.5em -0.5em 0.75em hsla(var(--hue),10%,10%,0.15);
display: block;
transform: rotate(15deg);
transform-origin: 100% 100%;
}
.icon-btn__front {
background-color: hsla(0,0%,100%,0.3);
box-shadow: 0 0 0 0.125em hsla(0,0%,100%,0.3) inset;
backdrop-filter: blur(0.75em);
-webkit-backdrop-filter: blur(0.75em);
display: flex;
transform-origin: 80% 50%;
}
.icon-btn--blue .icon-btn__back {
background: linear-gradient(hsl(var(--hue),90%,50%),hsl(208,90%,50%));
}
.icon-btn--green .icon-btn__back {
background: linear-gradient(hsl(123,90%,40%),hsl(108,90%,40%));
}
.icon-btn--indigo .icon-btn__back {
background: linear-gradient(hsl(253,90%,50%),hsl(238,90%,50%));
}
.icon-btn--purple .icon-btn__back {
background: linear-gradient(hsl(283,90%,50%),hsl(268,90%,50%));
}
.icon-btn--red .icon-btn__back {
background: linear-gradient(hsl(3,90%,50%),hsl(348,90%,50%));
}
.icon-btn--orange .icon-btn__back {
background: linear-gradient(hsl(43,90%,50%),hsl(28,90%,50%));
}
.icon-btn__icon {
margin: auto;
width: 1.5em;
height: 1.5em;
}
.icon-btn__label {
font-size: 0.75em;
line-height: 2;
opacity: 0;
position: absolute;
top: 100%;
right: 0;
left: 0;
transform: translateY(0);
color: #fff;
}
.icon-btn:focus-visible .icon-btn__back,
.icon-btn:hover .icon-btn__back {
transform: rotate(22.5deg);
}
.icon-btn:focus-visible .icon-btn__front,
.icon-btn:hover .icon-btn__front {
transform: translateZ(3em) rotateX(20deg) rotateY(20deg);
}
.icon-btn:focus-visible .icon-btn__label,
.icon-btn:hover .icon-btn__label {
opacity: 1;
transform: translateY(20%);
}
.sprites {
display: block;
position: fixed;
transform: translateY(-100%);
}
/* Dark theme */
@media (prefers-color-scheme: dark) {
:root {
--bg: hsl(var(--hue),10%,30%);
--fg: hsl(var(--hue),10%,90%);
}
}
/* Beyond mobile */
@media (min-width: 768px) {
.icon-btns {
grid-template-columns: repeat(3,1fr);
}
}
</style>
<container style="background: #6e5a5a;
display: block;
padding: 20px 0px 10px 60px;">
<svg class="sprites" display="none">
<defs>
<linearGradient id="icon-grad" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#fff" />
<stop offset="100%" stop-color="#222" />
</linearGradient>
<mask id="icon-mask">
<rect x="0" y="0" width="24" height="24" fill="url(#icon-grad)" />
</mask>
<symbol id="files" viewBox="0 0 24 24">
<g fill="hsl(0,0%,100%)" mask="url(#icon-mask)">
<path d="m2.003,3h3.997c1.105,0,2,.895,2,2h0s14.005,0,14.005,0c1.102,0,1.995.893,1.995,1.995v1.005H0v-2.997c0-1.106.897-2.003,2.003-2.003Z"/>
<path d="m22.005,21H1.996c-1.102,0-1.996-.893-1.996-1.996v-9.004l24-.172v9.177c0,1.102-.893,1.995-1.995,1.995Z"/>
</g>
</symbol>
<symbol id="books" viewBox="0 0 24 24">
<g fill="hsl(0,0%,100%)" mask="url(#icon-mask)">
<path d="m14.113,22.696c-.356.389-1.022.176-1.022-.351V3.287c1.091-1.091,2.277-1.558,3.509-1.83,2.182-.481,4.125-.377,5.314-.222,1.317.171,2.087,1.342,2.087,2.495v14.357c0,1.553-1.296,2.777-2.802,2.727-1.246-.041-2.975.003-4.541.382-1.195.289-1.954.856-2.544,1.501Z"/>
<path d="m9.887,22.696c.356.389,1.022.176,1.022-.351V3.287c-1.091-1.091-2.277-1.558-3.509-1.83-2.182-.481-4.125-.377-5.314-.222C.77,1.406,0,2.577,0,3.729v14.357c0,1.553,1.296,2.777,2.802,2.727,1.246-.041,2.975.003,4.541.382,1.194.289,1.954.856,2.544,1.501Z"/>
</g>
</symbol>
<symbol id="graph" viewBox="0 0 24 24">
<g fill="hsl(0,0%,100%)" mask="url(#icon-mask)">
<rect rx="1" ry="1" x="0" y="12" width="6" height="12" />
<rect rx="1" ry="1" x="9" y="0" width="6" height="24" />
<rect rx="1" ry="1" x="18" y="6" width="6" height="18" />
</g>
</symbol>
<symbol id="weather" viewBox="0 0 24 24">
<g fill="hsl(0,0%,100%)" mask="url(#icon-mask)">
<path d="m2.65,10.95c.916-.546,1.986-.858,3.129-.858.138,0,.276.004.414.013.388-1.331,1.13-2.499,2.113-3.403-.187-2.126-1.971-3.791-4.144-3.791-2.299,0-4.162,1.863-4.162,4.162,0,1.766,1.1,3.273,2.65,3.877Z"/>
<path d="m19.687,12.464s-.003,0-.005,0c.002-.072.005-.144.005-.216,0-3.454-2.8-6.254-6.253-6.254-3.235,0-5.897,2.457-6.22,5.607-.454-.14-.936-.216-1.435-.216-2.679,0-4.852,2.172-4.852,4.852s2.172,4.852,4.852,4.852h13.908c2.382,0,4.313-1.931,4.313-4.312,0-2.382-1.931-4.313-4.313-4.313Z"/>
</g>
</symbol>
<symbol id="pen" viewBox="0 0 24 24">
<g fill="hsl(0,0%,100%)" mask="url(#icon-mask)">
<path d="M3.1,0C2.5-0.1,2.1,0.6,2.5,1L10,8.5c0.2,0,0.4-0.1,0.6-0.1c1.2,0,2.2,1,2.2,2.2c0,1.2-1,2.2-2.2,2.2c-1.2,0-2.2-1-2.2-2.2c0-0.2,0-0.4,0.1-0.6L1,2.5C0.6,2.1-0.1,2.5,0,3.1L3.4,17c0.1,0.4,0.4,0.7,0.9,0.8l6.4,1.3c-0.2,0.4-0.1,0.9,0.2,1.2l3.3,3.3c0.4,0.4,1.1,0.4,1.6,0l7.8-7.8c0.4-0.4,0.4-1.1,0-1.6l-3.3-3.3c-0.3-0.3-0.8-0.4-1.2-0.2l-1.3-6.4c-0.1-0.4-0.4-0.8-0.8-0.9L3.1,0z"/>
</g>
</symbol>
<symbol id="heart" viewBox="0 0 24 24">
<g fill="hsl(0,0%,100%)" mask="url(#icon-mask)">
<path d="m.204,9.117c.272,1.039.791,1.942,1.558,2.709l10.238,10.597,10.238-10.597c.767-.767,1.287-1.67,1.558-2.709.272-1.039.272-2.07,0-3.093-.272-1.023-.791-1.918-1.558-2.685-.767-.767-1.662-1.287-2.685-1.558-1.023-.272-2.062-.272-3.117,0-1.055.272-1.95.791-2.685,1.558l-1.75,2.11-1.75-2.11c-.767-.767-1.662-1.287-2.685-1.558s-2.054-.272-3.093,0c-1.039.272-1.942.791-2.709,1.558-.767.767-1.287,1.662-1.558,2.685-.272,1.023-.272,2.054,0,3.093Z"/>
</g>
</symbol>
</defs>
</svg>
<div class="icon-btns">
<button class="icon-btn icon-btn--blue" type="button">
<span class="icon-btn__back"></span>
<span class="icon-btn__front">
<svg class="icon-btn__icon" width="24px" height="24px" aria-hidden="true">
<use xlink:href="#files" />
</svg>
</span>
<span class="icon-btn__label">Files</span>
</button>
<button class="icon-btn icon-btn--purple" type="button">
<span class="icon-btn__back"></span>
<span class="icon-btn__front">
<svg class="icon-btn__icon" width="24px" height="24px" aria-hidden="true">
<use xlink:href="#books" />
</svg>
</span>
<span class="icon-btn__label">Books</span>
</button>
<button class="icon-btn icon-btn--red" type="button">
<span class="icon-btn__back"></span>
<span class="icon-btn__front">
<svg class="icon-btn__icon" width="24px" height="24px" aria-hidden="true">
<use xlink:href="#heart" />
</svg>
</span>
<span class="icon-btn__label">Health</span>
</button>
<button class="icon-btn icon-btn--indigo" type="button">
<span class="icon-btn__back"></span>
<span class="icon-btn__front">
<svg class="icon-btn__icon" width="24px" height="24px" aria-hidden="true">
<use xlink:href="#weather" />
</svg>
</span>
<span class="icon-btn__label">Weather</span>
</button>
<button class="icon-btn icon-btn--orange" type="button">
<span class="icon-btn__back"></span>
<span class="icon-btn__front">
<svg class="icon-btn__icon" width="24px" height="24px" aria-hidden="true">
<use xlink:href="#pen" />
</svg>
</span>
<span class="icon-btn__label">Notes</span>
</button>
<button class="icon-btn icon-btn--green" type="button">
<span class="icon-btn__back"></span>
<span class="icon-btn__front">
<svg class="icon-btn__icon" width="24px" height="24px" aria-hidden="true">
<use xlink:href="#graph" />
</svg>
</span>
<span class="icon-btn__label">Spreadsheets</span>
</button>
</div>
</container>
[/html]