Skip to content

Commit

Permalink
make changes to package.json to publish correctly to npm, add info to…
Browse files Browse the repository at this point in the history
… readme
  • Loading branch information
luis-pato committed Dec 11, 2021
1 parent 6012a20 commit 29d86cf
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 14 deletions.
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# geometric-paint-worklet
A customisable CSS Paint Worklet that renders geometric figures to the background of any element
A customizable CSS Paint Worklet that renders geometric figures to the background of any element

![Example with large thin borders](images/site_capture.gif)

Expand All @@ -25,20 +25,35 @@ CSS Paint Worklets are part of the CSS Paint API (also known as “CSS Custom Pa
---

## 📦 2. How to use
1. Copy the `dist/geomatric-paint-worklet.js` file into your project
2. Add the paint worklet module to your index.html:

> ℹ️ If you want to use a CDN, skip steps 1 and 2 and instead add `<script scr="https://unpkg.com/geometric-paint-worklet"></script>` to your index.html
1. You can get the worklet js file from one of the following methods:

1.1. Copy the `dist/geomatric-paint-worklet.js` file into your project

1.2. Install with npm `npm install geometric-paint-worklet`

2. Import the worklet file on your index.html head:
```html
<script src="node_modules/geometric-paint-worklet/dist/geometric-paint-worklet.js"></script>
```

3. Add the paint worklet module to your index.html:
```html
<script>
CSS.paintWorklet.addModule('PATH_TO_YOUR_FILE/geometric-paint-worklet.js');
CSS.paintWorklet.addModule('node_modules/geometric-paint-worklet/dist/geometric-paint-worklet.js');
</script>
```
3. Use the GeometricPaintWorklet on any Element. Ex:

4. Use the GeometricPaintWorklet on any Element. Ex:
```css
.my-element {
background-image: paint(geometricPaintWorklet);
}
```
4. Customize it to your needs using custom CSS Variables (see below)

5. Customize it to your needs using custom CSS Variables (see below)

---

Expand Down
Binary file removed img.png
Binary file not shown.
Binary file removed img_1.png
Binary file not shown.
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "@toujou/geometric-paint-worklet",
"version": "1.0.0",
"description": "An customisable CSS Paint Worklet that renders geometric figures to the background of any element",
"main": "index.html",
"name": "geometric-paint-worklet",
"version": "1.0.2",
"description": "A customizable CSS Paint Worklet that renders geometric figures to the background of any element",
"main": "dist/geometric-paint-worklet.js",
"files": [
"dist/*.js"
],
"scripts": {
"build:js": "esbuild src/geometric-paint-worklet.ts --bundle --outfile=dist/geometric-paint-worklet.js --format=cjs",
"build:js:dev": "esbuild src/geometric-paint-worklet.ts --bundle --outfile=dist/geometric-paint-worklet.js --format=cjs --watch"
Expand All @@ -11,13 +14,18 @@
"type": "git",
"url": "git+https://github.com/boguz/geometric-paint-worklet.git"
},
"keywords": ["CSS Paint", "CSS Houdini", "CSS Paint Worklet", "Worklet"],
"keywords": [
"CSS Paint",
"CSS Houdini",
"CSS Paint Worklet",
"Worklet"
],
"author": "LuisPato",
"license": "MIT",
"bugs": {
"url": "https://github.com/boguz/geometric-paint-worklet/issues"
},
"homepage": "https://github.com/boguz/geometric-paint-worklet#readme",
"homepage": "https://boguz.github.io/geometric-paint-worklet/",
"devDependencies": {
"esbuild": "^0.14.2"
}
Expand Down

0 comments on commit 29d86cf

Please sign in to comment.