diff --git a/.stylelintrc b/.stylelintrc index ca56f01e..65d5bbb2 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -8,7 +8,9 @@ "block-closing-brace-empty-line-before": null, "block-closing-brace-newline-after": null, "block-opening-brace-space-before": null, - "color-named": null, + "color-hex-case": "lower", + "color-hex-length": "short", + "color-named": "never", "declaration-block-semicolon-newline-after": "always-multi-line", "declaration-block-semicolon-newline-before": "never-multi-line", "declaration-block-semicolon-space-after": "always-single-line", @@ -49,6 +51,7 @@ "selector-max-universal": 1, "selector-no-qualifying-type": null, "selector-no-vendor-prefix": null, + "shorthand-property-no-redundant-values": true, "string-quotes": "double", "value-keyword-case": "lower", "value-list-comma-newline-after": "never-multi-line", diff --git a/index.js b/index.js index c7f1c4ff..8ef1b5b3 100644 --- a/index.js +++ b/index.js @@ -118,6 +118,22 @@ const REFERRER_HEADER = 'no-referrer, strict-origin-when-cross-origin'; } }); + server.route({ + method: 'GET', + path: '/favicon.ico', + handler: (request, h) => { + return h.redirect('/favicons/favicon.ico').permanent(); + } + }); + + server.route({ + method: 'GET', + path: '/apple-touch-icon.png', + handler: (request, h) => { + return h.redirect('/favicons/apple-touch-icon.png').permanent(); + } + }); + await server.start(); console.log(`Server running at: ${server.info.uri}`); } catch (error) { diff --git a/public/badge/badge.css b/public/badge/badge.css index 734b41a0..054b66a0 100644 --- a/public/badge/badge.css +++ b/public/badge/badge.css @@ -8,7 +8,7 @@ } .sri-test::before { - background-color: yellow; + background-color: #ff0; content: "[Testing SRI support...]"; } diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index f89eadb1..00000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/favicons/android-chrome-192x192.png b/public/favicons/android-chrome-192x192.png new file mode 100644 index 00000000..982fd469 Binary files /dev/null and b/public/favicons/android-chrome-192x192.png differ diff --git a/public/favicons/android-chrome-512x512.png b/public/favicons/android-chrome-512x512.png new file mode 100644 index 00000000..9c571e23 Binary files /dev/null and b/public/favicons/android-chrome-512x512.png differ diff --git a/public/favicons/apple-touch-icon.png b/public/favicons/apple-touch-icon.png new file mode 100644 index 00000000..9f8300d3 Binary files /dev/null and b/public/favicons/apple-touch-icon.png differ diff --git a/public/favicons/browserconfig.xml b/public/favicons/browserconfig.xml new file mode 100644 index 00000000..a2f2185c --- /dev/null +++ b/public/favicons/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #333333 + + + diff --git a/public/favicons/favicon-16x16.png b/public/favicons/favicon-16x16.png new file mode 100644 index 00000000..c2b4d505 Binary files /dev/null and b/public/favicons/favicon-16x16.png differ diff --git a/public/favicons/favicon-32x32.png b/public/favicons/favicon-32x32.png new file mode 100644 index 00000000..54b5bd31 Binary files /dev/null and b/public/favicons/favicon-32x32.png differ diff --git a/public/favicons/favicon.ico b/public/favicons/favicon.ico new file mode 100644 index 00000000..cc519a0e Binary files /dev/null and b/public/favicons/favicon.ico differ diff --git a/public/favicons/manifest.json b/public/favicons/manifest.json new file mode 100644 index 00000000..ed538edd --- /dev/null +++ b/public/favicons/manifest.json @@ -0,0 +1,19 @@ +{ + "name": "SRI Hash Generator", + "short_name": "SRI Hash", + "icons": [ + { + "src": "/favicons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/favicons/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#333333", + "background_color": "#333333", + "display": "standalone" +} diff --git a/public/favicons/mstile-150x150.png b/public/favicons/mstile-150x150.png new file mode 100644 index 00000000..6225584e Binary files /dev/null and b/public/favicons/mstile-150x150.png differ diff --git a/public/favicons/safari-pinned-tab.svg b/public/favicons/safari-pinned-tab.svg new file mode 100644 index 00000000..5b86f4fc --- /dev/null +++ b/public/favicons/safari-pinned-tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/style.css b/public/style.css index d59c742a..2c6f276f 100644 --- a/public/style.css +++ b/public/style.css @@ -4,7 +4,7 @@ body { color: #333; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; font-weight: 300; line-height: 1.5; @@ -54,9 +54,10 @@ code { word-break: break-all; display: inline-block; padding: 1rem; - border-left: 3px solid gray; + border-left: 3px solid #808080; background-color: #3a3a3a; color: #ccc; + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 1rem; line-height: 1; margin-top: 1rem; @@ -64,16 +65,18 @@ code { nav { background-color: #333; + padding-top: 0.5rem; + padding-bottom: 0.5rem; } nav a { - color: white; + color: #fff; float: right; - padding: 0.5rem 1rem 0.5rem 0; + padding: 0.5rem 1rem; } nav a:hover { - color: white; + color: #fff; } footer { @@ -84,9 +87,8 @@ footer { .container { width: auto; max-width: 960px; - margin: auto; + margin: auto auto 2rem; padding: 1rem; - margin-bottom: 2rem; } .clear { @@ -97,7 +99,7 @@ footer { * App container */ #app { - color: black; + color: #000; background-color: #adbdc6; padding: 4rem 0; max-width: 100%; @@ -110,14 +112,14 @@ footer { font-size: 1.5rem; } -#sriApp input:not([type="checkbox"]) { +#sriApp input { font-size: 0.9rem; height: 2.25rem; display: inline-block; } #sriApp input[type="url"] { - background-color: white; + background-color: #fff; color: #888; border: 1px solid #ccc; width: 70%; @@ -126,7 +128,7 @@ footer { #sriApp input[type="submit"] { cursor: pointer; - color: white; + color: #fff; background-color: #008cba; border: 1px solid #0079a1; width: 25%; @@ -142,9 +144,9 @@ footer { height: 5rem; padding: 1rem; border: none; - border-left: 3px solid gray; + border-left: 3px solid #808080; background-color: #3a3a3a; - margin: 1rem 0 0 0; + margin: 1rem 0 0; } #sriSnippet { @@ -158,7 +160,7 @@ footer { * Mobile styling */ -@media all and (max-width: 960px) { +@media (max-width: 960px) { nav { padding: 0.75rem 0; text-align: center; @@ -178,7 +180,7 @@ footer { } #app { - padding: 1rem 0 0.25rem 0; + padding: 1rem 0 0.25rem; text-align: center; } diff --git a/templates/index.html b/templates/index.html index c4525974..b998d539 100644 --- a/templates/index.html +++ b/templates/index.html @@ -13,7 +13,18 @@ - + + + + + + + + + + + +