Merge pull request 'feat: add pull-to-refresh button for all list views' (#64) from feature/pull-to-refresh into master
This commit was merged in pull request #64.
This commit is contained in:
@@ -115,6 +115,10 @@ var basePage = template.Must(template.New("base").Parse(`<!DOCTYPE html>
|
||||
<script src="/static/htmx.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="top-bar">
|
||||
<span class="top-bar-title">Gitea Mobile</span>
|
||||
<button class="refresh-btn" hx-get="" hx-target="#main-content" hx-swap="innerHTML" aria-label="Refresh">↻</button>
|
||||
</header>
|
||||
<div class="content" id="main-content">
|
||||
{{.Content}}
|
||||
</div>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<script src="/static/htmx.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="top-bar">
|
||||
<span class="top-bar-title">Gitea Mobile</span>
|
||||
<button class="refresh-btn" hx-get="" hx-target="#main-content" hx-swap="innerHTML" aria-label="Refresh">↻</button>
|
||||
</header>
|
||||
<div class="content" id="main-content">
|
||||
{{template "content" .}}
|
||||
</div>
|
||||
|
||||
+44
-1
@@ -47,10 +47,53 @@ body {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* Top bar */
|
||||
.top-bar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: var(--spacing-sm) var(--spacing-lg);
|
||||
padding-top: max(var(--spacing-sm), env(safe-area-inset-top));
|
||||
background: var(--bg-secondary);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.top-bar-title {
|
||||
font-size: var(--font-base);
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.refresh-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--text-secondary);
|
||||
font-size: 1.4rem;
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
cursor: pointer;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
line-height: 1;
|
||||
border-radius: var(--radius-sm);
|
||||
transition: color 0.15s ease, background 0.15s ease;
|
||||
}
|
||||
|
||||
.refresh-btn:active {
|
||||
color: var(--accent-blue);
|
||||
background: var(--bg-tertiary);
|
||||
}
|
||||
|
||||
.refresh-btn.htmx-request {
|
||||
animation: spin 0.6s linear infinite;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Content area */
|
||||
.content {
|
||||
padding: var(--spacing-lg);
|
||||
padding-top: max(var(--spacing-lg), env(safe-area-inset-top));
|
||||
padding-top: var(--spacing-lg);
|
||||
max-width: 640px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user