From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/pt-br/web/svg/element/mpath/index.html | 78 ++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 files/pt-br/web/svg/element/mpath/index.html (limited to 'files/pt-br/web/svg/element/mpath/index.html') diff --git a/files/pt-br/web/svg/element/mpath/index.html b/files/pt-br/web/svg/element/mpath/index.html new file mode 100644 index 0000000000..c79fc56e21 --- /dev/null +++ b/files/pt-br/web/svg/element/mpath/index.html @@ -0,0 +1,78 @@ +--- +title: mpath +slug: Web/SVG/Element/mpath +tags: + - Animação + - Caminho + - Contorno + - Elemento + - Movimento + - Referencia + - SVG +translation_of: Web/SVG/Element/mpath +--- +
{{SVGRef}}
+ +

O sub elemento mpath do elemento {{ SVGElement("animateMotion") }} fornece a habilidade de referenciar um elemento externo {{ SVGElement("path") }} como uma definição de um caminho de movimento.

+ +

Contexto de uso

+ +

{{svginfo}}

+ +

Exemplo

+ +
<svg width="100%" height="100%"  viewBox="0 0 500 300"
+     xmlns="http://www.w3.org/2000/svg"
+     xmlns:xlink="http://www.w3.org/1999/xlink" >
+
+  <rect x="1" y="1" width="498" height="298"
+        fill="none" stroke="blue" stroke-width="2" />
+
+  <!-- Desenha o contorno da trajetória de movimento em azul, ao longo, com três pequenos círculos: inicio, meio e fim. -->
+  <path id="path1" d="M100,250 C 100,50 400,50 400,250"
+        fill="none" stroke="blue" stroke-width="7.06"  />
+  <circle cx="100" cy="250" r="17.64" fill="blue"  />
+  <circle cx="250" cy="100" r="17.64" fill="blue"  />
+  <circle cx="400" cy="250" r="17.64" fill="blue"  />
+
+  <!-- Aqui temos um triângulo que andará sobre o caminho do movimento.
+       Define-se com uma orientação vertical com base no triângulo horizontalmente centralizado logo acima da origem. -->
+  <path d="M-25,-12.5 L25,-12.5 L 0,-87.5 z"
+        fill="yellow" stroke="red" stroke-width="7.06"  >
+    <!-- Define o caminho de movimento da animação -->
+    <animateMotion dur="6s" repeatCount="indefinite" rotate="auto" >
+       <mpath xlink:href="#path1"/>
+    </animateMotion>
+  </path>
+</svg>
+
+ +

Resultado:

+ +

{{EmbedLiveSample("Example",250,165)}}

+ +

Atributos

+ +

Atributos globais

+ + + +

Atributos específicos

+ + + +

Interface DOM

+ +

Este elemento implementa a interface do SVGMPathElement.

+ +

Relacionado

+ + -- cgit v1.2.3-54-g00ecf