Skip to content

armgit / iris

Public Imported from GitHub
0

Screenshots of live websites. Minimal interface, powerful engine.

1.9 KB
Raw Blame
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Iris precise capture fixture</title>
    <style>
      html,
      body {
        margin: 0;
        min-height: 100%;
        background: #f5f3ee;
      }

      @media (prefers-color-scheme: dark) {
        html,
        body {
          background: #151713;
          color: #f5f3ee;
        }
      }

      .spacer {
        height: 1100px;
      }

      .capture-target {
        box-sizing: border-box;
        margin-left: 40.25px;
        width: 80.5px;
        height: 60.5px;
        border: 4px solid #10231b;
        background: #2bc477;
        opacity: 0;
        transition: width 180ms linear, opacity 180ms linear;
      }

      .capture-target.visible {
        width: 120.5px;
        opacity: 1;
      }

      .capture-target.second {
        width: 240px;
        height: 100px;
        margin-top: 300px;
        opacity: 1;
        transition: none;
      }

      #zero-size {
        width: 0;
        height: 0;
        overflow: hidden;
      }

      .tail {
        height: 500px;
      }
    </style>
  </head>
  <body>
    <div class="spacer"></div>
    <div class="capture-target">first</div>
    <div class="capture-target second">second</div>
    <div id="zero-size"></div>
    <div class="tail"></div>
    <script>
      if (new URLSearchParams(location.search).has("missing")) {
        document.querySelectorAll(".capture-target").forEach((element) => element.remove());
      } else {
        const first = document.querySelector(".capture-target");
        new IntersectionObserver((entries, observer) => {
          if (entries.some((entry) => entry.isIntersecting)) {
            first.classList.add("visible");
            observer.disconnect();
          }
        }).observe(first);
      }
    </script>
  </body>
</html>