diff --git a/examples/with-angular/src/app/app.component.html b/examples/with-angular/src/app/app.component.html index b5886cb6..a76d04c6 100644 --- a/examples/with-angular/src/app/app.component.html +++ b/examples/with-angular/src/app/app.component.html @@ -21,7 +21,7 @@

Current zoom: {{ getCurrentZoomImageValue() }}

- Large Pic + Large Pic
Cropped placeholder
@@ -37,7 +37,7 @@

Hover inside the image to see zoom effect

- Small Pic + Small Pic
@@ -45,14 +45,14 @@

Move mouse inside the image to see zoom effect

- Large Pic + Large Pic

Click inside the image to see zoom effect

- Large Pic + Large Pic
diff --git a/examples/with-angular/src/app/app.component.ts b/examples/with-angular/src/app/app.component.ts index e8068144..6fa45ae4 100644 --- a/examples/with-angular/src/app/app.component.ts +++ b/examples/with-angular/src/app/app.component.ts @@ -89,12 +89,11 @@ export class AppComponent implements AfterViewInit { this.zoomImageWheelService.createZoomImage(this.imageWheelContainerRef?.nativeElement as HTMLDivElement) this.zoomImageWheelService.zoomImageState$.subscribe((state) => { this.zoomImageWheelState = state - this.handleCropWheelZoomImage() }) }, hover: () => { this.zoomImageHoverService.createZoomImage(this.imageHoverContainerRef?.nativeElement as HTMLDivElement, { - zoomImageSource: "/sample.avif", + zoomImageSource: "/assets/sample.avif", customZoom: { width: 300, height: 500 }, zoomTarget: this.zoomTargetRef?.nativeElement as HTMLDivElement, scale: 2, @@ -105,7 +104,7 @@ export class AppComponent implements AfterViewInit { }, move: () => { this.zoomImageMoveService.createZoomImage(this.imageMoveContainerRef?.nativeElement as HTMLDivElement, { - zoomImageSource: "/sample.avif", + zoomImageSource: "/assets/sample.avif", }) this.zoomImageMoveService.zoomImageState$.subscribe((state) => { this.zoomImageMoveState = state @@ -113,7 +112,7 @@ export class AppComponent implements AfterViewInit { }, click: () => { this.zoomImageClickService.createZoomImage(this.imageClickContainerRef?.nativeElement as HTMLDivElement, { - zoomImageSource: "/sample.avif", + zoomImageSource: "/assets/sample.avif", }) this.zoomImageClickService.zoomImageState$.subscribe((state) => { this.zoomImageClickState = state @@ -132,8 +131,8 @@ export class AppComponent implements AfterViewInit { this.zoomImageWheelService.setZoomImageState({ currentZoom: this.zoomImageWheelState.currentZoom - 0.5 }) } - handleCropWheelZoomImage() { - this.croppedImage = cropImage({ + async handleCropWheelZoomImage() { + this.croppedImage = await cropImage({ currentZoom: this.zoomImageWheelState.currentZoom, image: (this.imageWheelContainerRef?.nativeElement as HTMLDivElement).querySelector("img") as HTMLImageElement, positionX: this.zoomImageWheelState.currentPositionX, diff --git a/examples/with-next/src/app/page.tsx b/examples/with-next/src/app/page.tsx index 91e23ca6..d638f570 100644 --- a/examples/with-next/src/app/page.tsx +++ b/examples/with-next/src/app/page.tsx @@ -36,9 +36,9 @@ export default function Home() { const { createZoomImage: createZoomImageMove } = useZoomImageMove() const { createZoomImage: createZoomImageClick } = useZoomImageClick() - function handleCropImage() { + async function handleCropImage() { setCroppedImage( - cropImage({ + await cropImage({ currentZoom: zoomImageWheelState.currentZoom, image: imageWheelContainerRef.current?.querySelector("img") as HTMLImageElement, positionX: zoomImageWheelState.currentPositionX, @@ -153,9 +153,9 @@ export default function Home() { {zoomType === "hover" && ( <>

Hover inside the image to see zoom effect

-
+
Small Pic -
+
)} diff --git a/examples/with-preact/package.json b/examples/with-preact/package.json index 88cb8198..17510d4a 100644 --- a/examples/with-preact/package.json +++ b/examples/with-preact/package.json @@ -14,6 +14,6 @@ "@unocss/reset": "^0.54.3", "typescript": "^5.1.6", "unocss": "^0.54.3", - "vite": "^4.4.9" + "vite": "^4.5.0" } } diff --git a/examples/with-preact/src/app.tsx b/examples/with-preact/src/app.tsx index 09bb94d1..857e25ce 100644 --- a/examples/with-preact/src/app.tsx +++ b/examples/with-preact/src/app.tsx @@ -34,9 +34,9 @@ function App() { const { createZoomImage: createZoomImageMove } = useZoomImageMove() const { createZoomImage: createZoomImageClick } = useZoomImageClick() - function handleCropImage() { + async function handleCropImage() { setCroppedImage( - cropImage({ + await cropImage({ currentZoom: zoomImageWheelState.currentZoom, image: imageWheelContainerRef.current?.querySelector("img") as HTMLImageElement, positionX: zoomImageWheelState.currentPositionX, @@ -151,9 +151,9 @@ function App() { {zoomType === "hover" && ( <>

Hover inside the image to see zoom effect

-
+
Small Pic -
+
)} diff --git a/examples/with-qwik/package.json b/examples/with-qwik/package.json index b793f806..48970595 100644 --- a/examples/with-qwik/package.json +++ b/examples/with-qwik/package.json @@ -13,7 +13,7 @@ "typescript": "5.1.6", "undici": "^5.23.0", "unocss": "^0.54.3", - "vite": "4.4.8", + "vite": "^4.5.0", "vite-tsconfig-paths": "4.2.0" }, "dependencies": { diff --git a/examples/with-qwik/src/routes/index.tsx b/examples/with-qwik/src/routes/index.tsx index c0e48315..ddf86d8b 100644 --- a/examples/with-qwik/src/routes/index.tsx +++ b/examples/with-qwik/src/routes/index.tsx @@ -47,7 +47,7 @@ export default component$(() => { if (zoomType.value === "hover" && imageHoverContainerRef.value) { const imageContainer = imageHoverContainerRef.value - const zoomTarget = zoomTargetRef.value + const zoomTarget = zoomTargetRef.value as HTMLDivElement createZoomImageHover(imageContainer, { zoomImageSource: "/sample.avif", customZoom: { width: 300, height: 500 }, @@ -137,8 +137,8 @@ export default component$(() => {