https://github.com/sequencemedia/center-center
For calculating the left and top position coordinates of a vertically and horizontalled centered target element within a container, according to the container's position in the viewport
https://github.com/sequencemedia/center-center
Last synced: about 1 year ago
JSON representation
For calculating the left and top position coordinates of a vertically and horizontalled centered target element within a container, according to the container's position in the viewport
- Host: GitHub
- URL: https://github.com/sequencemedia/center-center
- Owner: sequencemedia
- Created: 2024-01-23T19:30:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-07T02:03:39.000Z (about 1 year ago)
- Last Synced: 2025-05-07T03:43:14.709Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 979 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# center-center
For calculating the `left` and `top` position coordinates of a vertically and horizontalled centered _target_ element within a _container_ according to _the container_'s position in the viewport
The target is at the _center center_ of its container here:

And here:

And here:

The position of the vertically and horizontalled centered target element _changes_ according to how its container is located in the viewport
A demonstration can be found in [docs](docs/index.html)