create-signature 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 ADDED
@@ -0,0 +1,23 @@
1
+ # create-signature
2
+
3
+ Initializer for web-signature.
4
+
5
+ # Usage
6
+
7
+ ```bash
8
+ npm create signature@latest
9
+ ```
10
+
11
+ Or
12
+
13
+ ```bash
14
+ bun create signature@latest
15
+ ```
16
+
17
+ ## Templates
18
+
19
+ | Name | Description |
20
+ |------------|----------------------------------------|
21
+ | Vanilla JS | A basic JavaScript template. |
22
+ | Vite + JS | A template using Vite with JavaScript. |
23
+ | Vite + TS | A template using Vite with TypeScript. |
package/bun.lock ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "lockfileVersion": 1,
3
+ "workspaces": {
4
+ "": {
5
+ "name": "create-signature",
6
+ "dependencies": {
7
+ "prompts": "^2.4.2",
8
+ "qp-color": "^0.0.3",
9
+ },
10
+ },
11
+ },
12
+ "packages": {
13
+ "kleur": ["kleur@3.0.3", "", {}, "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w=="],
14
+
15
+ "prompts": ["prompts@2.4.2", "", { "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" } }, "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q=="],
16
+
17
+ "qp-color": ["qp-color@0.0.3", "", {}, "sha512-4g5QA48tp/w7mAqsKVeJYHyCnE3qYGWU3DH9zE1zfk4RY+smUuZu03EYKi/lpT9kpkNt5ncKq6oP/4nRQlyy8w=="],
18
+
19
+ "sisteransi": ["sisteransi@1.0.5", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="],
20
+ }
21
+ }
package/index.js ADDED
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const prompt = require("prompts");
6
+ const qp = require("qp-color");
7
+
8
+ function copyTemplate(from, to, hooks) {
9
+ if (!fs.existsSync(from)) {
10
+ throw new Error(`Template directory does not exist: ${from}`);
11
+ }
12
+
13
+ if (!fs.existsSync(to)) {
14
+ fs.mkdirSync(to, {recursive: true});
15
+ }
16
+
17
+ const files = fs.readdirSync(from);
18
+
19
+ files.forEach(file => {
20
+ const srcPath = path.join(from, file);
21
+ const destPath = path.join(to, file);
22
+
23
+ if (fs.statSync(srcPath).isDirectory()) {
24
+ fs.mkdirSync(destPath, {recursive: true});
25
+ copyTemplate(srcPath, destPath, hooks);
26
+ } else {
27
+ let content = fs.readFileSync(srcPath, "utf8");
28
+ if (hooks) {
29
+ hooks.filter(hook => hook.file === file).forEach(hook => {
30
+ content = hook.fn(content);
31
+ });
32
+ }
33
+ fs.writeFileSync(destPath, content);
34
+ }
35
+ });
36
+ }
37
+
38
+ function clearDirectory(dir) {
39
+ if (fs.existsSync(dir)) {
40
+ fs.readdirSync(dir).forEach(file => {
41
+ const filePath = path.join(dir, file);
42
+ if (fs.statSync(filePath).isDirectory()) {
43
+ clearDirectory(filePath);
44
+ fs.rmdirSync(filePath);
45
+ } else {
46
+ fs.unlinkSync(filePath);
47
+ }
48
+ });
49
+ }
50
+ }
51
+
52
+ try {
53
+ let src;
54
+
55
+ if (process.argv[2]) {
56
+ src = path.resolve(process.cwd(), process.argv[2]);
57
+ } else {
58
+ src = path.resolve(process.cwd());
59
+ }
60
+
61
+ if (!(fs.existsSync(src) && fs.statSync(src).isDirectory())) {
62
+ throw {id: "path-doest-exist", src: src};
63
+ }
64
+
65
+ (async () => {
66
+ if (fs.readdirSync(src).length > 0) {
67
+ const confirm = (await prompt({
68
+ type: "confirm",
69
+ name: "confirm",
70
+ message: qp.wb("The directory is not empty. Do you want to clear directory?"),
71
+ initial: false
72
+ })).confirm;
73
+
74
+ if (!confirm) {
75
+ console.log(qp.rb("The process was stopped..."));
76
+ return;
77
+ } else {
78
+ console.log(qp.yb("Cleaning the directory..."));
79
+
80
+ clearDirectory(src);
81
+ }
82
+ }
83
+
84
+ const name = path.basename(src);
85
+
86
+ let type = (await prompt({
87
+ type: "select",
88
+ name: "type",
89
+ message: qp.gb("Choose a template:"),
90
+ choices: [
91
+ {title: "Vanilla JS", value: "js", description: "A basic JavaScript template."},
92
+ {
93
+ title: "Vite + JS",
94
+ value: "vite-js",
95
+ description: "A template using Vite with JavaScript.",
96
+ default: true
97
+ },
98
+ {title: "Vite + TS", value: "vite-ts", description: "A template using Vite with TypeScript."}
99
+ ]
100
+ })).type;
101
+
102
+ if (typeof type === "string") {
103
+ if (fs.existsSync(path.join(__dirname, "templates", type))) {
104
+ console.log(qp.yb(`Initializing the project...`));
105
+ copyTemplate(path.join(__dirname, "templates", type), src, [
106
+ {
107
+ file: "package.json",
108
+ fn: content => content.replace("#name", name)
109
+ }
110
+ ]);
111
+ console.log(qp.gb("The project was created!"));
112
+ console.log("\n");
113
+ console.log("Now run:\n");
114
+ if (path.resolve("./") !== src) {
115
+ console.log(qp.wb(` cd ` + path.basename(src)));
116
+ }
117
+ console.log(` ${qp.wb("npm install")}\t\tOr\t\t${qp.wb("bun install")}`);
118
+ console.log(` ${qp.wb("npm run dev")}\t\tOr\t\t${qp.wb("bun run dev")}`);
119
+ console.log("\n");
120
+ } else {
121
+ console.log(qp.rb(`Error: The specified template does not exist.\n\t${src}\n\tTemplate: ${type}`));
122
+ }
123
+ } else {
124
+ console.log(qp.rb("The process was stopped..."));
125
+ }
126
+ })();
127
+ } catch (err) {
128
+ switch (err.id) {
129
+ case "stop":
130
+ console.log(qp.rb("The process was stopped..."));
131
+ break;
132
+ case "path-doest-exist":
133
+ console.log(qp.rb(`Error: The specified path does not exist.\n\t${err.src}`));
134
+ break;
135
+ case "template-doest-exist":
136
+ console.log(qp.rb(`Error: The specified template does not exist.\n\t${err.src}\n\tTemplate: ${err.template}`));
137
+ break;
138
+ default:
139
+ console.log(qp.rb(`Error: An unexpected error occurred.\n\t${err.toString()}`));
140
+ break;
141
+ }
142
+
143
+ process.exit(0);
144
+ }
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "create-signature",
3
+ "version": "0.0.1",
4
+ "description": "Initializer for web-signature.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "github.com/Pinbib/signature"
8
+ },
9
+ "license": "ISC",
10
+ "author": "PinBib",
11
+ "type": "commonjs",
12
+ "scripts": {},
13
+ "dependencies": {
14
+ "prompts": "^2.4.2",
15
+ "qp-color": "^0.0.3"
16
+ },
17
+ "bin": {
18
+ "create": "./index.js",
19
+ "init": "./index.js"
20
+ },
21
+ "bun-create": {
22
+ "start": "bun run index.js"
23
+ }
24
+ }
@@ -0,0 +1,99 @@
1
+ :root {
2
+ font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 1.5;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ a {
17
+ font-weight: 500;
18
+ color: #646cff;
19
+ text-decoration: inherit;
20
+ }
21
+
22
+ a:hover {
23
+ color: #535bf2;
24
+ }
25
+
26
+ body {
27
+ margin: 0;
28
+ display: flex;
29
+ place-items: center;
30
+ min-width: 320px;
31
+ min-height: 100vh;
32
+ }
33
+
34
+ h1 {
35
+ font-size: 3.2em;
36
+ line-height: 1.1;
37
+ }
38
+
39
+ #app {
40
+ max-width: 1280px;
41
+ margin: 0 auto;
42
+ padding: 2rem;
43
+ text-align: center;
44
+ }
45
+
46
+ .logo {
47
+ height: 6em;
48
+ padding: 1.5em;
49
+ will-change: filter;
50
+ transition: filter 300ms;
51
+ }
52
+
53
+ .logo:hover {
54
+ filter: drop-shadow(0 0 2em #2196F3);
55
+ }
56
+
57
+ .card {
58
+ padding: 2em;
59
+ }
60
+
61
+ .read-the-docs {
62
+ color: #888;
63
+ }
64
+
65
+ button {
66
+ border-radius: 8px;
67
+ border: 1px solid transparent;
68
+ padding: 0.6em 1.2em;
69
+ font-size: 1em;
70
+ font-weight: 500;
71
+ font-family: inherit;
72
+ background-color: #1a1a1a;
73
+ cursor: pointer;
74
+ transition: border-color 0.25s;
75
+ }
76
+
77
+ button:hover {
78
+ border-color: #646cff;
79
+ }
80
+
81
+ button:focus,
82
+ button:focus-visible {
83
+ outline: 4px auto -webkit-focus-ring-color;
84
+ }
85
+
86
+ @media (prefers-color-scheme: light) {
87
+ :root {
88
+ color: #213547;
89
+ background-color: #ffffff;
90
+ }
91
+
92
+ a:hover {
93
+ color: #747bff;
94
+ }
95
+
96
+ button {
97
+ background-color: #f9f9f9;
98
+ }
99
+ }
@@ -0,0 +1,31 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8"/>
6
+ <link href="./public/signature.svg" rel="icon" type="image/svg+xml"/>
7
+ <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
8
+ <script src="https://unpkg.com/web-signature@0.1.8/bundle/index.js" type="module"></script>
9
+ <link href="./css/style.css" rel="stylesheet">
10
+ <title>Signature</title>
11
+ </head>
12
+
13
+ <body>
14
+ <div id="app">
15
+ <div>
16
+ <a href="https://github.com/Pinbib/signature" target="_blank">
17
+ <img alt="Signature logo" class="logo" src="./public/signature.svg"/>
18
+ </a>
19
+ <h1>Signature</h1>
20
+ <div class="card">
21
+ <Counter ref/>
22
+ </div>
23
+ <p class="read-the-docs">
24
+ Click on the logos to learn more
25
+ </p>
26
+ </div>
27
+ </div>
28
+ <script src="./js/main.js" type="module"></script>
29
+ </body>
30
+
31
+ </html>
@@ -0,0 +1,18 @@
1
+ import { Component } from "https://unpkg.com/web-signature@0.1.8/bundle/index.min.js";
2
+
3
+ export default class Counter extends Component {
4
+ name = "Counter";
5
+
6
+ count = 0;
7
+
8
+ render() {
9
+ return `<button id="button" type="button">count is ${this.count}</button>`;
10
+ }
11
+
12
+ onMount(el) {
13
+ el.addEventListener("click", () => {
14
+ this.count++;
15
+ this.ref?.update();
16
+ });
17
+ }
18
+ }
@@ -0,0 +1,9 @@
1
+ import { Signature } from "https://unpkg.com/web-signature@0.1.8/bundle/index.min.js";
2
+
3
+ import Counter from "./components/Counter.js";
4
+
5
+ let si = new Signature();
6
+
7
+ si.add(Counter);
8
+
9
+ si.contact("#app");
@@ -0,0 +1,10 @@
1
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_35_2)">
3
+ <path d="M8.636 28.7C8.228 28.5867 7.89933 28.4847 7.65 28.394C7.40067 28.326 7.276 28.292 7.276 28.292C7.32133 28.1787 7.29867 28.0767 7.208 27.986C7.14 27.8953 6.98133 27.8387 6.732 27.816C6.392 27.612 6.07467 27.3513 5.78 27.034C5.508 26.7393 5.28133 26.4447 5.1 26.15C4.91867 25.8553 4.78267 25.606 4.692 25.402C4.53333 25.062 4.454 24.858 4.454 24.79C4.47667 24.6993 4.61267 24.5973 4.862 24.484C5.11133 24.3027 5.29267 24.246 5.406 24.314C5.542 24.382 5.70067 24.6087 5.882 24.994C6.17667 25.5153 6.67533 25.912 7.378 26.184C8.10333 26.456 8.908 26.5807 9.792 26.558C10.6987 26.5127 11.56 26.3087 12.376 25.946C13.2147 25.606 13.736 25.2547 13.94 24.892C14.1667 24.5067 14.0873 24.0193 13.702 23.43C13.634 23.2487 13.5547 23.1013 13.464 22.988C13.3733 22.8747 13.226 22.7273 13.022 22.546C12.8407 22.3647 12.5347 22.07 12.104 21.662C11.764 21.5033 11.4467 21.356 11.152 21.22C10.88 21.084 10.5853 20.9367 10.268 20.778C9.90533 20.5967 9.46333 20.336 8.942 19.996C8.44333 19.6333 7.96733 19.2367 7.514 18.806C7.06067 18.3753 6.732 17.9787 6.528 17.616C6.16533 17.276 5.89333 16.8113 5.712 16.222C5.53067 15.61 5.46267 14.964 5.508 14.284C5.55333 13.604 5.72333 12.992 6.018 12.448C6.154 12.1307 6.38067 11.7453 6.698 11.292C7.038 10.816 7.412 10.34 7.82 9.864C8.228 9.388 8.62467 8.95733 9.01 8.572C9.39533 8.18667 9.71267 7.91467 9.962 7.756C10.1433 7.57467 10.336 7.39333 10.54 7.212C10.744 7.008 10.846 6.906 10.846 6.906C10.8687 6.79267 10.9027 6.736 10.948 6.736C11.016 6.736 11.05 6.736 11.05 6.736C11.1633 6.668 11.4127 6.55467 11.798 6.396C12.1833 6.23733 12.6027 5.94267 13.056 5.512C14.5747 4.78667 15.81 4.254 16.762 3.914C17.714 3.574 18.496 3.404 19.108 3.404C19.6747 3.42667 20.1847 3.56267 20.638 3.812C21.114 4.03867 21.4993 4.34467 21.794 4.73C22.1113 5.11533 22.304 5.58 22.372 6.124C22.5307 6.668 22.4853 7.30267 22.236 8.028C21.9867 8.73067 21.6127 9.39933 21.114 10.034C20.638 10.646 20.1167 11.1107 19.55 11.428C18.9153 11.7 18.4847 11.8247 18.258 11.802C18.054 11.7567 17.9633 11.5187 17.986 11.088C17.986 10.9067 18.0427 10.6913 18.156 10.442C18.292 10.1927 18.6433 9.75067 19.21 9.116C19.9353 8.05067 20.3773 7.20067 20.536 6.566C20.6947 5.93133 20.5473 5.58 20.094 5.512C19.958 5.46667 19.7087 5.46667 19.346 5.512C19.006 5.55733 18.6207 5.62533 18.19 5.716C17.782 5.784 17.4307 5.86333 17.136 5.954C16.8413 6.022 16.694 6.07867 16.694 6.124C16.694 6.124 16.694 6.158 16.694 6.226C16.694 6.294 16.6487 6.31667 16.558 6.294C16.5127 6.294 16.32 6.38467 15.98 6.566C15.64 6.74733 15.232 6.98533 14.756 7.28C14.28 7.57467 13.804 7.86933 13.328 8.164C12.852 8.45867 12.444 8.71933 12.104 8.946C11.7867 9.15 11.6167 9.27467 11.594 9.32C11.5487 9.56933 11.288 9.796 10.812 10C10.3587 10.272 9.93933 10.6687 9.554 11.19C9.19133 11.7113 8.78333 12.3573 8.33 13.128C7.94467 13.6493 7.67267 14.216 7.514 14.828C7.35533 15.4173 7.35533 15.8933 7.514 16.256C7.62733 16.6187 7.97867 17.0833 8.568 17.65C9.15733 18.2167 9.894 18.7607 10.778 19.282C11.5487 19.7127 12.24 20.1433 12.852 20.574C13.464 20.982 13.9627 21.3787 14.348 21.764C14.756 22.1493 15.028 22.4893 15.164 22.784C15.436 23.1693 15.6287 23.566 15.742 23.974C15.878 24.3593 15.946 24.7333 15.946 25.096C15.9687 25.4587 15.9347 25.7873 15.844 26.082C15.6853 26.4447 15.402 26.8187 14.994 27.204C14.6087 27.5893 14.28 27.7707 14.008 27.748C13.7587 27.816 13.566 27.8953 13.43 27.986C13.3167 28.0767 13.1807 28.156 13.022 28.224C12.8633 28.3147 12.5233 28.4053 12.002 28.496C11.5033 28.5867 10.948 28.6433 10.336 28.666C9.724 28.7113 9.15733 28.7227 8.636 28.7ZM20.9732 25.912C20.7919 25.7307 20.6559 25.504 20.5652 25.232C20.4972 24.96 20.4746 24.688 20.4972 24.416C20.5199 24.144 20.5766 23.9173 20.6672 23.736C20.6672 23.5547 20.6899 23.4187 20.7352 23.328C20.8032 23.2147 20.8259 23.1127 20.8032 23.022C20.7806 22.9313 20.8032 22.7727 20.8712 22.546C20.9392 22.3193 21.0072 22.104 21.0752 21.9C21.2339 21.5373 21.4039 21.1067 21.5852 20.608C21.7666 20.0867 21.9366 19.5767 22.0952 19.078C22.2539 18.5793 22.3899 18.1487 22.5032 17.786C22.6166 17.4233 22.6846 17.1967 22.7072 17.106C22.7072 16.834 22.8886 16.6867 23.2512 16.664C23.5232 16.5733 23.7272 16.5733 23.8632 16.664C23.9992 16.732 24.1806 16.9473 24.4072 17.31C24.5886 17.4913 24.6566 17.7633 24.6112 18.126C24.5659 18.4887 24.4186 18.942 24.1692 19.486C24.0786 19.6673 23.9652 19.928 23.8292 20.268C23.7159 20.608 23.6366 20.914 23.5912 21.186C23.5006 21.3673 23.3872 21.628 23.2512 21.968C23.1379 22.2853 23.0359 22.5913 22.9452 22.886C22.8999 22.9993 22.8546 23.1693 22.8092 23.396C22.7639 23.6 22.7072 23.8267 22.6392 24.076C22.5712 24.3027 22.4806 24.5067 22.3672 24.688C22.1632 25.6173 21.9706 26.1613 21.7892 26.32C21.6306 26.4787 21.3586 26.3427 20.9732 25.912ZM24.2712 12.108C24.1579 11.9947 24.0559 11.836 23.9652 11.632C23.8746 11.4053 23.8179 11.2013 23.7952 11.02C23.7726 10.816 23.7952 10.714 23.8632 10.714C24.0446 10.6913 24.2599 10.4987 24.5092 10.136C24.7586 9.77333 24.8606 9.456 24.8152 9.184C24.8152 9.09333 24.8492 9.014 24.9172 8.946C24.9852 8.85533 25.0646 8.79867 25.1552 8.776C25.4272 8.59467 25.6879 8.572 25.9372 8.708C26.2092 8.82133 26.4586 9.05933 26.6852 9.422C26.8892 9.85267 26.9459 10.2153 26.8552 10.51C26.7646 10.782 26.5152 11.1673 26.1072 11.666C25.7672 12.1193 25.4499 12.3687 25.1552 12.414C24.8832 12.4593 24.5886 12.3573 24.2712 12.108Z" fill="#2196F3"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_35_2">
7
+ <rect width="32" height="32" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1,32 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8"/>
6
+ <link href="/vite.svg" rel="icon" type="image/svg+xml"/>
7
+ <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
8
+ <title>Vite + Signature</title>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app">
13
+ <div>
14
+ <a href="https://vite.dev" target="_blank">
15
+ <img alt="Vite logo" class="logo" src="/vite.svg"/>
16
+ </a>
17
+ <a href="https://github.com/Pinbib/signature" target="_blank">
18
+ <img alt="Signature logo" class="logo vanilla" src="/signature.svg"/>
19
+ </a>
20
+ <h1>Hello Vite!</h1>
21
+ <div class="card">
22
+ <Counter ref/>
23
+ </div>
24
+ <p class="read-the-docs">
25
+ Click on the Vite logo to learn more
26
+ </p>
27
+ </div>
28
+ </div>
29
+ <script src="/src/main.js" type="module"></script>
30
+ </body>
31
+
32
+ </html>
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "#name",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "devDependencies": {
12
+ "vite": "^7.0.4",
13
+ "vite-signature": "^0.0.4"
14
+ },
15
+ "dependencies": {
16
+ "web-signature": "^0.1.8"
17
+ }
18
+ }
@@ -0,0 +1,10 @@
1
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_35_2)">
3
+ <path d="M8.636 28.7C8.228 28.5867 7.89933 28.4847 7.65 28.394C7.40067 28.326 7.276 28.292 7.276 28.292C7.32133 28.1787 7.29867 28.0767 7.208 27.986C7.14 27.8953 6.98133 27.8387 6.732 27.816C6.392 27.612 6.07467 27.3513 5.78 27.034C5.508 26.7393 5.28133 26.4447 5.1 26.15C4.91867 25.8553 4.78267 25.606 4.692 25.402C4.53333 25.062 4.454 24.858 4.454 24.79C4.47667 24.6993 4.61267 24.5973 4.862 24.484C5.11133 24.3027 5.29267 24.246 5.406 24.314C5.542 24.382 5.70067 24.6087 5.882 24.994C6.17667 25.5153 6.67533 25.912 7.378 26.184C8.10333 26.456 8.908 26.5807 9.792 26.558C10.6987 26.5127 11.56 26.3087 12.376 25.946C13.2147 25.606 13.736 25.2547 13.94 24.892C14.1667 24.5067 14.0873 24.0193 13.702 23.43C13.634 23.2487 13.5547 23.1013 13.464 22.988C13.3733 22.8747 13.226 22.7273 13.022 22.546C12.8407 22.3647 12.5347 22.07 12.104 21.662C11.764 21.5033 11.4467 21.356 11.152 21.22C10.88 21.084 10.5853 20.9367 10.268 20.778C9.90533 20.5967 9.46333 20.336 8.942 19.996C8.44333 19.6333 7.96733 19.2367 7.514 18.806C7.06067 18.3753 6.732 17.9787 6.528 17.616C6.16533 17.276 5.89333 16.8113 5.712 16.222C5.53067 15.61 5.46267 14.964 5.508 14.284C5.55333 13.604 5.72333 12.992 6.018 12.448C6.154 12.1307 6.38067 11.7453 6.698 11.292C7.038 10.816 7.412 10.34 7.82 9.864C8.228 9.388 8.62467 8.95733 9.01 8.572C9.39533 8.18667 9.71267 7.91467 9.962 7.756C10.1433 7.57467 10.336 7.39333 10.54 7.212C10.744 7.008 10.846 6.906 10.846 6.906C10.8687 6.79267 10.9027 6.736 10.948 6.736C11.016 6.736 11.05 6.736 11.05 6.736C11.1633 6.668 11.4127 6.55467 11.798 6.396C12.1833 6.23733 12.6027 5.94267 13.056 5.512C14.5747 4.78667 15.81 4.254 16.762 3.914C17.714 3.574 18.496 3.404 19.108 3.404C19.6747 3.42667 20.1847 3.56267 20.638 3.812C21.114 4.03867 21.4993 4.34467 21.794 4.73C22.1113 5.11533 22.304 5.58 22.372 6.124C22.5307 6.668 22.4853 7.30267 22.236 8.028C21.9867 8.73067 21.6127 9.39933 21.114 10.034C20.638 10.646 20.1167 11.1107 19.55 11.428C18.9153 11.7 18.4847 11.8247 18.258 11.802C18.054 11.7567 17.9633 11.5187 17.986 11.088C17.986 10.9067 18.0427 10.6913 18.156 10.442C18.292 10.1927 18.6433 9.75067 19.21 9.116C19.9353 8.05067 20.3773 7.20067 20.536 6.566C20.6947 5.93133 20.5473 5.58 20.094 5.512C19.958 5.46667 19.7087 5.46667 19.346 5.512C19.006 5.55733 18.6207 5.62533 18.19 5.716C17.782 5.784 17.4307 5.86333 17.136 5.954C16.8413 6.022 16.694 6.07867 16.694 6.124C16.694 6.124 16.694 6.158 16.694 6.226C16.694 6.294 16.6487 6.31667 16.558 6.294C16.5127 6.294 16.32 6.38467 15.98 6.566C15.64 6.74733 15.232 6.98533 14.756 7.28C14.28 7.57467 13.804 7.86933 13.328 8.164C12.852 8.45867 12.444 8.71933 12.104 8.946C11.7867 9.15 11.6167 9.27467 11.594 9.32C11.5487 9.56933 11.288 9.796 10.812 10C10.3587 10.272 9.93933 10.6687 9.554 11.19C9.19133 11.7113 8.78333 12.3573 8.33 13.128C7.94467 13.6493 7.67267 14.216 7.514 14.828C7.35533 15.4173 7.35533 15.8933 7.514 16.256C7.62733 16.6187 7.97867 17.0833 8.568 17.65C9.15733 18.2167 9.894 18.7607 10.778 19.282C11.5487 19.7127 12.24 20.1433 12.852 20.574C13.464 20.982 13.9627 21.3787 14.348 21.764C14.756 22.1493 15.028 22.4893 15.164 22.784C15.436 23.1693 15.6287 23.566 15.742 23.974C15.878 24.3593 15.946 24.7333 15.946 25.096C15.9687 25.4587 15.9347 25.7873 15.844 26.082C15.6853 26.4447 15.402 26.8187 14.994 27.204C14.6087 27.5893 14.28 27.7707 14.008 27.748C13.7587 27.816 13.566 27.8953 13.43 27.986C13.3167 28.0767 13.1807 28.156 13.022 28.224C12.8633 28.3147 12.5233 28.4053 12.002 28.496C11.5033 28.5867 10.948 28.6433 10.336 28.666C9.724 28.7113 9.15733 28.7227 8.636 28.7ZM20.9732 25.912C20.7919 25.7307 20.6559 25.504 20.5652 25.232C20.4972 24.96 20.4746 24.688 20.4972 24.416C20.5199 24.144 20.5766 23.9173 20.6672 23.736C20.6672 23.5547 20.6899 23.4187 20.7352 23.328C20.8032 23.2147 20.8259 23.1127 20.8032 23.022C20.7806 22.9313 20.8032 22.7727 20.8712 22.546C20.9392 22.3193 21.0072 22.104 21.0752 21.9C21.2339 21.5373 21.4039 21.1067 21.5852 20.608C21.7666 20.0867 21.9366 19.5767 22.0952 19.078C22.2539 18.5793 22.3899 18.1487 22.5032 17.786C22.6166 17.4233 22.6846 17.1967 22.7072 17.106C22.7072 16.834 22.8886 16.6867 23.2512 16.664C23.5232 16.5733 23.7272 16.5733 23.8632 16.664C23.9992 16.732 24.1806 16.9473 24.4072 17.31C24.5886 17.4913 24.6566 17.7633 24.6112 18.126C24.5659 18.4887 24.4186 18.942 24.1692 19.486C24.0786 19.6673 23.9652 19.928 23.8292 20.268C23.7159 20.608 23.6366 20.914 23.5912 21.186C23.5006 21.3673 23.3872 21.628 23.2512 21.968C23.1379 22.2853 23.0359 22.5913 22.9452 22.886C22.8999 22.9993 22.8546 23.1693 22.8092 23.396C22.7639 23.6 22.7072 23.8267 22.6392 24.076C22.5712 24.3027 22.4806 24.5067 22.3672 24.688C22.1632 25.6173 21.9706 26.1613 21.7892 26.32C21.6306 26.4787 21.3586 26.3427 20.9732 25.912ZM24.2712 12.108C24.1579 11.9947 24.0559 11.836 23.9652 11.632C23.8746 11.4053 23.8179 11.2013 23.7952 11.02C23.7726 10.816 23.7952 10.714 23.8632 10.714C24.0446 10.6913 24.2599 10.4987 24.5092 10.136C24.7586 9.77333 24.8606 9.456 24.8152 9.184C24.8152 9.09333 24.8492 9.014 24.9172 8.946C24.9852 8.85533 25.0646 8.79867 25.1552 8.776C25.4272 8.59467 25.6879 8.572 25.9372 8.708C26.2092 8.82133 26.4586 9.05933 26.6852 9.422C26.8892 9.85267 26.9459 10.2153 26.8552 10.51C26.7646 10.782 26.5152 11.1673 26.1072 11.666C25.7672 12.1193 25.4499 12.3687 25.1552 12.414C24.8832 12.4593 24.5886 12.3573 24.2712 12.108Z" fill="#2196F3"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_35_2">
7
+ <rect width="32" height="32" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,18 @@
1
+ import { Component } from "web-signature";
2
+
3
+ export default class Counter extends Component {
4
+ name = "Counter";
5
+
6
+ count = 0;
7
+
8
+ render() {
9
+ return `<button id="button" type="button">count is ${this.count}</button>`;
10
+ }
11
+
12
+ onMount(el) {
13
+ el.addEventListener("click", () => {
14
+ this.count++;
15
+ this.ref.update();
16
+ });
17
+ }
18
+ }
@@ -0,0 +1,10 @@
1
+ import { Signature } from 'web-signature';
2
+
3
+ import './style.css';
4
+ import Counter from './components/Counter';
5
+
6
+ const si = new Signature();
7
+
8
+ si.add(Counter);
9
+
10
+ si.contact("#app");
@@ -0,0 +1,103 @@
1
+ :root {
2
+ font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 1.5;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ a {
17
+ font-weight: 500;
18
+ color: #646cff;
19
+ text-decoration: inherit;
20
+ }
21
+
22
+ a:hover {
23
+ color: #535bf2;
24
+ }
25
+
26
+ body {
27
+ margin: 0;
28
+ display: flex;
29
+ place-items: center;
30
+ min-width: 320px;
31
+ min-height: 100vh;
32
+ }
33
+
34
+ h1 {
35
+ font-size: 3.2em;
36
+ line-height: 1.1;
37
+ }
38
+
39
+ #app {
40
+ max-width: 1280px;
41
+ margin: 0 auto;
42
+ padding: 2rem;
43
+ text-align: center;
44
+ }
45
+
46
+ .logo {
47
+ height: 6em;
48
+ padding: 1.5em;
49
+ will-change: filter;
50
+ transition: filter 300ms;
51
+ }
52
+
53
+ .logo:hover {
54
+ filter: drop-shadow(0 0 2em #646cffaa);
55
+ }
56
+
57
+ .logo.vanilla:hover {
58
+ filter: drop-shadow(0 0 2em #2196F3);
59
+ }
60
+
61
+ .card {
62
+ padding: 2em;
63
+ }
64
+
65
+ .read-the-docs {
66
+ color: #888;
67
+ }
68
+
69
+ button {
70
+ border-radius: 8px;
71
+ border: 1px solid transparent;
72
+ padding: 0.6em 1.2em;
73
+ font-size: 1em;
74
+ font-weight: 500;
75
+ font-family: inherit;
76
+ background-color: #1a1a1a;
77
+ cursor: pointer;
78
+ transition: border-color 0.25s;
79
+ }
80
+
81
+ button:hover {
82
+ border-color: #646cff;
83
+ }
84
+
85
+ button:focus,
86
+ button:focus-visible {
87
+ outline: 4px auto -webkit-focus-ring-color;
88
+ }
89
+
90
+ @media (prefers-color-scheme: light) {
91
+ :root {
92
+ color: #213547;
93
+ background-color: #ffffff;
94
+ }
95
+
96
+ a:hover {
97
+ color: #747bff;
98
+ }
99
+
100
+ button {
101
+ background-color: #f9f9f9;
102
+ }
103
+ }
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'vite';
2
+ import Signature from 'vite-signature';
3
+
4
+ export default defineConfig({
5
+ plugins: [
6
+ Signature()
7
+ ]
8
+ })
@@ -0,0 +1,35 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+ <title>Vite + TS + Signature</title>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app">
13
+ <div>
14
+ <a href="https://vite.dev" target="_blank">
15
+ <img src="/vite.svg" class="logo" alt="Vite logo" />
16
+ </a>
17
+ <a href="https://www.typescriptlang.org/" target="_blank">
18
+ <img src="typescript.svg" class="logo vanilla" alt="TypeScript logo" />
19
+ </a>
20
+ <a href="https://github.com/Pinbib/signature" target="_blank">
21
+ <img src="/signature.svg" class="logo canella" alt="Signature logo" />
22
+ </a>
23
+ <h1>Vite + TypeScript + Signature</h1>
24
+ <div class="card">
25
+ <Counter ref />
26
+ </div>
27
+ <p class="read-the-docs">
28
+ Click on the logos to learn more
29
+ </p>
30
+ </div>
31
+ </div>
32
+ <script type="module" src="/src/main.ts"></script>
33
+ </body>
34
+
35
+ </html>
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "#name",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "devDependencies": {
12
+ "typescript": "~5.8.3",
13
+ "vite": "^7.0.4",
14
+ "vite-signature": "^0.0.4"
15
+ },
16
+ "dependencies": {
17
+ "web-signature": "^0.1.8"
18
+ }
19
+ }
@@ -0,0 +1,10 @@
1
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_35_2)">
3
+ <path d="M8.636 28.7C8.228 28.5867 7.89933 28.4847 7.65 28.394C7.40067 28.326 7.276 28.292 7.276 28.292C7.32133 28.1787 7.29867 28.0767 7.208 27.986C7.14 27.8953 6.98133 27.8387 6.732 27.816C6.392 27.612 6.07467 27.3513 5.78 27.034C5.508 26.7393 5.28133 26.4447 5.1 26.15C4.91867 25.8553 4.78267 25.606 4.692 25.402C4.53333 25.062 4.454 24.858 4.454 24.79C4.47667 24.6993 4.61267 24.5973 4.862 24.484C5.11133 24.3027 5.29267 24.246 5.406 24.314C5.542 24.382 5.70067 24.6087 5.882 24.994C6.17667 25.5153 6.67533 25.912 7.378 26.184C8.10333 26.456 8.908 26.5807 9.792 26.558C10.6987 26.5127 11.56 26.3087 12.376 25.946C13.2147 25.606 13.736 25.2547 13.94 24.892C14.1667 24.5067 14.0873 24.0193 13.702 23.43C13.634 23.2487 13.5547 23.1013 13.464 22.988C13.3733 22.8747 13.226 22.7273 13.022 22.546C12.8407 22.3647 12.5347 22.07 12.104 21.662C11.764 21.5033 11.4467 21.356 11.152 21.22C10.88 21.084 10.5853 20.9367 10.268 20.778C9.90533 20.5967 9.46333 20.336 8.942 19.996C8.44333 19.6333 7.96733 19.2367 7.514 18.806C7.06067 18.3753 6.732 17.9787 6.528 17.616C6.16533 17.276 5.89333 16.8113 5.712 16.222C5.53067 15.61 5.46267 14.964 5.508 14.284C5.55333 13.604 5.72333 12.992 6.018 12.448C6.154 12.1307 6.38067 11.7453 6.698 11.292C7.038 10.816 7.412 10.34 7.82 9.864C8.228 9.388 8.62467 8.95733 9.01 8.572C9.39533 8.18667 9.71267 7.91467 9.962 7.756C10.1433 7.57467 10.336 7.39333 10.54 7.212C10.744 7.008 10.846 6.906 10.846 6.906C10.8687 6.79267 10.9027 6.736 10.948 6.736C11.016 6.736 11.05 6.736 11.05 6.736C11.1633 6.668 11.4127 6.55467 11.798 6.396C12.1833 6.23733 12.6027 5.94267 13.056 5.512C14.5747 4.78667 15.81 4.254 16.762 3.914C17.714 3.574 18.496 3.404 19.108 3.404C19.6747 3.42667 20.1847 3.56267 20.638 3.812C21.114 4.03867 21.4993 4.34467 21.794 4.73C22.1113 5.11533 22.304 5.58 22.372 6.124C22.5307 6.668 22.4853 7.30267 22.236 8.028C21.9867 8.73067 21.6127 9.39933 21.114 10.034C20.638 10.646 20.1167 11.1107 19.55 11.428C18.9153 11.7 18.4847 11.8247 18.258 11.802C18.054 11.7567 17.9633 11.5187 17.986 11.088C17.986 10.9067 18.0427 10.6913 18.156 10.442C18.292 10.1927 18.6433 9.75067 19.21 9.116C19.9353 8.05067 20.3773 7.20067 20.536 6.566C20.6947 5.93133 20.5473 5.58 20.094 5.512C19.958 5.46667 19.7087 5.46667 19.346 5.512C19.006 5.55733 18.6207 5.62533 18.19 5.716C17.782 5.784 17.4307 5.86333 17.136 5.954C16.8413 6.022 16.694 6.07867 16.694 6.124C16.694 6.124 16.694 6.158 16.694 6.226C16.694 6.294 16.6487 6.31667 16.558 6.294C16.5127 6.294 16.32 6.38467 15.98 6.566C15.64 6.74733 15.232 6.98533 14.756 7.28C14.28 7.57467 13.804 7.86933 13.328 8.164C12.852 8.45867 12.444 8.71933 12.104 8.946C11.7867 9.15 11.6167 9.27467 11.594 9.32C11.5487 9.56933 11.288 9.796 10.812 10C10.3587 10.272 9.93933 10.6687 9.554 11.19C9.19133 11.7113 8.78333 12.3573 8.33 13.128C7.94467 13.6493 7.67267 14.216 7.514 14.828C7.35533 15.4173 7.35533 15.8933 7.514 16.256C7.62733 16.6187 7.97867 17.0833 8.568 17.65C9.15733 18.2167 9.894 18.7607 10.778 19.282C11.5487 19.7127 12.24 20.1433 12.852 20.574C13.464 20.982 13.9627 21.3787 14.348 21.764C14.756 22.1493 15.028 22.4893 15.164 22.784C15.436 23.1693 15.6287 23.566 15.742 23.974C15.878 24.3593 15.946 24.7333 15.946 25.096C15.9687 25.4587 15.9347 25.7873 15.844 26.082C15.6853 26.4447 15.402 26.8187 14.994 27.204C14.6087 27.5893 14.28 27.7707 14.008 27.748C13.7587 27.816 13.566 27.8953 13.43 27.986C13.3167 28.0767 13.1807 28.156 13.022 28.224C12.8633 28.3147 12.5233 28.4053 12.002 28.496C11.5033 28.5867 10.948 28.6433 10.336 28.666C9.724 28.7113 9.15733 28.7227 8.636 28.7ZM20.9732 25.912C20.7919 25.7307 20.6559 25.504 20.5652 25.232C20.4972 24.96 20.4746 24.688 20.4972 24.416C20.5199 24.144 20.5766 23.9173 20.6672 23.736C20.6672 23.5547 20.6899 23.4187 20.7352 23.328C20.8032 23.2147 20.8259 23.1127 20.8032 23.022C20.7806 22.9313 20.8032 22.7727 20.8712 22.546C20.9392 22.3193 21.0072 22.104 21.0752 21.9C21.2339 21.5373 21.4039 21.1067 21.5852 20.608C21.7666 20.0867 21.9366 19.5767 22.0952 19.078C22.2539 18.5793 22.3899 18.1487 22.5032 17.786C22.6166 17.4233 22.6846 17.1967 22.7072 17.106C22.7072 16.834 22.8886 16.6867 23.2512 16.664C23.5232 16.5733 23.7272 16.5733 23.8632 16.664C23.9992 16.732 24.1806 16.9473 24.4072 17.31C24.5886 17.4913 24.6566 17.7633 24.6112 18.126C24.5659 18.4887 24.4186 18.942 24.1692 19.486C24.0786 19.6673 23.9652 19.928 23.8292 20.268C23.7159 20.608 23.6366 20.914 23.5912 21.186C23.5006 21.3673 23.3872 21.628 23.2512 21.968C23.1379 22.2853 23.0359 22.5913 22.9452 22.886C22.8999 22.9993 22.8546 23.1693 22.8092 23.396C22.7639 23.6 22.7072 23.8267 22.6392 24.076C22.5712 24.3027 22.4806 24.5067 22.3672 24.688C22.1632 25.6173 21.9706 26.1613 21.7892 26.32C21.6306 26.4787 21.3586 26.3427 20.9732 25.912ZM24.2712 12.108C24.1579 11.9947 24.0559 11.836 23.9652 11.632C23.8746 11.4053 23.8179 11.2013 23.7952 11.02C23.7726 10.816 23.7952 10.714 23.8632 10.714C24.0446 10.6913 24.2599 10.4987 24.5092 10.136C24.7586 9.77333 24.8606 9.456 24.8152 9.184C24.8152 9.09333 24.8492 9.014 24.9172 8.946C24.9852 8.85533 25.0646 8.79867 25.1552 8.776C25.4272 8.59467 25.6879 8.572 25.9372 8.708C26.2092 8.82133 26.4586 9.05933 26.6852 9.422C26.8892 9.85267 26.9459 10.2153 26.8552 10.51C26.7646 10.782 26.5152 11.1673 26.1072 11.666C25.7672 12.1193 25.4499 12.3687 25.1552 12.414C24.8832 12.4593 24.5886 12.3573 24.2712 12.108Z" fill="#2196F3"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_35_2">
7
+ <rect width="32" height="32" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path fill="#007ACC" d="M0 128v128h256V0H0z"></path><path fill="#FFF" d="m56.612 128.85l-.081 10.483h33.32v94.68h23.568v-94.68h33.321v-10.28c0-5.69-.122-10.444-.284-10.566c-.122-.162-20.4-.244-44.983-.203l-44.74.122l-.121 10.443Zm149.955-10.742c6.501 1.625 11.459 4.51 16.01 9.224c2.357 2.52 5.851 7.111 6.136 8.208c.08.325-11.053 7.802-17.798 11.988c-.244.162-1.22-.894-2.317-2.52c-3.291-4.795-6.745-6.867-12.028-7.233c-7.76-.528-12.759 3.535-12.718 10.321c0 1.992.284 3.17 1.097 4.795c1.707 3.536 4.876 5.649 14.832 9.956c18.326 7.883 26.168 13.084 31.045 20.48c5.445 8.249 6.664 21.415 2.966 31.208c-4.063 10.646-14.14 17.879-28.323 20.276c-4.388.772-14.79.65-19.504-.203c-10.28-1.828-20.033-6.908-26.047-13.572c-2.357-2.6-6.949-9.387-6.664-9.874c.122-.163 1.178-.813 2.356-1.504c1.138-.65 5.446-3.129 9.509-5.485l7.355-4.267l1.544 2.276c2.154 3.29 6.867 7.801 9.712 9.305c8.167 4.307 19.383 3.698 24.909-1.26c2.357-2.153 3.332-4.388 3.332-7.68c0-2.966-.366-4.266-1.91-6.501c-1.99-2.845-6.054-5.242-17.595-10.24c-13.206-5.69-18.895-9.224-24.096-14.832c-3.007-3.25-5.852-8.452-7.03-12.8c-.975-3.617-1.22-12.678-.447-16.335c2.723-12.76 12.353-21.659 26.25-24.3c4.51-.853 14.994-.528 19.424.569Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,19 @@
1
+ import { Component } from "web-signature";
2
+
3
+ // @ts-ignore
4
+ export default class Counter extends Component {
5
+ name = "Counter";
6
+
7
+ count: number = 0;
8
+
9
+ render(): string {
10
+ return `<button id="button" type="button">count is ${this.count}</button>`;
11
+ }
12
+
13
+ onMount(el: Element): void {
14
+ el.addEventListener("click", () => {
15
+ this.count++;
16
+ this.ref?.update();
17
+ });
18
+ }
19
+ }
@@ -0,0 +1,10 @@
1
+ import { Signature } from 'web-signature';
2
+
3
+ import './style.css';
4
+ import Counter from './components/Counter';
5
+
6
+ const si: Signature = new Signature();
7
+
8
+ si.add(Counter, "Counter");
9
+
10
+ si.contact("#app");
@@ -0,0 +1,107 @@
1
+ :root {
2
+ font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 1.5;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ a {
17
+ font-weight: 500;
18
+ color: #646cff;
19
+ text-decoration: inherit;
20
+ }
21
+
22
+ a:hover {
23
+ color: #535bf2;
24
+ }
25
+
26
+ body {
27
+ margin: 0;
28
+ display: flex;
29
+ place-items: center;
30
+ min-width: 320px;
31
+ min-height: 100vh;
32
+ }
33
+
34
+ h1 {
35
+ font-size: 3.2em;
36
+ line-height: 1.1;
37
+ }
38
+
39
+ #app {
40
+ max-width: 1280px;
41
+ margin: 0 auto;
42
+ padding: 2rem;
43
+ text-align: center;
44
+ }
45
+
46
+ .logo {
47
+ height: 6em;
48
+ padding: 1.5em;
49
+ will-change: filter;
50
+ transition: filter 300ms;
51
+ }
52
+
53
+ .logo:hover {
54
+ filter: drop-shadow(0 0 2em #646cffaa);
55
+ }
56
+
57
+ .logo.vanilla:hover {
58
+ filter: drop-shadow(0 0 2em #3178c6aa);
59
+ }
60
+
61
+ .logo.canella:hover {
62
+ filter: drop-shadow(0 0 2em #2196F3);
63
+ }
64
+
65
+ .card {
66
+ padding: 2em;
67
+ }
68
+
69
+ .read-the-docs {
70
+ color: #888;
71
+ }
72
+
73
+ button {
74
+ border-radius: 8px;
75
+ border: 1px solid transparent;
76
+ padding: 0.6em 1.2em;
77
+ font-size: 1em;
78
+ font-weight: 500;
79
+ font-family: inherit;
80
+ background-color: #1a1a1a;
81
+ cursor: pointer;
82
+ transition: border-color 0.25s;
83
+ }
84
+
85
+ button:hover {
86
+ border-color: #646cff;
87
+ }
88
+
89
+ button:focus,
90
+ button:focus-visible {
91
+ outline: 4px auto -webkit-focus-ring-color;
92
+ }
93
+
94
+ @media (prefers-color-scheme: light) {
95
+ :root {
96
+ color: #213547;
97
+ background-color: #ffffff;
98
+ }
99
+
100
+ a:hover {
101
+ color: #747bff;
102
+ }
103
+
104
+ button {
105
+ background-color: #f9f9f9;
106
+ }
107
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": [
7
+ "ES2022",
8
+ "DOM",
9
+ "DOM.Iterable"
10
+ ],
11
+ "skipLibCheck": true,
12
+ /* Bundler mode */
13
+ "moduleResolution": "bundler",
14
+ "allowImportingTsExtensions": true,
15
+ "verbatimModuleSyntax": true,
16
+ "moduleDetection": "force",
17
+ "noEmit": true,
18
+ /* Linting */
19
+ "strict": true,
20
+ "noUnusedLocals": true,
21
+ "noUnusedParameters": true,
22
+ "erasableSyntaxOnly": true,
23
+ "noFallthroughCasesInSwitch": true,
24
+ "noUncheckedSideEffectImports": true
25
+ },
26
+ "include": [
27
+ "src"
28
+ ]
29
+ }
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from "vite";
2
+ import Signature from "vite-signature";
3
+
4
+ export default defineConfig({
5
+ plugins: [
6
+ Signature()
7
+ ]
8
+ });