element to become larger. It uses positive and negative numbers as well as decimals as arguments.
TranslateTranslate is the relocation element based on the x and Y coordinates.
SkewAs the name suggests, the skew is to tilt the object, the argument is the degree
MatrixTransform support matrix transformation, which is to reposition elements based on X and y coordinates
Let's take a closer look at each function.
Rotate
The Transform property has many uses, one of which is the trans
rotateX or rotateY to flip the cube surface orientation, and use translateZ to move the cube surface in a three-dimensional space.
Css:
The Code is as follows:
# Cube. one {-Webkit-transform: rotateX (90deg) translateZ (200px );-Moz-transform: rotateX (90deg) translateZ (200px );-O-transform: rotateX (90deg) translateZ (200px );Transform: rotateX (
.
//container, set transform-style:preserve-3d, let its child elements in 3D space rendering//cube six faces
CSS Code
For stage elements
. rect-wrap {
position:relative;
perspective:1600px;
}
For containers
. container {
width:800px;
height:800px;
transform-style:preserve-3d;
transform-origin:50% 50% 200px;
//Set the origin of 3d space in the center of the plane and then move the 200px position to the z axis
}
Each face of the cube
. slide {
width:400px;
height:400px;
Position:absolute; Locate
}
original point)Draw Cube Effect
You reader can't wait, say so much ' nonsense ', the play of this article finally came!
CSS Code
For stage elements
. rect-wrap {position:relative;perspective:1600px;}
For containers
. container {width:800px;height:800px;transform-style:preserve-3d;transform-origin:50% 50% 200px; Set the origin of the 3d space to move the 200px position in the center of the plane to the z axis}
Each face of the cube
. Slide {width:400px;height:400px;Position:absolute; P
"Project Address": HTTP://DWZ.CN/RYGQ7"Mobile QR Code":"Effect":【代码】 For a better experience, please use the vertical screen to browseThe /* style is placed at the end to prevent congestion in base64 pictures */ @keyframes rotation { 10% { Transform:rotate (90deg); -webkit-transform:rotate (90deg) } 50% { transform:rotate (0); -webkit-transform:rotate (0) } 60% { transform:rotate (0); -webkit-transform:r
Mobile phone horizontal screen prompt, mobile phone horizontal
[Project address]: http://dwz.cn/RYgq7
[Mobile Phone QR code ]:
[Effect ]:
[Code]
For better experience, use the vertical screen
/* Put the style at the end to prevent congestion caused by base64 images */@ Keyframes rotation {10% {Transform: rotate (90deg );-Webkit-transform: rotate (90deg)}50% {Transform: rotate (0 );-Webkit-transform: rot
axis.Then. We add a cube element to the package container element, 6 edges (up and down and back and forth), using figure. is due to the need to support stickers.We need to determine the coordinate position of each plane of the cube according to the thickness and width of the book. The absolute thickness of the book model (a MySQL book) used in this example is 18.2px. Height 260px. Width 197.6px.According to the simple geometrical knowledge, the distance from the center of the cube to the front
, if you want to change the dominant color of this stripe, you even need to change it everywhere.
A better way is to not specify a color for each stripe, but specify the deepest color as the background color, and overlay the translucent white stripe on the background color to obtain the light-colored stripe.
background: #58a; background-image:repeating-linear-gradient(30deg,hsla(0,0%,100%,.1), hsla(0,0%,100%,.1) 15px, transparent 0,transparent 30px);
Now, you only need to modify one place t
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.