Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDN feature pages for SVGAnimatedTransformList #37077

Merged
merged 9 commits into from
Dec 6, 2024
43 changes: 43 additions & 0 deletions files/en-us/web/api/svganimatedtransformlist/animval/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: SVGAnimatedTransformList.animVal Property
short-title: animVal
slug: Web/API/SVGAnimatedTransformList/animVal
page-type: web-api-instance-property
browser-compat: api.SVGAnimatedTransformList.animVal
---

{{APIRef("SVG")}}

The **`animVal`** read-only property of the {{domxref("SVGAnimatedTransformList")}} interface represents the animated value of the `transform` attribute of an SVG element.

This property reflects the SVG element's {{SVGAttr("transform")}}, the {{SVGElement("linearGradient")}} or {{SVGElement("radialGradient")}} element's {{SVGAttr("gradientTransform")}} attribute, or the {{SVGElement("pattern")}} element's {{SVGAttr("patternTransform")}} attribute as a readonly {{ domxref("SVGTransformList") }}, providing access to the dynamically updated {{ domxref("SVGTransform") }} for each transform function during an animation. If no animation is active, this property will return the same value as `baseVal`.

## Value

An {{domxref("SVGTransformList")}} object that reflects the current animated value of the `transform` attribute.

## Examples

```js
// Get the rectangle element
const rect = document.querySelector("rect");

// Access the animated transform list (if any)
const animTransforms = rect.transform.animVal;

// Log the animated transforms to the console
console.dir(animTransforms);
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("SVGTransformList")}}
- {{domxref("SVGTransform")}}
43 changes: 43 additions & 0 deletions files/en-us/web/api/svganimatedtransformlist/baseval/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: SVGAnimatedTransformList.baseVal Property
short-title: baseVal
slug: Web/API/SVGAnimatedTransformList/baseVal
page-type: web-api-instance-property
browser-compat: api.SVGAnimatedTransformList.baseVal
---

{{APIRef("SVG")}}

The **`baseVal`** read-only property of the {{domxref("SVGAnimatedTransformList")}} interface represents the non-animated value of the `transform` attribute of an SVG element.

This property reflects the SVG element's {{SVGAttr("transform")}}, the {{SVGElement("linearGradient")}} or {{SVGElement("radialGradient")}} element's {{SVGAttr("gradientTransform")}} attribute, or the {{SVGElement("pattern")}} element's {{SVGAttr("patternTransform")}} attribute value as a readonly {{ domxref("SVGTransformList") }}, providing access to a static {{ domxref("SVGTransform") }} for each transform function set on the SVG element.

## Value

An {{domxref("SVGTransformList")}} object that represents the current, non-animated value of the `transform` attribute.

## Examples

```js
// Get the rectangle element
const rect = document.querySelector("rect");

// Access the non-animated transform list of the element
const baseTransforms = rect.transform.baseVal;

// Log the base transforms to the console
console.dir(baseTransforms);
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("SVGTransformList")}}
- {{domxref("SVGTransform")}}
4 changes: 2 additions & 2 deletions files/en-us/web/api/svganimatedtransformlist/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ The `SVGAnimatedTransformList` interface is used for attributes which take a lis
</thead>
<tbody>
<tr>
<td><code>baseVal</code></td>
<td><code>{{domxref("SVGAnimatedTransformList.baseVal", "baseVal")}}</code></td>
<td>{{ domxref("SVGTransformList") }}</td>
<td>
The base value of the given attribute before applying any animations.
</td>
</tr>
<tr>
<td><code>animVal</code></td>
<td><code>{{domxref("SVGAnimatedTransformList.animVal", "animVal")}}</code></td>
<td>{{ domxref("SVGTransformList") }}</td>
<td>
A read only {{ domxref("SVGTransformList") }} representing
Expand Down
Loading