Baseline Widely available
matrix3d()
㯠CSS ã®é¢æ°ã§ã 4x4 ã® 3D 忬¡å¤æè¡åãå®ç¾©ãã¾ãã çµæã¯ <transform-function>
ãã¼ã¿åã«ãªãã¾ãã
transform: matrix3d(
-0.6,
1.34788,
0,
0,
-2.34788,
-0.6,
0,
0,
0,
0,
1,
0,
0,
0,
10,
1
);
transform: matrix3d(
0.5,
0,
-0.866025,
0,
0.595877,
1.2,
-1.03209,
0,
0.866025,
0,
0.5,
0,
25.9808,
0,
15,
1
);
<section id="default-example">
<img
class="transition-all"
id="example-element"
src="/shared-assets/images/examples/firefox-logo.svg"
width="200" />
</section>
æ§æ
matrix3d()
颿°ã¯ 16 åã®å¤ã§æå®ãã¾ããååªå
ã®é ã§è¨è¿°ãã¾ãã
matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4)
å¤
<number>
ã§ãç·å½¢å¤æãè¨è¿°ãã¾ãã
<number>
ã§ãé©ç¨ãã座æ¨å¤æãè¨è¿°ãã¾ãã
次ã®ä¾ã¯ã DOM è¦ç´ ã¨å¤æãã使ãããç«æ¹ä½ã示ãã¦ããããã¤ã³ã¿ã¼ãç½®ããããã©ã¼ã«ã¹ããããããã¨ã§ matrix3d()
夿ãé©ç¨ãããã¨ãã§ãã¾ãã
<section id="example-element" tabindex="0">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</section>
CSS
#example-element {
width: 100px;
height: 100px;
transform-style: preserve-3d;
transition: transform 1.5s;
transform: rotate3d(1, 1, 1, 30deg);
margin: 50px auto;
}
#example-element:hover,
#example-element:focus {
transform: rotate3d(1, 1, 1, 30deg)
matrix3d(1, 0, 0, 0, 0, 1, 6, 0, 0, 0, 1, 0, 50, 100, 0, 1.1);
}
.face {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
position: absolute;
backface-visibility: inherit;
font-size: 60px;
color: #fff;
}
.front {
background: rgba(90, 90, 90, 0.7);
transform: translateZ(50px);
}
.back {
background: rgba(0, 210, 0, 0.7);
transform: rotateY(180deg) translateZ(50px);
}
.right {
background: rgba(210, 0, 0, 0.7);
transform: rotateY(90deg) translateZ(50px);
}
.left {
background: rgba(0, 0, 210, 0.7);
transform: rotateY(-90deg) translateZ(50px);
}
.top {
background: rgba(210, 210, 0, 0.7);
transform: rotateX(90deg) translateZ(50px);
}
.bottom {
background: rgba(210, 0, 210, 0.7);
transform: rotateX(-90deg) translateZ(50px);
}
çµæ è¡åå¤æã¨æ¡å¤§ç¸®å°ã®ä¾
ããä¸ã¤ã® transform3d()
ã®ä¾ã¯ãå¤æã¨æ¡å¤§ç¸®å°ãã¢ãã¡ã¼ã·ã§ã³ã¨çµã¿åããã¦å®è£
ãããã®ã§ãã
<div class="foo">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos quaerat sit
soluta, quisquam exercitationem delectus qui unde in facere necessitatibus aut
quia porro dolorem nesciunt enim, at consequuntur aliquam esse?
</div>
CSS
html {
width: 100%;
}
body {
height: 100vh;
/* Centering content */
display: flex;
flex-flow: row wrap;
justify-content: center;
align-content: center;
}
.foo {
width: 50%;
padding: 1em;
color: white;
background: #ff8c66;
border: 2px dashed black;
text-align: center;
font-family: system-ui, sans-serif;
font-size: 14px;
/* ããè¯ããã¢ã³ã¹ãã¬ã¼ã·ã§ã³ã®ããã®ã¢ãã¡ã¼ã·ã§ã³ã®è¨å® */
animation: MotionScale 2s alternate linear infinite;
}
@keyframes MotionScale {
from {
/*
ããã§ã¯æçè¡åãåºç¤ã¨ãã¦ãã¾ãã
以ä¸ã®è¡åã¯ã以ä¸ã®å¤æãè¨è¿°ãã¦ãã¾ãã
ããããã® X 座æ¨ã -50px ç§»åãã
ããããã® Y 座æ¨ã -100px ç§»åãã
ããããã® Z 座æ¨ã 0 ç§»åãã
10% 縮å°ãã
*/
transform: matrix3d(
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
-50, -100, 0, 1.1
);
}
50% {
transform: matrix3d(
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 0.9
);
}
to {
transform: matrix3d(
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
50, 100, 0, 1.1
)
}
}
çµæ 仿§æ¸ ãã©ã¦ã¶ã¼ã®äºææ§ é¢é£æ
å ±
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4