Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <style>
    #foo {
      width:100px;
      height:100px;
    }
    #foo::part(one) {
      width:100px;
      height:50px;
      background:red;
    }
  </style>
</head>
<body>
  <div id="foo"></div>
  <script>
    root = foo.attachShadow({mode: "closed"});
    
    elem = document.createElement('div');
    elem.part = "one";
    root.appendChild(elem);
    
    const fade = [
    { opacity: 0 },
    { opacity: 1 }
    ];
    const fadeTime = {
      duration: 5000,
      iterations: 1,
      pseudoElement: "::part(one)",
    }
    foo.animate(fade, fadeTime);
  </script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers