Skip to content

Commit

Permalink
feat: favicon (#73)
Browse files Browse the repository at this point in the history
Fixes #9
  • Loading branch information
Erb3 authored Jun 16, 2024
1 parent 249b5f9 commit e35a077
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 2 deletions.
Binary file added assets/sveio-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions assets/sveio-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions frontend/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sveio - Page Not Found</title>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/icons/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/icons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/icons/favicon-16x16.png"
/>
<link rel="manifest" href="/icons/site.webmanifest" />
<link rel="stylesheet" href="/ui.css" />
</head>
<body>
Expand Down
18 changes: 18 additions & 0 deletions frontend/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin=""
/>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/icons/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/icons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/icons/favicon-16x16.png"
/>
<link rel="manifest" href="/icons/site.webmanifest" />
<link rel="stylesheet" href="/game.css" />
<link rel="stylesheet" href="/ui.css" />
<title>Sveio - In-game</title>
Expand Down
Binary file added frontend/icons/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/icons/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/icons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/icons/favicon.ico
Binary file not shown.
19 changes: 19 additions & 0 deletions frontend/icons/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Sveio",
"short_name": "Sveio",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
18 changes: 18 additions & 0 deletions frontend/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@
href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap"
rel="stylesheet"
/>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/icons/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/icons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/icons/favicon-16x16.png"
/>
<link rel="manifest" href="/icons/site.webmanifest" />
<link rel="stylesheet" href="/ui.css" />
<style>
h2 {
Expand Down
6 changes: 4 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ pub async fn start_server(opts: ServerOptions) {
"/",
MemoryServe::new(load_assets!("frontend"))
.index_file(Some("/landing.html"))
.add_alias("/game", "/game.html")
.add_alias("/404", "/404.html")
.fallback(Some("/404.html"))
.html_cache_control(memory_serve::CacheControl::Medium)
.add_alias("/game", "/game.html")
.add_alias("/404", "/404.html")
.add_alias("/favicon.ico", "/icons/favicon.ico")
.add_alias("/site.webmanifest", "/icons/site.webmanifest")
.into_router(),
)
.layer(
Expand Down

0 comments on commit e35a077

Please sign in to comment.