Skip to content

Commit 26d79bb

Browse files
committed
add favicon
1 parent 69d9238 commit 26d79bb

9 files changed

+29
-0
lines changed

main.py

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
if not os.path.exists(STATIC_DIR):
3131
os.makedirs(os.path.join(STATIC_DIR, "js"))
3232

33+
for file in ["android-chrome-192x192.png", "android-chrome-512x512.png",
34+
"apple-touch-icon.png", "favicon-16x16.png",
35+
"favicon-32x32.png", "favicon.ico", "site.webmanifest"]:
36+
if not os.path.exists(os.path.join(STATIC_DIR, file)):
37+
print(f"Warning: {file} not found in static directory")
38+
3339
app = Flask(__name__,
3440
static_folder=STATIC_DIR,
3541
static_url_path="/static")

static/android-chrome-192x192.png

15.4 KB
Loading

static/android-chrome-512x512.png

68.7 KB
Loading

static/apple-touch-icon.png

14 KB
Loading

static/favicon-16x16.png

402 Bytes
Loading

static/favicon-32x32.png

1008 Bytes
Loading

static/favicon.ico

15 KB
Binary file not shown.

static/site.webmanifest

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "DHT22 Monitor",
3+
"short_name": "DHT22",
4+
"icons": [
5+
{
6+
"src": "/static/android-chrome-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "/static/android-chrome-512x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png"
14+
}
15+
],
16+
"theme_color": "#010409",
17+
"background_color": "#010409",
18+
"display": "standalone"
19+
}

templates/index.html

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
<head>
55
<title>DHT22 Sensor Data</title>
6+
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='apple-touch-icon.png') }}">
7+
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='favicon-32x32.png') }}">
8+
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='favicon-16x16.png') }}">
9+
<link rel="manifest" href="{{ url_for('static', filename='site.webmanifest') }}">
610
<meta name="viewport" content="width=device-width, initial-scale=1.0">
711
<script src="{{ url_for('static', filename='js/socket.io.min.js') }}"></script>
812
<script src="{{ url_for('static', filename='js/chart.umd.min.js') }}"></script>

0 commit comments

Comments
 (0)