pixel-mirror 0.0.1
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 +49 -0
- package/dist/index.js +1806 -0
- package/package.json +68 -0
- package/plugins/vite.js +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Pixel Mirror
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Pixel Mirror is a lightweight tool for front-end developers that overlays design mockups on web pages. With features like adjustable transparency, scaling, alignment, and grid guides, it helps developers achieve pixel-perfect accuracy when implementing UI designs.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### 1. For Vite projects
|
|
10
|
+
|
|
11
|
+
Install the package via npm:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install pixel-mirror --save-dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then, add Pixel Mirror's Vite plugin to your `vite.config.js`:
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import pixelMirrorPlugin from "pixel-mirror/vite";
|
|
21
|
+
import { defineConfig } from "vite";
|
|
22
|
+
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
plugins: [pixelMirrorPlugin()],
|
|
25
|
+
// ... other configurations
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The plugin is automatically injected into your HTML during development and will be removed in production builds.
|
|
30
|
+
|
|
31
|
+
### 2. For other projects
|
|
32
|
+
|
|
33
|
+
If you're not using Vite, you can integrate Pixel Mirror by injecting its script file into your HTML, served via a CDN:
|
|
34
|
+
|
|
35
|
+
``` html
|
|
36
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/piexl-mirror/dist/index.js"></script>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This allows you to use Pixel Mirror out of the box without additional setup. Remember to remove the script in the production environment.
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
_Before using this tool, please note that it sets the `position` of the `:root` element to `relative`. This ensures overlays work correctly with minimal impact on the host project. Be sure to verify compatibility with your project before proceeding._
|
|
44
|
+
|
|
45
|
+
For an interactive usage example, please refer to https://peiwen.lu/posts/pixel-mirror.
|
|
46
|
+
|
|
47
|
+
## Credits
|
|
48
|
+
|
|
49
|
+
Icons by https://hugeicons.com
|