Würfelflächen-Flip
Würfelflächen-Flip: CSS-Button. Kopiere die Regeln oder den Prompt, der das Ergebnis nachbaut.
CSS
.btn-117 {
position: relative;
font: 600 14px/1 system-ui,sans-serif;
color: #fff;
background: #2563eb;
border: 0;
border-radius: 10px;
width: 150px;
height: 44px;
cursor: pointer;
perspective: 300px;
transition: background .2s
}
.btn-117 span,.btn-117 i {
position: absolute;
inset: 0;
display: grid;
place-items: center;
font-style: normal;
backface-visibility: hidden;
transition: transform .45s
}
.btn-117 i {
transform: rotateX(-90deg) translateZ(22px);
color: #dbeafe;
font-weight: 500
}
.btn-117 span {
transform: rotateX(0) translateZ(22px)
}
.btn-117:hover span {
transform: rotateX(90deg) translateZ(22px)
}
.btn-117:hover i {
transform: rotateX(0) translateZ(22px)
}
.btn-117:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 3px
}
.btn-117:active {
background: #1d4ed8
}
HTML
<button class="btn-117"><span>Download</span><i aria-hidden="true">4.2 MB</i></button>Prompt
Ein blauer #2563eb Button (10px Radius, 150px mal 44px), dessen Label "Download" beim Hover wie eine Würfelfläche um die X-Achse wegdreht, während eine zweite Fläche "4.2 MB" in Blassblau #dbeafe von unten hereindreht, 450ms, mit perspective und backface-visibility hidden. Active #1d4ed8. Fokus 2px blaue Outline mit 3px Offset.