v0.9.0 - CSS refactor: split into device files, scanner UI improvements, scroll buttons
This commit is contained in:
30
app.py
30
app.py
@@ -36,7 +36,7 @@ app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(hours=1)
|
||||
|
||||
|
||||
# 1. Define the version
|
||||
APP_VERSION = '0.8.6'
|
||||
APP_VERSION = '0.9.0'
|
||||
|
||||
# 2. Inject it into all templates automatically
|
||||
@app.context_processor
|
||||
@@ -149,6 +149,34 @@ def serve_sw():
|
||||
"""Serve the Service Worker file from the static directory"""
|
||||
return send_from_directory('static', 'sw.js')
|
||||
|
||||
|
||||
# ==================== Temp delete me later ====================
|
||||
@app.route('/whatami')
|
||||
def whatami():
|
||||
"""Temporary route to identify device user-agent"""
|
||||
ua = request.headers.get('User-Agent', 'Unknown')
|
||||
return f"""
|
||||
<html>
|
||||
<head><meta name="viewport" content="width=device-width, initial-scale=1"></head>
|
||||
<body style="font-family: monospace; padding: 20px; word-wrap: break-word;">
|
||||
<h1>Device Info</h1>
|
||||
<h3>User-Agent:</h3>
|
||||
<p style="background: #eee; padding: 10px;">{ua}</p>
|
||||
<h3>Screen Size:</h3>
|
||||
<p id="screen" style="background: #eee; padding: 10px;">Loading...</p>
|
||||
<h3>Viewport Size:</h3>
|
||||
<p id="viewport" style="background: #eee; padding: 10px;">Loading...</p>
|
||||
<script>
|
||||
document.getElementById('screen').textContent =
|
||||
'Screen: ' + screen.width + ' x ' + screen.height + ' | Pixel Ratio: ' + window.devicePixelRatio;
|
||||
document.getElementById('viewport').textContent =
|
||||
'Viewport: ' + window.innerWidth + ' x ' + window.innerHeight;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
|
||||
# ==================== RUN APPLICATION ====================
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user