←back to thread

518 points cantdutchthis | 7 comments | | HN request time: 1.018s | source | bottom
1. pjc50 ◴[] No.44501400[source]
"SVG is inherently animated" is new to me, and now I'm going to spend my time on the bus thinking what might be done with that. Does it support infinite loop?
replies(4): >>44501544 #>>44501591 #>>44501688 #>>44502030 #
2. Jtsummers ◴[] No.44501544[source]
> Does it support infinite loop?

Yes it does.

https://www.w3schools.com/graphics/svg_animation.asp - Has some examples, you may need to refresh to see some of them (ones that don't repeat) in action as you scroll down the page.

3. abirch ◴[] No.44501591[source]
Yes

https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/E...

  <svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
  <rect width="10" height="10">
    <animate
      attributeName="rx"
      values="0;5;0"
      dur="10s"
      repeatCount="indefinite" />
  </rect>
  </svg>
4. snackbroken ◴[] No.44501688[source]
> Does it support infinite loop?

Yes, by setting the repeatCount or repeatDur attribute of the <animate> tag to "indefinite". Notably, since <animation> tags effect individual attributes and not the image as a whole, different parts of the image can be on different animation cycles and don't have to add up to some small common multiple.

replies(1): >>44503070 #
5. jerf ◴[] No.44502030[source]
SVG embeds Ecmascript (or Javascript as the rest of the world knows it): https://www.w3.org/TR/SVG11/script.html

So not only do you get all the animation support from the attributes, you can fill in anything you need from scripting.

6. ngruhn ◴[] No.44503070[source]
That smells like Turing complete
replies(1): >>44503388 #
7. fouronnes3 ◴[] No.44503388{3}[source]
Tomorrow on HN: GPT-2 in pure SVG