center-center 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/package.json +12 -9
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# center-center
|
|
2
|
+
|
|
3
|
+
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
|
|
4
|
+
|
|
5
|
+
The target is at the _center center_ of its container here:
|
|
6
|
+
|
|
7
|
+
<img alt="Top" src="docs/images/top.png" width="50%" />
|
|
8
|
+
|
|
9
|
+
And here:
|
|
10
|
+
|
|
11
|
+
<img alt="Middle" src="docs/images/middle.png" width="50%" />
|
|
12
|
+
|
|
13
|
+
And here:
|
|
14
|
+
|
|
15
|
+
<img alt="Bottom" src="docs/images/bottom.png" width="50%" />
|
|
16
|
+
|
|
17
|
+
The position of the vertically and horizontalled centered target element _changes_ according to how its container is located in the viewport
|
|
18
|
+
|
|
19
|
+
A demonstration can be found in [docs](docs/index.html)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "center-center",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Position an element at the center center of a container",
|
|
5
5
|
"main": "./index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -12,21 +12,24 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"lint": "cross-env NODE_ENV=production eslint . --ext .mjs,.cjs",
|
|
14
14
|
"lint:fix": "npm run lint -- --fix",
|
|
15
|
-
"test": "cross-env NODE_ENV=test mocha test --recursive"
|
|
15
|
+
"test": "cross-env NODE_ENV=test mocha test --recursive",
|
|
16
|
+
"prepare": "husky install"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
19
|
"debug": "^4.3.4"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
|
-
"@babel/cli": "^7.
|
|
22
|
-
"@babel/core": "^7.
|
|
23
|
-
"@babel/eslint-parser": "^7.
|
|
24
|
-
"@babel/preset-env": "^7.
|
|
25
|
-
"
|
|
26
|
-
"
|
|
22
|
+
"@babel/cli": "^7.23.9",
|
|
23
|
+
"@babel/core": "^7.23.9",
|
|
24
|
+
"@babel/eslint-parser": "^7.23.9",
|
|
25
|
+
"@babel/preset-env": "^7.23.9",
|
|
26
|
+
"@sequencemedia/hooks": "^1.0.475",
|
|
27
|
+
"chai": "^5.0.3",
|
|
28
|
+
"core-js": "^3.35.1",
|
|
27
29
|
"cross-env": "^7.0.3",
|
|
28
|
-
"eslint": "^8.
|
|
30
|
+
"eslint": "^8.56.0",
|
|
29
31
|
"eslint-config-standard": "^17.1.0",
|
|
32
|
+
"husky": "^9.0.6",
|
|
30
33
|
"mocha": "^10.2.0"
|
|
31
34
|
},
|
|
32
35
|
"imports": {
|