-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add basic zoomed image on mouse move * feat: replace img tag by background image * chore: cleanup image zoom move vanilla example * chore: update package.json * docs: update createZoomImageMove section * docs: add vue example * docs: add svelte example * docs: add examples for the rest of frameworks * chore: add changeset and update pnpm lock * chore: enhance zoomed image on move * chore: run prettier on ci * chore: update branch for push action * chore: update ci.yml * chore: with force * chore: format code with Prettier * chore: update ad-m/github-push-action to use master * chore: change Github action job name * chore: fix failure on nothing change * chore: test ci on change * chore: format code with Prettier * chore: update doc demo * chore: update demo gif image --------- Co-authored-by: GitHub Action <[email protected]>
- Loading branch information
1 parent
ddb0193
commit 2fe07ad
Showing
30 changed files
with
351 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@zoom-image/core": minor | ||
--- | ||
|
||
Add support for zooming image on move |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
- main | ||
|
||
jobs: | ||
test: | ||
verify: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -37,3 +37,19 @@ jobs: | |
|
||
- name: Test | ||
run: pnpm test:ci | ||
|
||
- name: Run prettier | ||
run: pnpm prettier-fix | ||
|
||
- name: Commit changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git diff --quiet && git diff --staged --quiet || (git commit -am "chore: format code with Prettier" --no-verify) | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.head_ref }} | ||
force: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# createZoomImageMove | ||
|
||
### Basic Usage | ||
|
||
```ts | ||
const { cleanup } = createZoomImageMove(container, { | ||
zoomImageSource: "large-image.webp", | ||
}) | ||
|
||
// Call cleanup when you don't need it anymore | ||
cleanup() | ||
``` | ||
|
||
### Type Declaration | ||
|
||
```ts | ||
type ZoomImageMoveOptions = { | ||
// Zoom scale, default is 4 | ||
zoomFactor?: number | ||
// The source of zoomed image, default is the same as the original image | ||
zoomImageSource?: string | ||
} | ||
|
||
function createZoomImageMove( | ||
container: HTMLElement, | ||
options?: ZoomImageMoveOptions, | ||
): { | ||
// Remove all event listeners and zoomed image | ||
cleanup: () => void | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# API Reference | ||
|
||
- [createZoomImageWheel](/api/createZoomImageWheel) | ||
- [createZoomImageMove](/api/createZoomImageMove) | ||
- [createZoomImageHover](/api/createZoomImageHover) | ||
- [makeCalculateZoom](/api/makeCalculateZoom) | ||
- [makeCalculatePercentage](/api/makeCalculatePercentage) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<div class="flex justify-center m-x-auto mt-4 px-6 sm:px-12"> | ||
<video class="rounded-4" muted autoplay loop playsinline> | ||
<source src="/demo.webm" type="video/webm" /> | ||
<source src="/demo.mp4" type="video/mp4" /> | ||
</video> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.