Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize 3D rotation of Picture by Htlm

Shulou Source: shulou.com Published: 2022-06-01 03:29:34 09月25日 Update

This article mainly introduces Htlm how to achieve 3D rotation of the picture related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this Htlm article on how to achieve 3D rotation of pictures, let's take a look.

Animation: for setting six animation attribut

1.animation-name specifies the name of the keyframe that needs to be bound to the selector.

2.animation-duration specifies the time it takes to complete the animation, in seconds or milliseconds.

3.animation-timing-function specifies the speed curve of the animation.

4.animation-delay specifies the delay before the animation starts.

5.animation-iteration-count specifies how many times the animation should be played.

6.animation-direction specifies whether the animation should be played in reverse in turn.

Html Code:

MDN

HTML5

X axis

Y axis

Z axis

Css code

# logos

{

Position: relative

Margin: 0 auto

-webkit-perspective: 822px

Perspective: 822px

}

# cube

{

Display: block

Position: relative

Margin: 30px auto

Height: 200px

Width: 200px

-webkit-transform-style: preserve-3d

-webkit-transform: rotateX (- 5deg) translateX (8px)

Transform-style: preserve-3d

Transform: rotateX (- 5deg) translateX (8px)

}

# front

{

Position: absolute

Height: 200px

Width: 200px

-webkit-backface-visibility: visible

-webkit-transform: translateZ (100px)

Backface-visibility: visible

Transform: translateZ (100px)

}

# back

{

Position: absolute

Height: 200px

Width: 200px

-webkit-backface-visibility: visible

Backface-visibility: visible

-webkit-transform: rotateY (180deg) translateZ (100px)

Transform: rotateY (180deg) translateZ (100px)

}

# cube

{

-webkit-animation: rotateGif 5s infinite linear

Animation: rotateGif 5s infinite linear

}

@-webkit-keyframes rotateGif

{

0%

{

-webkit-transform: rotateY (0)

}

100%

{

-webkit-transform: rotateY (360deg)

}

}

@ keyframes rotateGif

{

0%

{

Transform: rotateY (0)

}

100%

{

Transform: rotateY (360deg)

}

}

# xaxis

{

-moz-transform-style: preserve-3d

-moz-transform: translate3d (- 100pxPower0Pol 0)

-webkit-transform-style: preserve-3d

-webkit-transform: translate3d (- 100pxPower0Pol 0)

-ms-transform-style: preserve-3d

-ms-transform: translate3d (- 100pxPower0Pol 0)

-o-transform-style: preserve-3d

-o-transform: translate3d (- 100pxPower0Pol 0)

Transform-style: preserve-3d

Transform: translate3d (- 100pxjin0pxre0pc0pl 0)

Border-bottom: black 1px solid

Color: blue

Width: 400px

Display: block

Position: absolute

Top: 100px

Height: 1px

}

# yaxis

{

-moz-transform-style: preserve-3d

-moz-transform: rotateZ (- 90deg) translate3d (0memmerly100pxmem0)

-webkit-transform-style: preserve-3d

-webkit-transform: rotateZ (- 90deg) translate3d (0memmerly100pxmem0)

-ms-transform-style: preserve-3d

-ms-transform: rotateZ (- 90deg) translate3d (0memmerly100pxmem0)

-o-transform-style: preserve-3d

-o-transform: rotateZ (- 90deg) translate3d (0memmerly100pxmem0)

Transform-style: preserve-3d

Transform: rotateZ (- 90deg) translate3d (0memery 100pxmem0)

Border-bottom: green 1px solid

Color: green

Width: 400px

Display: block

Position: absolute

Top: 100px

Height: 1px

}

# zaxis

{

-moz-transform-style: preserve-3d

-moz-transform: rotateY (90deg) translate3d (0meme 0mai Murray 100px)

-ms-transform-style: preserve-3d

-ms-transform: rotateY (90deg) translate3d (0meme 0mai Murray 100px)

-webkit-transform-style: preserve-3d

-webkit-transform: rotateY (90deg) translate3d (0meme 0mai Murray 100px)

-o-transform-style: preserve-3d

-o-transform: rotateY (90deg) translate3d (0meme 0mai Murray 100px)

Transform-style: preserve-3d

Transform: rotateY (90deg) translate3d (0meme 0mam muri 100px)

Border-bottom: red 1px solid

Color: red

Width: 400px

Display: block

Position: absolute

Top: 100px

Height: 1px

}

This is the end of the article on "how to achieve 3D rotation of pictures in Htlm". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to achieve 3D rotation of pictures in Htlm". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Animation picture knowledge code content article value name attribute easy to operate article time easy to understand curve more times look industry information information channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Shulou Tech Info Huawei MariaDB