AI CSS Animations

Monitor Chart Drawing

A hairline isometric monitor on its stand: a line chart wipes across the screen from left to right, then the accent end point pops on a spring. The chart lives in the screen plane, so it stays square.

Also known as: hairline isometric, isometric monitor animation, line chart draw animation css.

HTML

<div class="hln-monitor-chart" role="img" aria-label="A monitor drawing a line chart">
  <svg viewBox="-110 -60 220 120" aria-hidden="true">
    <g transform="translate(-12.4 6.2) scale(1.08)">
      <g><polygon points="-2.24,17.6 -2.16,17.19 -1.92,16.79 -1.53,16.42 -1,16.1 9,11.1 9.64,10.84 10.38,10.64 11.17,10.52 12,10.48 12.83,10.52 13.62,10.64 14.36,10.84 15,11.1 31,19.1 31.53,19.42 31.92,19.79 32.16,20.19 32.24,20.6 32.24,23 32.16,23.41 31.92,23.81 31.53,24.18 31,24.5 21,29.5 20.36,29.76 19.62,29.96 18.83,30.08 18,30.12 17.17,30.08 16.38,29.96 15.64,29.76 15,29.5 -1,21.5 -1.53,21.18 -1.92,20.81 -2.16,20.41 -2.24,20"/><polygon points="31,19.1 31.53,19.42 31.92,19.79 32.16,20.19 32.24,20.6 32.16,21.01 31.92,21.41 31.53,21.78 31,22.1 21,27.1 20.36,27.36 19.62,27.56 18.83,27.68 18,27.72 17.17,27.68 16.38,27.56 15.64,27.36 15,27.1 -1,19.1 -1.53,18.78 -1.92,18.41 -2.16,18.01 -2.24,17.6 -2.16,17.19 -1.92,16.79 -1.53,16.42 -1,16.1 9,11.1 9.64,10.84 10.38,10.64 11.17,10.52 12,10.48 12.83,10.52 13.62,10.64 14.36,10.84 15,11.1"/></g>
      <g><polygon points="13,17.1 19,20.1 19,0.1 13,-2.9"/><polygon points="22,18.6 19,20.1 19,0.1 22,-1.4"/><polygon points="16,-4.4 22,-1.4 19,0.1 13,-2.9"/></g>
      <g><polygon points="-18,-38.5 -17.95,-38.96 -17.81,-39.36 -17.58,-39.68 -17.27,-39.9 -14.27,-41.4 -13.89,-41.52 -13.46,-41.54 -12.99,-41.45 -12.5,-41.25 38.5,-15.75 38.99,-15.46 39.46,-15.08 39.89,-14.63 40.27,-14.13 40.58,-13.6 40.81,-13.05 40.95,-12.51 41,-12 41,17 40.95,17.46 40.81,17.86 40.58,18.18 40.27,18.4 37.27,19.9 36.89,20.02 36.46,20.04 35.99,19.95 35.5,19.75 -15.5,-5.75 -15.99,-6.04 -16.46,-6.42 -16.89,-6.87 -17.27,-7.37 -17.58,-7.9 -17.81,-8.45 -17.95,-8.99 -18,-9.5"/><polygon points="35.5,19.75 35.99,19.95 36.46,20.04 36.89,20.02 37.27,19.9 37.58,19.68 37.81,19.36 37.95,18.96 38,18.5 38,-10.5 37.95,-11.01 37.81,-11.55 37.58,-12.1 37.27,-12.63 36.89,-13.13 36.46,-13.58 35.99,-13.96 35.5,-14.25 -15.5,-39.75 -15.99,-39.95 -16.46,-40.04 -16.89,-40.02 -17.27,-39.9 -17.58,-39.68 -17.81,-39.36 -17.95,-38.96 -18,-38.5 -18,-9.5 -17.95,-8.99 -17.81,-8.45 -17.58,-7.9 -17.27,-7.37 -16.89,-6.87 -16.46,-6.42 -15.99,-6.04 -15.5,-5.75"/></g>
      <g transform="matrix(1 .5 0 -1 -18 -7)"><rect class="hln-monitor-chart-l" x="2.5" y="2.5" width="51" height="29" rx="1"/><polyline class="hln-monitor-chart-ln" points="7,9 13,12.5 19,10.5 25,16 31,14.5 37,20.5 43,19 49,26"/><rect class="hln-monitor-chart-w hln-monitor-chart-wipe" x="6" y="7.6" width="44.5" height="20.6"/><line class="hln-monitor-chart-l" x1="7" y1="11" x2="49" y2="11"/><line class="hln-monitor-chart-l" x1="7" y1="17" x2="49" y2="17"/><line class="hln-monitor-chart-l" x1="7" y1="23" x2="49" y2="23"/><line class="hln-monitor-chart-l" x1="7" y1="7" x2="49" y2="7"/><line x1="7" y1="29" x2="16" y2="29"/><rect class="hln-monitor-chart-l" x="42" y="28" width="7" height="2" rx="1"/><g class="hln-monitor-chart-dot"><circle class="hln-monitor-chart-af" cx="49" cy="26" r="1.3"/></g></g>
    </g>
  </svg>
</div>

CSS

.hln-monitor-chart {
  --c: var(--hln-color, #ff4f2e);
  font-size: var(--hln-size, 16px);
  position: relative;
  display: grid;
  place-items: center;
  width: 22em;
  height: 12em;
  border-radius: 0.75em;
  background: #f6f5f1;
  overflow: hidden;
}
.hln-monitor-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: #ffffff;
  stroke: #1c1d21;
  stroke-width: 1.25;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.hln-monitor-chart svg * {
  vector-effect: non-scaling-stroke;
}
.hln-monitor-chart polyline {
  fill: none;
}
.hln-monitor-chart .hln-monitor-chart-l {
  stroke: #9a9ca3;
}
.hln-monitor-chart .hln-monitor-chart-w {
  fill: #ffffff;
  stroke: none;
}
.hln-monitor-chart .hln-monitor-chart-af {
  fill: var(--c);
  stroke: var(--c);
}
.hln-monitor-chart .hln-monitor-chart-wipe {
  transform-box: fill-box;
  transform-origin: 100% 50%;
  transform: scaleX(0);
  animation: hln-monitor-chart-wipe 5.5s infinite;
}
.hln-monitor-chart .hln-monitor-chart-ln {
  animation: hln-monitor-chart-ln 5.5s infinite;
}
.hln-monitor-chart .hln-monitor-chart-dot {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: hln-monitor-chart-dot 5.5s infinite;
}
@keyframes hln-monitor-chart-wipe {
  0% { transform: scaleX(1); }
  9.09% { transform: scaleX(1); animation-timing-function: cubic-bezier(.65,0,.35,1); }
  34.55% { transform: scaleX(0); }
  89.09% { transform: scaleX(0); }
  89.45% { transform: scaleX(1); }
  100% { transform: scaleX(1); }
}
@keyframes hln-monitor-chart-ln {
  0% { opacity: 1; }
  83.64% { opacity: 1; animation-timing-function: cubic-bezier(.65,0,.35,1); }
  88.18% { opacity: 0; }
  90% { opacity: 0; }
  90.91% { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes hln-monitor-chart-dot {
  0% { transform: scale(0); }
  32.73% { transform: scale(0); animation-timing-function: linear(0, 0.035, 0.125, 0.247, 0.384, 0.524, 0.655, 0.771, 0.87, 0.948, 1.008, 1.05, 1.077, 1.091, 1.095, 1.091, 1.083, 1.071, 1.058, 1.045, 1.032, 1.021, 1.012, 1.005, 0.999, 0.995, 0.993, 0.991, 0.991, 0.991, 0.992, 0.993, 1); }
  43.64% { transform: scale(1); }
  83.64% { transform: scale(1); animation-timing-function: cubic-bezier(.65,0,.35,1); }
  88.18% { transform: scale(0); }
  100% { transform: scale(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hln-monitor-chart * {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hln-monitor-chart, .hln-monitor-chart *, .hln-monitor-chart::before, .hln-monitor-chart::after, .hln-monitor-chart *::before, .hln-monitor-chart *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Customizing this snippet

  • Color: set --hln-color on the element or a parent. Currently previewing #3b82f6.
  • Base size: set --hln-size. Every other dimension is in em, so the whole thing scales together. Currently previewing 16px.
  • Speed: change the duration on the transition or animation shorthand. Staggered delays are relative, so they keep their rhythm.
  • Reduced motion: the rule at the end of the CSS turns the motion off for people who asked their OS for less of it. Keep it.

Similar hairline animations