diff --git a/files/en-us/web/api/svganimatedangle/animval/index.md b/files/en-us/web/api/svganimatedangle/animval/index.md new file mode 100644 index 000000000000000..400f79ea4ecb608 --- /dev/null +++ b/files/en-us/web/api/svganimatedangle/animval/index.md @@ -0,0 +1,48 @@ +--- +title: "SVGAnimatedAngle: animVal property" +short-title: animVal +slug: Web/API/SVGAnimatedAngle/animVal +page-type: web-api-instance-property +browser-compat: api.SVGAnimatedAngle.animVal +--- + +{{APIRef("SVG")}} + +The **`animVal`** read-only property of the {{domxref("SVGAnimatedAngle")}} interface represents the current animated value of the associated [``](/en-US/docs/Web/SVG/Content_type#angle) on an SVG element. If the attribute is not currently being animated, `animVal` will be the same as the `baseVal`. + +This property reflects the animated state of the angle of the animating {{SVGattr("orient")}} attribute of the SVG {{SVGElement("marker")}} element, providing access to the value of the angle during animations. + +## Value + +An {{domxref("SVGAngle")}} object representing the animated value of the [``](/en-US/docs/Web/SVG/Content_type#angle) content type. + +- If the angle is being animated, `animVal` will reflect the current animation state. +- If the angle is not animated, `animVal` will be identical to {{domxref("SVGAnimatedAngle.baseVal")}}. + +## Examples + +```js +const marker = document.querySelector("[orient]"); + +// Set an initial angle for the orient attribute +marker.setAttribute("orient", "45"); + +// Access the animated value of the angle +const animAngle = marker.orientAngle.animVal; // an SVGAngle object + +console.log(animAngle.value); // Output: 45 (current animated value of the angle) +console.log(animAngle.unitType); // Output: 2 (constant for SVG_ANGLETYPE_DEG) +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("SVGAnimatedAngle.baseVal")}} +- {{domxref("SVGAngle")}} and [angle `value` constants](/en-US/docs/Web/API/SVGAngle#constants) diff --git a/files/en-us/web/api/svganimatedangle/baseval/index.md b/files/en-us/web/api/svganimatedangle/baseval/index.md new file mode 100644 index 000000000000000..1c4134ddb43983a --- /dev/null +++ b/files/en-us/web/api/svganimatedangle/baseval/index.md @@ -0,0 +1,46 @@ +--- +title: "SVGAnimatedAngle: baseVal property" +short-title: baseVal +slug: Web/API/SVGAnimatedAngle/baseVal +page-type: web-api-instance-property +browser-compat: api.SVGAnimatedAngle.baseVal +--- + +{{APIRef("SVG")}} + +The **`baseVal`** read-only property of the {{domxref("SVGAnimatedAngle")}} interface represents the base (non-animated) value of the associated [``](/en-US/docs/Web/SVG/Content_type#angle) on an SVG element. This property is used to retrieve the static value of the ``, unaffected by any ongoing animations. + +This property reflects the `` value of the {{SVGattr("orient")}} attribute of the SVG {{SVGElement("marker")}} element, which is the same as the {{domxref("SVGMarkerElement.orientAngle")}} property. + +## Value + +An {{domxref("SVGAngle")}} object representing the base value of the [``](/en-US/docs/Web/SVG/Content_type#angle) content type. + +- The value is unaffected by animations, representing the initial state of the angle. +- The unit type of the angle can be retrieved from {{domxref("SVGAngle.unitType")}}. + +## Examples + +```js +const marker = document.querySelector("[orient]"); + +// Set the orient attribute with an angle +marker.setAttribute("orient", "90"); +const baseAngle = marker.orientAngle.baseVal; // an SVGAngle object + +console.log(baseAngle.value); // Output: 90 +console.log(baseAngle.unitType); // Output: 1 (constant for SVG_ANGLETYPE_UNSPECIFIED) +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("SVGAnimatedAngle.animVal")}} +- {{domxref("SVGAngle")}} and [angle `value` constants](/en-US/docs/Web/API/SVGAngle#constants) diff --git a/files/en-us/web/api/svganimatedangle/index.md b/files/en-us/web/api/svganimatedangle/index.md index bd9a3c12a6e783d..993def27c8c9777 100644 --- a/files/en-us/web/api/svganimatedangle/index.md +++ b/files/en-us/web/api/svganimatedangle/index.md @@ -60,14 +60,14 @@ The `SVGAnimatedAngle` interface is used for attributes of basic type [\] - baseVal + {{domxref("SVGAnimatedAngle.baseVal")}} {{ domxref("SVGAngle") }} The base value of the given attribute before applying any animations. - animVal + {{domxref("SVGAnimatedAngle.animVal")}} {{ domxref("SVGAngle") }} A read only {{ domxref("SVGAngle") }} representing the current