Nikolas Zimmermann
nzimmermann@igalia.com
SVG<svg xmlns="http://www.w3.org/2000/svg" width="1800px" height="1800px">
<g class="box">
<path id="path482" fill="none" d="M184.013,144.428"/>
...
</g>
</svg>
JavaScript[...document.getElementsByTagName("path")].forEach(
(path, index) => { path.style.transform = "translateZ(" + (index + 1) + "px)";
});
CSS.box {
transform-style: preserve-3d;
perspective: 10000px;
animation-name: example;
animation-duration: 10s;
}
@keyframes example {
0% { perspective: 10000px; }
50% { perspective: 100px; transform: rotate3d(0, 0, 1, 10deg); }
100% { perspective: 10000px; }
}
"transform-style: preserve-3d" is necessary to ensure that all path elements enclosed in the container share the same perspective