<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>View Timeline attached to an SVG graphics element in a nested &lt;svg></title>
</head>
<style type="text/css">
  @keyframes stroke {
    from { stroke: rgb(0, 0, 254); }
    to { stroke: rgb(0, 128, 0); }
  }

  #line {
    animation: stroke auto linear both;
    animation-timeline: view();
    animation-range: exit-crossing;
  }
  .spacer {
    height:  100vh;
  }
</style>
