CSS 3D Transforms


فهرست مطالب

    نمایش فهرست مطالب


CSS 3D Transforms

CSS ﺪﻨﮐ ﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ ﯼﺪﻌﺑ ﻪﺳ ﯼﺎﻫ ﻞﯾﺪﺒﺗ ﺯﺍ ﻦﯿﻨﭽﻤﻫ.

ﺪﯿﻨﯿﺒﺑ ﺍﺭ ﯼﺪﻌﺑﻭﺩ ﻦﯿﺑ ﺕﻭﺎﻔﺗ ﺎﺗ ﺪﯿﻫﺩ ﺭﺍﺮﻗ ﺮﯾﺯ ﺮﺻﺎﻨﻋ ﯼﻭﺭ ﺍﺭ ﺱﻭﺎﻣ

2D rotate
3D rotate

:ﺪﯾﻮﺷ ﯽﻣ ﺎﻨﺷﺁ ﺮﯾﺯ CSS ﯼﺎﻫ ﯽﮔﮋﯾﻭ ﺎﺑ ﻞﺼﻓ ﻦﯾﺍ ﺭﺩ

  • transform

ﺮﮔﺭﻭﺮﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ

.ﺪﻨﮐ ﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ ﯽﮔﮋﯾﻭ ﺯﺍ ﻞﻣﺎﮐ ﺭﻮﻃ ﻪﺑ ﻪﮐ ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﺮﮔﺭﻭﺮﻣ ﻪﺨﺴﻧ ﻦﯿﻟﻭﺍ ﻝﻭﺪﺟ

Property
transform 36.0
10.0
16.0
9.0
23.0

CSS 3D Transforms Methods

ﺪﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺪﯿﻧﺍﻮﺗ ﯽﻣ transform

  • rotateX()
  • rotateY()
  • rotateZ()

rotateX() ﺵﻭﺭ

:ﺪﻧﺎﺧﺮﭼ ﯽﻣ ﻦﯿﻌﻣ ﻪﺟﺭﺩ ﮏﯾ ﺭﺩ ﺩﻮﺧ X ﺭﻮﺤﻣ ﻝﻮﺣ ﺍﺭ ﺮﺼﻨﻋ ﮏﯾ

ﻝﺎﺜﻣ

 #myDiv
{
   
transform: rotateX(150deg);
}

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<head>
<style>
div {
  width: 300px;
  height: 100px;
  background-color: yellow;
  border: 1px solid black;
}

#myDiv {
  transform: rotateX(150deg);
}
</style>
</head>
<body>

<h1>The rotateX() Method</h1>

<p>The rotateX() method rotates an element around its X-axis at a given degree.</p>

<div>
This a normal div element.
</div>

<div id="myDiv">
This div element is rotated 150 degrees.
</div>

</body>
</html>



rotateY() ﺵﻭﺭ

:ﺪﻧﺎﺧﺮﭼ ﯽﻣ ﻦﯿﻌﻣ ﻪﺟﺭﺩ ﮏﯾ ﺭﺩ ﺩﻮﺧ Y ﺭﻮﺤﻣ ﻝﻮﺣ ﺍﺭ ﺮﺼﻨﻋ ﮏﯾ

ﻝﺎﺜﻣ

 #myDiv
{
   
transform: rotateY(150deg);
}

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<head>
<style>
div {
  width: 300px;
  height: 100px;
  background-color: yellow;
  border: 1px solid black;
}

#myDiv {
  transform: rotateY(150deg);
}
</style>
</head>
<body>

<h1>The rotateY() Method</h1>

<p>The rotateY() method rotates an element around its Y-axis at a given degree.</p>

<div>
This a normal div element.
</div>

<div id="myDiv">
This div element is rotated 150 degrees.
</div>

</body>
</html>



rotateZ() ﺵﻭﺭ

:ﺪﻧﺎﺧﺮﭼ ﯽﻣ ﯽﻨﯿﻌﻣ ﻪﺟﺭﺩ ﺭﺩ ﺩﻮﺧ Z ﺭﻮﺤﻣ ﻝﻮﺣ ﺍﺭ ﺮﺼﻨﻋ ﮏﯾ r

ﻝﺎﺜﻣ

 #myDiv
{
   
transform: rotateZ(90deg);
}

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<head>
<style>
div {
  width: 300px;
  height: 100px;
  background-color: yellow;
  border: 1px solid black;
}

#myDiv {
  transform: rotateZ(90deg);
}
</style>
</head>
<body>

<h1>The rotateZ() Method</h1>

<p>The rotateZ() method rotates an element around its Z-axis at a given degree.</p>

<div>
This a normal div element.
</div>

<div id="myDiv">
This div element is rotated 90 degrees.
</div>

</body>
</html>





CSS Transform Properties

:ﺪﻨﮐ ﯽﻣ ﺖﺳﺮﻬﻓ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﻞﯾﺪﺒﺗ ﯼﺎﻫ ﯽﮔﮋﯾﻭ ﻡﺎﻤﺗ ﺮﯾﺯ ﻝﻭﺪﺟ

transform

ﺪﻨﮐ ﯽﻣ ﻝﺎﻤﻋﺍ ﺮﺼﻨﻋ ﮏﯾ ﻪﺑ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺎﯾ ﯼﺪﻌﺑ ﻭﺩ ﻞﯾﺪﺒﺗ ﮏﯾ

transform-origin

ﺪﯿﻫﺩ ﺮﯿﯿﻐﺗ ﺍﺭ ﻩﺪﺷ ﻞﯾﺪﺒﺗ ﺮﺻﺎﻨﻋ ﺖﯿﻌﻗﻮﻣ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ

transform-style

ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﯼﺎﻀﻓ ﺭﺩ ﻮﺗ ﺭﺩ ﻮﺗ ﺮﺻﺎﻨﻋ ﺶﯾﺎﻤﻧ ﻩﻮﺤﻧ

perspective

ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺮﺻﺎﻨﻋ ﻩﺪﻫﺎﺸﻣ ﻩﻮﺤﻧ ﺯﺍﺪﻧﺍ ﻢﺸﭼ

perspective-origin

ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺮﺻﺎﻨﻋ ﻦﯿﯾﺎﭘ ﺖﯿﻌﻗﻮﻣ

backface-visibility

ﺮﯿﺧ ﺎﯾ ﺪﺷﺎﺑ ﻩﺪﻫﺎﺸﻣ ﻞﺑﺎﻗ ﻪﺤﻔﺻ ﯼﻭﺭ ﻪﺑ ﻭﺭ ﻡﺪﻋ ﺕﺭﻮﺻ ﺭﺩ ﺪﯾﺎﺑ ﺮﺼﻨﻋ ﮏﯾ ﺎﯾﺁ ﻪﮐ ﺪﻨﮐ ﯽﻣ

CSS 3D Transform Methods

matrix3d
(n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﺭﺍﺪﻘﻣ 16 ﺯﺍ 4x4 ﺲﯾﺮﺗﺎﻣ ﮏﯾ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﻞﯾﺪﺒﺗ ﮏﯾ

translate3d(x,y,z)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﻪﻤﺟﺮﺗ

translateX(x)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ X ﺭﻮﺤﻣ ﺭﺍﺪﻘﻣ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﻪﻤﺟﺮﺗ ﮏﯾ

translateY(y)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ Y ﺭﻮﺤﻣ ﺭﺍﺪﻘﻣ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﻪﻤﺟﺮﺗ

translateZ(z)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ Z ﺭﻮﺤﻣ ﺭﺍﺪﻘﻣ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﺍﺭ ﯼﺪﻌﺑ 3 ﻪﻤﺟﺮﺗ

scale3d(x,y,z)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺱﺎﯿﻘﻣ ﻞﯾﺪﺒﺗ

scaleX(x)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺱﺎﯿﻘﻣ ﻞﯾﺪﺒﺗ ،X ﺭﻮﺤﻣ ﯼﺍﺮﺑ ﯼﺭﺍﺪﻘﻣ ﻥﺩﺍﺩ ﺎﺑ

scaleY(y)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺱﺎﯿﻘﻣ ﻞﯾﺪﺒﺗ ﮏﯾ Y ﺭﻮﺤﻣ ﯼﺍﺮﺑ ﯼﺭﺍﺪﻘﻣ ﻥﺩﺍﺩ ﺎﺑ

scaleZ(z)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺱﺎﯿﻘﻣ ﻞﯾﺪﺒﺗ ،Z ﺭﻮﺤﻣ ﯼﺍﺮﺑ ﯼﺭﺍﺪﻘﻣ ﻥﺩﺍﺩ ﺎﺑ

rotate3d(x,y,z,angle)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺶﺧﺮﭼ

rotateX(angle)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ X ﺭﻮﺤﻣ ﺩﺍﺪﺘﻣﺍ ﺭﺩ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺶﺧﺮﭼ

rotateY(angle)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ Y ﺭﻮﺤﻣ ﺩﺍﺪﺘﻣﺍ ﺭﺩ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺶﺧﺮﭼ

rotateZ(angle)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ Z ﺭﻮﺤﻣ ﺩﺍﺪﺘﻣﺍ ﺭﺩ ﺍﺭ ﯼﺪﻌﺑ ﻪﺳ ﺶﺧﺮﭼ

perspective(n)

ﺪﻨﮐ ﯽﻣ ﻒﯾﺮﻌﺗ ﯼﺪﻌﺑ ﻪﺳ ﻩﺪﺷ ﻞﯾﺪﺒﺗ ﺮﺼﻨﻋ ﮏﯾ ﯼﺍﺮﺑ ﺍﺭ ﻮﯿﺘﮑﭙﺳﺮﭘ ﯼﺎﻤﻧ

تمامی حقوق محفوظ است. © BasicIT.org • 2023-2024