-
-
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.
Add zoom calculation utilities 🚀 (#37)
* docs: add basic documentation for zoom calculation utilities * chore: add changeset
- Loading branch information
1 parent
f25238c
commit fcbc00f
Showing
10 changed files
with
67 additions
and
12 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 zoom calculation utilities 🚀 |
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,18 @@ | ||
# createZoomImageWheel | ||
|
||
Calculate the current percentage based on the zoom level | ||
|
||
### Basic Usage | ||
|
||
```ts | ||
const calculatePercentage = makeCalculatePercentage(maxZoom) | ||
const currentPercentage = calculatePercentage(currentZoom) | ||
``` | ||
|
||
### Type Declaration | ||
|
||
```ts | ||
function makeCalculatePercentage = (maxZoom: number) => { | ||
return (currentZoom: number) => number | ||
} | ||
``` |
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,18 @@ | ||
# createZoomImageWheel | ||
|
||
Calculate the current zoom level based on the percentage | ||
|
||
### Basic Usage | ||
|
||
```ts | ||
const calculateZoom = makeCalculateZoom(percentage) | ||
const currentZoom = calculateZoom(currentZoom) | ||
``` | ||
|
||
### Type Declaration | ||
|
||
```ts | ||
function makeCalculateZoom = (maxZoom: number) => { | ||
return (percentage: number) => number | ||
} | ||
``` |
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 |
---|---|---|
@@ -1,11 +1,21 @@ | ||
// Start importing createZoomImageHover | ||
import { createZoomImageHover } from "./createZoomImageHover" | ||
import type { ZoomImageHoverOptions } from "./createZoomImageHover" | ||
|
||
export { createZoomImageHover } | ||
export type { ZoomImageHoverOptions } | ||
// End importing createZoomImageHover | ||
|
||
// Start importing createZoomImageWheel | ||
import { createZoomImageWheel } from "./createZoomImageWheel" | ||
import type { ZoomImageWheelOptions } from "./createZoomImageWheel" | ||
|
||
export { createZoomImageWheel } | ||
export type { ZoomImageWheelOptions } | ||
// End importing createZoomImageWheel | ||
|
||
// Start importing utils | ||
import { makeCalculatePercentage, makeCalculateZoom } from "./utils" | ||
|
||
export { makeCalculatePercentage, makeCalculateZoom } | ||
// Stop importing utils |
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