Debian Codegraph @

tests/assets/rotate-z-shadow-dom.html

raw
1 <html>
2 <head></head>
3 <body></body>
4 <script>
5 window.addEventListener('DOMContentLoaded', () => {
6 const shadow = document.body.attachShadow({mode: 'open'});
7 shadow.append(document.createElement('div'));
8 const style = document.createElement('style');
9 style.textContent = `
10 div {
11 position: absolute;
12 top: 0;
13 left: 0;
14 width: 200px;
15 height: 100px;
16 background-color: red;
17 animation-name: z-spin;
18 animation-duration: 5s;
19 animation-iteration-count: infinite;
20 animation-timing-function: linear;
21 }
22
23 @keyframes z-spin {
24 0% { transform: rotateZ(0deg); }
25 100% { transform: rotateZ(360deg); }
26 }
27 `;
28 shadow.append(style);
29 }, false);
30 </script>
31 </html>