Add Android BLE mesh client and project website
This commit is contained in:
32
website/assets/css/styles.css
Normal file
32
website/assets/css/styles.css
Normal file
@@ -0,0 +1,32 @@
|
||||
:root {
|
||||
--mesh-dark: #0f2a43;
|
||||
--mesh-accent: #1f8a70;
|
||||
--mesh-bg: #f4f8fb;
|
||||
--mesh-text: #1d2630;
|
||||
}
|
||||
|
||||
body {
|
||||
background: radial-gradient(circle at top right, #d7f6eb 0%, #f4f8fb 40%, #eef3fa 100%);
|
||||
color: var(--mesh-text);
|
||||
}
|
||||
|
||||
.hero {
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, var(--mesh-dark), #144c72 50%, #196b95);
|
||||
}
|
||||
|
||||
.status-card {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.feature {
|
||||
background: #fff;
|
||||
border: 1px solid #dbe4ef;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
footer {
|
||||
border-top: 1px solid #dbe4ef;
|
||||
}
|
||||
50
website/assets/js/app.js
Normal file
50
website/assets/js/app.js
Normal file
@@ -0,0 +1,50 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const btn = document.getElementById('downloadBtn');
|
||||
const versionBadge = document.getElementById('versionBadge');
|
||||
const versionSummary = document.getElementById('versionSummary');
|
||||
const downloadMeta = document.getElementById('downloadMeta');
|
||||
if (!btn) return;
|
||||
|
||||
btn.addEventListener('click', (event) => {
|
||||
if (!btn.getAttribute('href') || btn.getAttribute('href') === '#') {
|
||||
event.preventDefault();
|
||||
alert('APK пока не опубликован. Следите за обновлениями проекта.');
|
||||
}
|
||||
});
|
||||
|
||||
fetch('assets/meta/version.json', { cache: 'no-store' })
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then((meta) => {
|
||||
const sizeMb = (meta.apkSizeBytes / (1024 * 1024)).toFixed(1);
|
||||
const builtAt = new Date(meta.buildDateUtc).toLocaleString('ru-RU', {
|
||||
dateStyle: 'medium',
|
||||
timeStyle: 'short'
|
||||
});
|
||||
|
||||
if (versionBadge) {
|
||||
versionBadge.textContent = `v${meta.versionName} (${meta.versionCode})`;
|
||||
}
|
||||
if (versionSummary) {
|
||||
versionSummary.textContent = `Последняя сборка опубликована ${builtAt} UTC.`;
|
||||
}
|
||||
if (downloadMeta) {
|
||||
downloadMeta.textContent = `Доступна debug-сборка v${meta.versionName}. Размер APK: ${sizeMb} MB.`;
|
||||
}
|
||||
if (meta.apkPath) {
|
||||
btn.setAttribute('href', meta.apkPath);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
if (versionBadge) {
|
||||
versionBadge.textContent = 'Версия недоступна';
|
||||
}
|
||||
if (versionSummary) {
|
||||
versionSummary.textContent = 'Не удалось загрузить метаданные сборки.';
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user