Skip to content

Commit 3cbf429

Browse files
committed
Display version prefix in title heading
1 parent 18f9a49 commit 3cbf429

4 files changed

Lines changed: 27 additions & 3 deletions

File tree

api/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
SECRET_KEY = os.getenv("SECRET_KEY")
1414

1515
# Init FastAPI
16-
app = FastAPI(title='FileSync API', version='1.0', root_path="/api")
16+
app = FastAPI(title='FileSync API', version='3.6.0', root_path="/api")
1717

1818
# Allow your dev frontend origin
1919
app.add_middleware(
@@ -27,7 +27,7 @@
2727
# Add root route
2828
@app.get("/")
2929
async def root():
30-
return {"message": "Welcome to FileSync API!"}
30+
return {"message": "Welcome to FileSync API!", "version": app.version}
3131

3232
# Add health check route
3333
@app.get("/health")

web/css/style.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ h1 {
6868
letter-spacing: -0.02em;
6969
}
7070

71+
.app-version {
72+
font-size: 0.8rem;
73+
font-weight: 600;
74+
letter-spacing: 0.03em;
75+
color: var(--color-h1);
76+
padding: 0.15rem 0.6rem;
77+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
78+
background-color: var(--color-surface);
79+
border: 1.5px solid var(--color-border);
80+
border-radius: 20px;
81+
position: relative;
82+
top: -2px;
83+
}
84+
7185
h2 {
7286
color: var(--color-h2);
7387
font-size: 1.6rem;

web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</div>
4444
</div>
4545
<div class="col col-auto">
46-
<h1 class="fw-semibold" style="font-family: Acme; font-size: 2.8rem; margin-bottom:0">FileSync</h1>
46+
<h1 class="fw-semibold" style="font-family: Acme; font-size: 2.8rem; margin-bottom:0; display: inline-flex; align-items: baseline; gap: 12px;">FileSync<span class="app-version" id="appVersion"></span></h1>
4747
</div>
4848
</div>
4949
<h2 class="fw-normal" style="margin:0; font-size: calc(1.05rem + 0.3vw); letter-spacing: -0.01em">Send files from one device to many in real-time.</h2>

web/js/modules/script.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,18 @@ if (window.localStorage.getItem('mode') == 'light') {
2323
qr.set({foreground: '#212529'});
2424
}
2525

26+
// Load app version from API
27+
async function loadVersion() {
28+
const res = await fetch('/api/');
29+
const data = await res.json();
30+
document.getElementById('appVersion').textContent = `v${data.version}`;
31+
}
32+
2633
// On Load
2734
async function onLoad() {
35+
// Load version badge
36+
await loadVersion();
37+
2838
// Create current user
2939
user = new User(room_id)
3040

0 commit comments

Comments
 (0)