Skip to content

Commit 5e506e0

Browse files
author
Sepand Parhami
committed
Update docs for the crop container options.
1 parent 06d7f49 commit 5e506e0

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

docs/demo/zoom-crop/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Like the hero demo, but starting zoomed in on part of the image. This uses an outer cropping container to zoom in on part of the image.
1+
Like the hero demo, but starting zoomed in on part of the image. This uses an outer cropping container to zoom in on part of the image.
2+
3+
See the [image crop calculator](../../tools/img-cropper) to generate the markup needed for the initial crop.

docs/demo/zoom-crop/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
</div>
4141

4242
<p>
43+
See the <a href="../../tools/img-cropper">image crop calculator</a> to generate the markup needed for the initial crop.
44+
</p><p>
4345
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
4446
</p><p>
4547
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

docs/prepare-image-animation.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ setTimeout(() => {
3333
* [Image gallery](./demo/gallery)
3434
* [Inline image expansion](./demo/expand)
3535
* [Panning an image back and forth](./demo/pan)
36+
* [Cropped image animation](./demo/zoom-crop)
3637

3738
### How `prepareImageAnimation` Works
3839

@@ -156,6 +157,25 @@ applyAnimation();
156157

157158
The forced style calculation caused by `prepareImageAnimation` can be avoided if you already know where `targetImg` will be positioned. Note that in this case, you will still need to provide a `targetImg` to the function so that the animation knows the `object-fit` property to animate to.
158159

160+
#### `srcCropRect`
161+
162+
Defaults to `srcImgRect`. If you want to crop your image using a wrapping element, you can specify this to control the initial crop of the image.
163+
164+
See:
165+
166+
- [zoom/crop animation demo](./demo/zoom-crop)
167+
- [image crop calculator](./tools/img-cropper)
168+
169+
#### `targetCropRect`
170+
171+
Defaults to `targetImgRect`. If you want to crop your image using a wrapping element, you can specify this to control the ending crop of the image.
172+
173+
See:
174+
175+
- [zoom/crop animation demo](./demo/zoom-crop)
176+
- [image crop calculator](./tools/img-cropper)
177+
178+
159179
#### `curve`
160180

161181
This option defaults to the built-in `ease-in-out` transition timing function (`{x1: 0.42, y1: 0, x2: 0.58, y2: 1}`). This is an object with the control points for a [`cubic-bezier()`](https://developer.mozilla.org/en-US/docs/Web/CSS/single-transition-timing-function#The_cubic-bezier()_class_of_timing_functions) curve and is used to determine the animation progress for the position, size and crop at any given time.

0 commit comments

Comments
 (0)