diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fc56fbe..827f684 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,7 @@ repos: types: ["erb"] entry: bundle args: ["exec", "erb-format", "--write", "--print-width", "120"] + exclude: ".*\\.json\\.erb" - id: prettier name: prettier language: system diff --git a/app/assets/images/favicon/apple-touch-icon.png b/app/assets/images/favicon/apple-touch-icon.png new file mode 100644 index 0000000..9064cdc Binary files /dev/null and b/app/assets/images/favicon/apple-touch-icon.png differ diff --git a/app/assets/images/favicon/favicon-48x48.png b/app/assets/images/favicon/favicon-48x48.png new file mode 100644 index 0000000..fd3bd4b Binary files /dev/null and b/app/assets/images/favicon/favicon-48x48.png differ diff --git a/app/assets/images/favicon/favicon.ico b/app/assets/images/favicon/favicon.ico new file mode 100644 index 0000000..77bb8af Binary files /dev/null and b/app/assets/images/favicon/favicon.ico differ diff --git a/app/assets/images/favicon/favicon.svg b/app/assets/images/favicon/favicon.svg new file mode 100644 index 0000000..68b92f4 --- /dev/null +++ b/app/assets/images/favicon/favicon.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/app/assets/images/favicon/web-app-manifest-192x192.png b/app/assets/images/favicon/web-app-manifest-192x192.png new file mode 100644 index 0000000..593f192 Binary files /dev/null and b/app/assets/images/favicon/web-app-manifest-192x192.png differ diff --git a/app/assets/images/favicon/web-app-manifest-512x512.png b/app/assets/images/favicon/web-app-manifest-512x512.png new file mode 100644 index 0000000..1865084 Binary files /dev/null and b/app/assets/images/favicon/web-app-manifest-512x512.png differ diff --git a/app/views/application/_favicon.html.erb b/app/views/application/_favicon.html.erb new file mode 100644 index 0000000..3129309 --- /dev/null +++ b/app/views/application/_favicon.html.erb @@ -0,0 +1,5 @@ + + + + + diff --git a/app/views/shared/_flashes.html.erb b/app/views/application/_flashes.html.erb similarity index 100% rename from app/views/shared/_flashes.html.erb rename to app/views/application/_flashes.html.erb diff --git a/app/views/shared/_navigation.html.erb b/app/views/application/_navigation.html.erb similarity index 100% rename from app/views/shared/_navigation.html.erb rename to app/views/application/_navigation.html.erb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8e512bf..4a8b3fb 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - <%= content_for(:title) || "Terraforming Mars Stats" %> + <%= content_for(:title) || "TM Stats" %> @@ -23,11 +23,13 @@ <%= javascript_importmap_tags %> + + <%= render "application/favicon" %> - <%= render "shared/navigation" %> - <%= render "shared/flashes" %> + <%= render "navigation" %> + <%= render "flashes" %> <%= yield %> diff --git a/app/views/pwa/manifest.json.erb b/app/views/pwa/manifest.json.erb index 518cf78..44c7844 100644 --- a/app/views/pwa/manifest.json.erb +++ b/app/views/pwa/manifest.json.erb @@ -1,3 +1,24 @@ -{ "name": "Tmstats", "icons": [ { "src": "/icon.png", "type": "image/png", "sizes": "512x512" }, { "src": "/icon.png", -"type": "image/png", "sizes": "512x512", "purpose": "maskable" } ], "start_url": "/", "display": "standalone", "scope": -"/", "description": "Tmstats.", "theme_color": "red", "background_color": "red" } +{ + "name": "TM Stats", + "short_name": "TM Stats", + "icons": [ + { + "src": "<%= asset_path 'favicon/web-app-manifest-192x192.png' %>", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "<%= asset_path 'favicon/web-app-manifest-512x512.png' %>", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "start_url": "/", + "display": "standalone", + "scope": "/", + "description": "TM Stats", + "theme_color": "#0f172a", + "background_color": "#0f172a" +}