ncounter.git

git clone https://git.crispbyte.dev/ncounter.git

commit
7922d88
parent
306d091
author
CheddarCrisp
date
2020-03-13 01:30:20 +0100 CET
Add to the about page
Prevent stray events from highlighting buttons
after closing a dialog
9 files changed,  +128, -13
M .gitignore
+2, -1
1@@ -1,2 +1,3 @@
2 node_modules/
3-dist/
4+dist/
5+.DS_Store
M package-lock.json
+69, -6
 1@@ -328,9 +328,9 @@
 2       }
 3     },
 4     "acorn": {
 5-      "version": "6.1.1",
 6-      "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz",
 7-      "integrity": "sha1-fSWuBbuK0fm2mRCOEJTs14hK3B8=",
 8+      "version": "6.4.1",
 9+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
10+      "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==",
11       "dev": true
12     },
13     "acorn-dynamic-import": {
14@@ -2106,6 +2106,69 @@
15       "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==",
16       "dev": true
17     },
18+    "file-loader": {
19+      "version": "5.1.0",
20+      "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-5.1.0.tgz",
21+      "integrity": "sha512-u/VkLGskw3Ue59nyOwUwXI/6nuBCo7KBkniB/l7ICwr/7cPNGsL1WCXUp3GB0qgOOKU1TiP49bv4DZF/LJqprg==",
22+      "dev": true,
23+      "requires": {
24+        "loader-utils": "^1.4.0",
25+        "schema-utils": "^2.5.0"
26+      },
27+      "dependencies": {
28+        "ajv": {
29+          "version": "6.12.0",
30+          "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz",
31+          "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==",
32+          "dev": true,
33+          "requires": {
34+            "fast-deep-equal": "^3.1.1",
35+            "fast-json-stable-stringify": "^2.0.0",
36+            "json-schema-traverse": "^0.4.1",
37+            "uri-js": "^4.2.2"
38+          }
39+        },
40+        "ajv-keywords": {
41+          "version": "3.4.1",
42+          "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz",
43+          "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==",
44+          "dev": true
45+        },
46+        "emojis-list": {
47+          "version": "3.0.0",
48+          "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
49+          "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
50+          "dev": true
51+        },
52+        "fast-deep-equal": {
53+          "version": "3.1.1",
54+          "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
55+          "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
56+          "dev": true
57+        },
58+        "loader-utils": {
59+          "version": "1.4.0",
60+          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
61+          "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
62+          "dev": true,
63+          "requires": {
64+            "big.js": "^5.2.2",
65+            "emojis-list": "^3.0.0",
66+            "json5": "^1.0.1"
67+          }
68+        },
69+        "schema-utils": {
70+          "version": "2.6.5",
71+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.5.tgz",
72+          "integrity": "sha512-5KXuwKziQrTVHh8j/Uxz+QUbxkaLW9X/86NBlx/gnKgtsZA2GIVMUn17qWhRFwF8jdYb3Dig5hRO/W5mZqy6SQ==",
73+          "dev": true,
74+          "requires": {
75+            "ajv": "^6.12.0",
76+            "ajv-keywords": "^3.4.1"
77+          }
78+        }
79+      }
80+    },
81     "file-uri-to-path": {
82       "version": "1.0.0",
83       "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
84@@ -3674,9 +3737,9 @@
85       "dev": true
86     },
87     "kind-of": {
88-      "version": "6.0.2",
89-      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
90-      "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=",
91+      "version": "6.0.3",
92+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
93+      "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
94       "dev": true
95     },
96     "lcid": {
M package.json
+1, -0
1@@ -16,6 +16,7 @@
2     "clean-webpack-plugin": "^3.0.0",
3     "copy-webpack-plugin": "^5.1.1",
4     "css-loader": "^3.4.2",
5+    "file-loader": "^5.1.0",
6     "google-fonts-webpack-plugin": "^0.4.4",
7     "html-loader": "^0.5.5",
8     "html-webpack-plugin": "^3.2.0",
A src/img/GitHub-Mark.png
+0, -0
M src/ncounter/About.svelte
+46, -0
 1@@ -5,6 +5,13 @@
 2         <h2>Release |BUILD_DATE|</h2>
 3         <h2>&copy; |BUILD_YEAR|</h2>
 4     </header>
 5+    <div class="repo">
 6+        <a href="https://github.com/cheddarcrisp/ncounter" rel="noopener external" target="_blank"><img src="{ GitHubIcon }" alt="GitHub">Source Code</a>
 7+        <a href="https://github.com/cheddarcrisp/ncounter/issues" rel="noopener external" target="_blank"><img src="{ GitHubIcon }" alt="GitHub">Issues and feedback</a>
 8+    </div>
 9+    <h3>Privacy Policy</h3>
10+    <p>No cookies. No tracking. All data is stored on your device.
11+        Everything you do with this application is private.</p>
12     <div class="licenses">
13         <h2>Open Source License Information</h2>
14         <Licenses></Licenses>
15@@ -13,7 +20,10 @@
16 <script>
17 import Licenses from './Licenses.svelte';
18 import { createEventDispatcher } from 'svelte';
19+import GitHubIcon from '../img/GitHub-Mark.png';
20+
21 const dispatch = createEventDispatcher();
22+
23 </script>
24 <style>
25 .about {
26@@ -41,6 +51,36 @@ const dispatch = createEventDispatcher();
27     text-align: center;
28 }
29 
30+.repo {
31+    display: flex;
32+    flex-wrap: wrap;
33+    justify-content: space-around;
34+    margin: 6px 0;
35+    flex: none;
36+}
37+
38+.repo > a {
39+    display: inline-flex;
40+    align-items: center;
41+    color: rgba(0, 0, 0, 0.87);
42+    text-decoration: none;
43+    padding: 5px;
44+    background-color: #F0F0F0;
45+    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
46+    border: 2px solid transparent;
47+}
48+
49+.repo > a:hover, .repo > a:focus {
50+    box-shadow: none;
51+    border-color: var(--highlight-color);
52+}
53+
54+.repo > a > img {
55+    width: 24px;
56+    height: 24px;
57+    margin-right: 4px;
58+}
59+
60 h1 {
61     font-weight: 600;
62     font-size: 24px;
63@@ -50,6 +90,12 @@ h2 {
64     font-size: 18px;
65 }
66 
67+h3 {
68+    font-size: 18px;
69+    font-weight: 600;
70+    margin: 12px 0 6px 0;
71+}
72+
73 .licenses h2{
74     font-weight: 600;
75 }
M src/ncounter/App.svelte
+2, -2
 1@@ -17,8 +17,8 @@
 2         <label>Target<input type="text" pattern="(0|([1-9]\d*))(\.\d+)?" inputmode="decimal" bind:value={newCounter.max} /></label>
 3         <label>Save history<input type="checkbox" bind:checked={newCounter.saveHistory} /></label>
 4         <div class="buttons">
 5-            <button class="ok" on:click|preventDefault={ add }>OK</button>
 6-            <button on:click|preventDefault={ () => { showAddDialog = false; } }>Cancel</button>
 7+            <button class="ok" on:click|preventDefault|stopPropagation={ add }>OK</button>
 8+            <button on:click|preventDefault|stopPropagation={ () => { showAddDialog = false; } }>Cancel</button>
 9         </div>
10     </form>
11 </div>
M src/ncounter/Counter.svelte
+2, -2
 1@@ -20,8 +20,8 @@
 2             <h1>{ showIncrement ? "Add" : "Set" }</h1>
 3             <input class="dialog-value" type="text" required pattern="(0|([1-9]\d*))(\.\d+)?" inputmode="decimal" bind:value={ dialogValue } use:focus />
 4             <div class="buttons">
 5-                <button class="ok" on:click|preventDefault={ dialogDone }>OK</button>
 6-                <button on:click|preventDefault={ dialogCancel }>Cancel</button>
 7+                <button class="ok" on:click|preventDefault|stopPropagation={ dialogDone }>OK</button>
 8+                <button on:click|preventDefault|stopPropagation={ dialogCancel }>Cancel</button>
 9             </div>
10         </form>
11     </div>
M src/sw.js
+1, -1
1@@ -29,7 +29,7 @@ registerRoute(
2 );
3 
4 registerRoute(
5-    /\.(?:js|css)$/,
6+    /\.(?:js|css|png)$/,
7     new StaleWhileRevalidate({
8       cacheName: 'static-resources',
9     })
M webpack.common.js
+5, -1
 1@@ -37,7 +37,7 @@ module.exports = {
 2                 from: 'src/icon/safari-pinned-tab.svg', to: 'icons'
 3             },
 4             {
 5-                from: 'src/icon/favicon.ice', to: 'icons'
 6+                from: 'src/icon/favicon.ico', to: 'icons'
 7             },
 8             {
 9                 from: 'src/icon/site.webmanifest', to: 'icons'
10@@ -82,6 +82,10 @@ module.exports = {
11                     'style-loader',
12                     'css-loader'
13                 ]
14+            },
15+            {
16+                test: /\.png$/,
17+                loader: 'file-loader'
18             }
19         ]
20     },