librelad f908a53f27 fix(apps): bump --app-min from 300 to 328 so typical laptops drop to 2 cols and stop orphaning
User's empirical fix: on a 1280-class viewport (sidebar 220, content
~1010), --app-min 300 made the grid pick 3 cols because
floor((1010+20)/(300+20)) = 3, which left a 4-card category landing
as 3+1 with the orphan-row gap that's been the running visual
complaint. Bumping --app-min to 328 changes the floor to
floor((1010+20)/(328+20)) = 2, so the same 4-card category becomes
2+2 with no orphan.

Wider monitors are unaffected — a 1056px content area still fits 3
tracks of 328 (3*328 + 2*20 = 1024 ≤ 1056), and 1700px+ content
still fits 4. The cards-per-row count only drops on the narrow band
where 300 would otherwise have squeezed a third just-too-tight
column in.

Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-28 01:24:28 +01:00

440 lines
10 KiB
CSS

/* App center cards, grid, tags, and detail view. Extracted from style.css. */
.apps-section {
/* Track min-width is the lever for "how many columns at this viewport".
auto-fill picks floor((content + gap) / (--app-min + gap)) tracks, so
bumping --app-min from 300 to 328 pushes typical 1280px-class laptops
from 3 cols → 2 cols where the third column would have been the
orphan that ran into a half-empty last row. Wider monitors still hit
3+ cols (e.g. 1056px content fits 3 tracks of 328 with room to
spare), so density on bigger screens is unchanged. */
--app-min: 328px;
--app-gap: 20px;
display: grid;
/* Fixed-width tracks so cards stay exactly --app-min wide regardless
of how many are visible — a 2-card category lines up with a 3-card
category at the same X positions. auto-fill packs as many tracks
as the row fits at the current viewport. The partial-row orphan
(e.g. 4 cards on a 3-col viewport → 3+1 with the 4th alone on row
2) is an accepted tradeoff: we tried rebalancing to 2x2, but that
dropped the cards-per-row count too aggressively for larger
viewports — keeping rows dense beats avoiding the orphan. */
grid-template-columns: repeat(auto-fill, var(--app-min));
gap: var(--app-gap);
margin: 22px;
padding: 22px;
background: rgba(var(--text-rgb), 0.025);
border: 1px solid var(--border-subtle);
border-radius: 16px;
/* Box reaches the layout edge when the visible cards already fill a
natural row (sentinel from apps-manager.js sets --app-count to 99);
for fewer cards the formula caps the box to exactly that many so
no card-shaped hole sits to the right of a small category.
Outer under border-box (global, style.css:4): N*min + (N-1)*gap +
44px padding + 2px border + 2px sub-pixel buffer. */
max-width: min(
calc(100% - 44px),
calc(var(--app-count, 99) * var(--app-min) + (var(--app-count, 99) - 1) * var(--app-gap) + 48px)
);
}
/* Override grid styling when showing loading content */
.apps-section .loading-content {
position: absolute !important;
top: 20px !important;
left: 20px !important;
right: 20px !important;
bottom: 0 !important;
display: flex !important;
flex-direction: column !important;
justify-content: center !important;
align-items: center !important;
width: calc(100% - 40px) !important;
height: calc(100% - 20px) !important;
padding: 60px 20px !important;
background: var(--input-bg) !important;
border: 2px solid var(--border-color) !important;
border-radius: 12px !important;
box-sizing: border-box !important;
margin: 0 !important;
min-height: 400px !important;
}
/* Make apps-section relative for absolute positioning */
.apps-section {
position: relative !important;
}
.app-card {
background: var(--card-bg);
border: 1px solid var(--card-border);
border-radius: 12px;
padding: 20px;
display: flex;
flex-direction: column;
gap: 16px;
box-shadow: var(--card-shadow);
transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
min-height: 120px;
width: 100%;
position: relative;
}
.app-card-top {
display: flex;
align-items: flex-start;
gap: 16px;
}
.app-card-icon {
width: 70px;
height: 70px;
background: rgba(var(--text-rgb), 0.1);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
padding: 12px;
border: 1px solid rgba(var(--text-rgb), 0.2);
flex-shrink: 0;
}
.app-card-icon svg {
width: 100%;
height: 100%;
object-fit: contain;
}
.app-card-icon img {
width: 100%;
height: 100%;
object-fit: contain;
max-width: 100%;
max-height: 100%;
}
.app-card-content {
flex: 1;
display: flex;
flex-direction: column;
gap: 8px;
min-width: 0;
}
.app-card-title {
font-size: 16px;
font-weight: 600;
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.app-card-long-description {
font-size: 11px;
color: var(--text-secondary);
line-height: 1.3;
margin-top: 8px;
margin-bottom: 8px;
display: -webkit-box;
-webkit-line-clamp: 3;
line-clamp: 3; /* Standard property */
-webkit-box-orient: vertical;
overflow: hidden;
font-style: italic;
width: 100%;
}
.app-card-tags {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.app-tag {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 8px;
border-radius: 12px;
font-size: 12px;
font-weight: 500;
border: 1px solid;
transition: all 0.2s ease;
}
/* Category tags - Blue */
.app-tag.category-tag {
background: rgba(var(--accent-rgb), 0.1);
color: var(--accent);
border-color: rgba(var(--accent-rgb), 0.2);
}
.app-tag.category-tag:hover {
background: rgba(var(--accent-rgb), 0.2);
transform: translateY(-1px);
}
/* Description tags - White to match title */
.app-tag.description-tag {
background: rgba(var(--text-rgb), 0.1);
color: var(--text-primary);
border-color: rgba(var(--text-rgb), 0.2);
font-style: italic;
}
/* Installed tags - Green. Light pastel green text on a saturated
green pill so the label stays in the green family but actually
reads on dark themes (the default --status-success #28a745 is too
dark at small sizes). Leading ✓ glyph reinforces the state at a
glance. */
.app-tag.installed-tag {
background: rgba(var(--status-success-rgb), 0.35);
color: #86efac;
border-color: rgba(var(--status-success-rgb), 0.70);
transform: translateY(-2px);
}
.app-tag.installed-tag::before {
content: '✓';
margin-right: 5px;
font-weight: 700;
line-height: 1;
}
/* Not Installed tags - Gray with a leading ✕ glyph for symmetry with
the ✓ on the installed pill. */
.app-tag.not-installed-tag {
background: rgba(var(--text-rgb), 0.10);
color: var(--text-secondary);
border-color: rgba(var(--text-rgb), 0.30);
}
.app-tag.not-installed-tag::before {
content: '✕';
margin-right: 5px;
font-weight: 700;
line-height: 1;
}
/* Clickable tags (category / installed-status) — jump to that filter view */
.app-tag.clickable {
cursor: pointer;
}
.app-tag.clickable:hover {
transform: translateY(-1px);
}
.app-tag img {
width: 12px;
height: 12px;
margin: 0;
}
.app-card-actions {
display: flex;
gap: 8px;
align-items: stretch;
flex-direction: row;
margin-top: auto;
overflow: visible;
position: relative;
}
.app-card-actions button {
flex: 1;
}
.app-card:hover {
transform: translateY(-3px);
border-color: var(--accent) !important;
box-shadow: var(--card-shadow-hover);
}
.app-card button {
margin-top: 0;
padding: 12px 16px;
border: none;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
transition: background 0.2s, transform 0.2s;
font-size: 14px;
text-align: center;
min-height: 44px;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
white-space: nowrap;
}
.app-icon {
width: 80px;
height: 80px;
border-radius: 12px;
flex-shrink: 0;
}
.app-icon img {
width: 100%;
height: 100%;
object-fit: contain;
max-width: 100%;
max-height: 100%;
}
.app-details .app-description {
font-size: 16px;
color: var(--text-secondary, #ccc);
margin-bottom: 8px;
}
/* .btn-primary / .btn-secondary / .btn-outline / .btn-danger
live in themes.css with the nebula-glass treatment.
.btn-install / .btn-manage / .btn-uninstall ditto. */
/* App-card manage / install button styling lives in themes.css.
The previous block was 6 layers of "ultra-specific" selectors
re-asserting solid-colour fallbacks — all dead now that
themes.css owns the glass treatment with !important. */
/* Force green with attribute selectors */
.app-card-actions button[class*="install-btn"] {
background: var(--status-success) !important;
color: #ffffff !important;
border: 1px solid var(--status-success) !important;
}
.app-card-actions button[class*="install-btn"]:hover {
background: var(--status-success-hover) !important;
border-color: var(--status-success-hover) !important;
}
.installed-apps .app-card {
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 20px;
transition: all 0.2s ease;
cursor: pointer;
}
.installed-apps .app-card:hover {
transform: translateY(-2px);
box-shadow: var(--card-shadow-hover);
border-color: var(--primary-color);
}
.installed-apps .app-card-top {
display: flex;
align-items: center;
gap: 16px;
}
.installed-apps .app-card-icon {
width: 48px;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
flex-shrink: 0;
}
.installed-apps .app-card-icon img {
width: 32px;
height: 32px;
object-fit: contain;
}
.installed-apps .app-card-content {
flex: 1;
min-width: 0;
}
.installed-apps .app-card-title {
font-size: 16px;
font-weight: 600;
color: var(--text-color);
margin: 0 0 4px 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.installed-apps .app-card-description {
font-size: 14px;
color: var(--text-secondary, #ccc);
margin: 0;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2; /* Standard property */
-webkit-box-orient: vertical;
overflow: hidden;
}
.installed-apps .app-card-actions {
display: flex;
align-items: center;
gap: 8px;
}
.installed-apps .app-card-actions .manage-btn {
display: flex;
align-items: center;
gap: 6px;
background: var(--accent) !important;
color: var(--text-primary) !important;
border: 1px solid var(--accent) !important;
border-radius: 6px;
font-size: 12px;
font-weight: 600 !important;
cursor: pointer;
transition: all 0.2s;
}
.installed-apps .app-card-actions .manage-btn:hover {
background: var(--accent-hover) !important;
border-color: var(--accent-hover) !important;
transform: translateY(-1px) !important;
}
/* Extra specific rules for index page manage button */
.app-card-actions .btn-loading.manage-btn {
color: transparent !important;
}
.app-card-actions .btn-loading.manage-btn * {
opacity: 0 !important;
visibility: hidden !important;
}
@media (max-width: 768px) {
.apps-section {
margin: 10px;
padding: 12px;
gap: 12px;
/* Mobile is always a single column — let it fill width regardless of
how many cards there are (no auto-centering, no card-count cap). */
max-width: none;
}
/* Install screen action buttons stack full-width below the console. */
.console-actions {
display: flex;
flex-direction: column;
gap: 8px;
margin-top: 12px;
}
.console-actions .btn {
width: 100%;
justify-content: center;
}
}