negative-w-component-ref.html 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <meta charset="utf-8">
  4. <title>Change a layer's transform making negative w component.</title>
  5. <style>
  6. body {
  7. background-color: white;
  8. overflow: hidden;
  9. }
  10. #outer {
  11. perspective: 500px;
  12. perspective-origin: 350px 250px;
  13. width: 700px;
  14. height: 500px;
  15. display: block;
  16. top: 10px;
  17. left: 10px;
  18. position: absolute;
  19. overflow: visible;
  20. }
  21. #container1 {
  22. transform-style: preserve-3d;
  23. transform: translateX(-50px) translateZ(350px) rotateY(-90deg);
  24. }
  25. #container2 {
  26. transform-style: preserve-3d;
  27. transform: translateY(-200px) translateX(50px) translateZ(350px) rotateY(90deg);
  28. }
  29. #scale {
  30. transform-style: preserve-3d;
  31. }
  32. .negw {
  33. transform: translateZ(1px);
  34. }
  35. .posw {
  36. transform: translateZ(-500px);;
  37. }
  38. #dummy {
  39. transform-style: preserve-3d;
  40. transform: translateY(150px);
  41. }
  42. #square1, #square2 {
  43. background-color: red;
  44. width: 700px;
  45. height: 200px;
  46. }
  47. </style>
  48. <body>
  49. <div id="outer">
  50. <div id="scale" class="posw">
  51. <div id="dummy">
  52. <div id="container1">
  53. <div id="square1"></div>
  54. </div>
  55. <div id="container2">
  56. <div id="square2"></div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>