mirror of
git://f0xx.org/android_cast
synced 2026-07-29 04:38:53 +03:00
Add static Android Cast project hub landing page.
Three card links (reports, git, tickets) match crash console styling with stronger hover lift; nginx serves index.html at /app/androidcast_project/ instead of redirecting to crashes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
31
examples/app_hub/README.md
Normal file
31
examples/app_hub/README.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Android Cast project hub (static landing)
|
||||||
|
|
||||||
|
Served at `https://apps.f0xx.org/app/androidcast_project/` — three links to reports, git, and tickets.
|
||||||
|
|
||||||
|
## Deploy (BE VM)
|
||||||
|
|
||||||
|
After `git pull` on the server tree, copy two files next to `crashes/` (not inside PHP public):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
HUB=/var/www/localhost/htdocs/apps/app/androidcast_project
|
||||||
|
SRC=.../android_cast/examples/app_hub # adjust to your clone path
|
||||||
|
|
||||||
|
cp "$SRC/index.html" "$HUB/index.html"
|
||||||
|
cp "$SRC/hub.css" "$HUB/hub.css"
|
||||||
|
```
|
||||||
|
|
||||||
|
Update nginx: replace the redirect on `/app/androidcast_project/` with static `alias` (see `examples/crash_reporter/backend/nginx.apps.conf.fragment`). Then:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nginx -t && rc-service nginx reload # or your reload command
|
||||||
|
```
|
||||||
|
|
||||||
|
No PHP-FPM or database steps. Crash console CSS is loaded from `/app/androidcast_project/crashes/assets/css/app.css` (existing nginx alias).
|
||||||
|
|
||||||
|
## Local preview
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd examples/app_hub
|
||||||
|
php -S 127.0.0.1:8765
|
||||||
|
# open http://127.0.0.1:8765/ — icons/CSS need crashes assets or adjust hrefs
|
||||||
|
```
|
||||||
155
examples/app_hub/hub.css
Normal file
155
examples/app_hub/hub.css
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
/* Android Cast project hub — shares crash console tokens via app.css */
|
||||||
|
|
||||||
|
.hub-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-shell {
|
||||||
|
flex: 1;
|
||||||
|
min-height: calc(100vh - 40px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: calc(100vh - 40px);
|
||||||
|
padding: 32px 28px 48px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-header {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-title {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
font-size: 1.75rem;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-subtitle {
|
||||||
|
margin: 0 0 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-theme {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-cards {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, minmax(200px, 1fr));
|
||||||
|
gap: 24px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 1080px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14px;
|
||||||
|
padding: 22px 24px;
|
||||||
|
color: var(--text);
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-card:hover,
|
||||||
|
.hub-card:focus-visible {
|
||||||
|
color: var(--text);
|
||||||
|
text-decoration: none;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stronger lift than detail Device cards (2× shadow, higher rise) */
|
||||||
|
.hub-cards .hub-card {
|
||||||
|
transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-cards .hub-card:hover,
|
||||||
|
.hub-cards .hub-card:focus-visible {
|
||||||
|
transform: translateY(-10px);
|
||||||
|
box-shadow: 0 20px 48px rgba(0, 0, 0, 0.44);
|
||||||
|
border-color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="light"] .hub-cards .hub-card:hover,
|
||||||
|
[data-theme="light"] .hub-cards .hub-card:focus-visible {
|
||||||
|
box-shadow: 0 20px 44px rgba(26, 35, 50, 0.28);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-card-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hub-card-icon .nav-icon {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Same caption weight/size as crash console nav labels (Tickets sidebar) */
|
||||||
|
.hub-card-label {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.25;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Git — branch icon (hub only; git app may use its own asset) */
|
||||||
|
.nav-icon--git {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
.nav-icon--git::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 2px;
|
||||||
|
top: 2px;
|
||||||
|
width: 7px;
|
||||||
|
height: 7px;
|
||||||
|
border: 2px solid currentColor;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.nav-icon--git::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 8px;
|
||||||
|
top: 5px;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
border: 2px solid currentColor;
|
||||||
|
border-left: none;
|
||||||
|
border-bottom: none;
|
||||||
|
border-radius: 0 6px 0 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 860px) {
|
||||||
|
.hub-cards {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
max-width: 420px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.hub-cards .hub-card {
|
||||||
|
transition: border-color .15s ease, box-shadow .15s ease;
|
||||||
|
}
|
||||||
|
.hub-cards .hub-card:hover,
|
||||||
|
.hub-cards .hub-card:focus-visible {
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
70
examples/app_hub/index.html
Normal file
70
examples/app_hub/index.html
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" data-theme="dark">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>Android Cast — Project hub</title>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var t = localStorage.getItem('crash_console_theme');
|
||||||
|
if (t === 'light' || t === 'dark') document.documentElement.setAttribute('data-theme', t);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<link rel="stylesheet" href="/app/androidcast_project/crashes/assets/css/app.css">
|
||||||
|
<link rel="stylesheet" href="/app/androidcast_project/hub.css">
|
||||||
|
</head>
|
||||||
|
<body class="hub-page">
|
||||||
|
<div class="shell hub-shell">
|
||||||
|
<main class="main-pane hub-main">
|
||||||
|
<header class="hub-header">
|
||||||
|
<h1 class="hub-title">Android Cast</h1>
|
||||||
|
<p class="muted hub-subtitle">Project hub</p>
|
||||||
|
<label class="toolbar-select hub-theme">
|
||||||
|
<span>Theme</span>
|
||||||
|
<select id="theme-select" aria-label="UI theme">
|
||||||
|
<option value="dark">Dark</option>
|
||||||
|
<option value="light">Light</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</header>
|
||||||
|
<nav class="hub-cards cards cards--lift" aria-label="Android Cast apps">
|
||||||
|
<a class="hub-card card card--lift"
|
||||||
|
href="https://apps.f0xx.org/app/androidcast_project/crashes/?view=reports">
|
||||||
|
<span class="hub-card-icon" aria-hidden="true">
|
||||||
|
<span class="nav-icon nav-icon--reports"></span>
|
||||||
|
</span>
|
||||||
|
<span class="hub-card-label">AndroidCast reports</span>
|
||||||
|
</a>
|
||||||
|
<a class="hub-card card card--lift"
|
||||||
|
href="https://apps.f0xx.org/app/androidcast_project/git/">
|
||||||
|
<span class="hub-card-icon" aria-hidden="true">
|
||||||
|
<span class="nav-icon nav-icon--git"></span>
|
||||||
|
</span>
|
||||||
|
<span class="hub-card-label">AndroidCast git</span>
|
||||||
|
</a>
|
||||||
|
<a class="hub-card card card--lift"
|
||||||
|
href="https://apps.f0xx.org/app/androidcast_project/crashes/?view=tickets">
|
||||||
|
<span class="hub-card-icon" aria-hidden="true">
|
||||||
|
<span class="nav-icon nav-icon--tickets"></span>
|
||||||
|
</span>
|
||||||
|
<span class="hub-card-label">AndroidCast tickets</span>
|
||||||
|
</a>
|
||||||
|
</nav>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
<footer class="bottom-bar">(c) Anton Afanaasyeu</footer>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var sel = document.getElementById('theme-select');
|
||||||
|
if (!sel) return;
|
||||||
|
var cur = document.documentElement.getAttribute('data-theme') || 'dark';
|
||||||
|
sel.value = cur;
|
||||||
|
sel.addEventListener('change', function () {
|
||||||
|
var v = sel.value;
|
||||||
|
document.documentElement.setAttribute('data-theme', v);
|
||||||
|
try { localStorage.setItem('crash_console_theme', v); } catch (e) {}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -6,11 +6,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
location = /app/androidcast_project {
|
location = /app/androidcast_project {
|
||||||
return 301 /app/androidcast_project/crashes/;
|
return 301 /app/androidcast_project/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Static project hub (examples/app_hub — index.html + hub.css on disk)
|
||||||
location = /app/androidcast_project/ {
|
location = /app/androidcast_project/ {
|
||||||
return 301 /app/androidcast_project/crashes/;
|
alias /var/www/localhost/htdocs/apps/app/androidcast_project/index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /app/androidcast_project/hub.css {
|
||||||
|
alias /var/www/localhost/htdocs/apps/app/androidcast_project/hub.css;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ^~ /app/androidcast_project/crashes/assets/ {
|
location ^~ /app/androidcast_project/crashes/assets/ {
|
||||||
|
|||||||
@@ -23,11 +23,15 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location = /app/androidcast_project {
|
location = /app/androidcast_project {
|
||||||
return 301 /app/androidcast_project/crashes/;
|
return 301 /app/androidcast_project/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /app/androidcast_project/ {
|
location = /app/androidcast_project/ {
|
||||||
return 301 /app/androidcast_project/crashes/;
|
alias /var/www/localhost/htdocs/apps/app/androidcast_project/index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /app/androidcast_project/hub.css {
|
||||||
|
alias /var/www/localhost/htdocs/apps/app/androidcast_project/hub.css;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ^~ /app/androidcast_project/crashes/assets/ {
|
location ^~ /app/androidcast_project/crashes/assets/ {
|
||||||
|
|||||||
Reference in New Issue
Block a user