mirror of
https://github.com/hansjone/netx.git
synced 2026-10-15 01:00:53 +08:00
Render workbench modules as phone-style app icons.
Drop the card chrome: a 60px rounded tone icon with the name below, in fixed 96px cells. Hover lifts the icon only; edit mode puts the remove button on the icon corner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2307f19779
commit
35d58a3688
1 changed files with 49 additions and 50 deletions
|
|
@ -47,63 +47,66 @@
|
|||
border-radius: 12px; background: transparent; color: var(--nx-text-muted); box-shadow: none;
|
||||
}
|
||||
.app--shell .app-main .wb-modules__empty-btn:hover { background: rgb(255 255 255 / .04); color: var(--nx-text); border-color: var(--nx-line-strong); }
|
||||
/* Launcher: phone-style app icons — rounded icon on top, name below, no card chrome. */
|
||||
.wb-section--operations, .wb-modules__tray-grid {
|
||||
display: grid; grid-template-columns: repeat(auto-fill, var(--wb-app-w)); justify-content: start;
|
||||
grid-auto-rows: auto; gap: 20px 16px;
|
||||
}
|
||||
.wb-modules { --wb-app-w: 96px; --wb-app-icon: 60px; }
|
||||
.wb-tile-wrap { position: relative; min-width: 0; }
|
||||
.wb-modules--editing .wb-tile-wrap--edit .wb-tile { border-color: var(--nx-line); cursor: grab; }
|
||||
.wb-modules--editing .wb-tile-wrap--edit.is-dragging .wb-tile { opacity: .55; cursor: grabbing; }
|
||||
.wb-modules--editing .wb-tile-wrap--edit .wb-tile:hover { transform: none; }
|
||||
.app--shell .app-main .wb-tile__remove {
|
||||
position: absolute; top: 4px; right: 4px; z-index: 2;
|
||||
width: 22px; height: 22px; padding: 0; margin: 0;
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
border: 1px solid var(--nx-line); border-radius: 999px;
|
||||
background: rgb(15 23 42 / .72); color: var(--nx-text-muted); cursor: pointer;
|
||||
}
|
||||
.app--shell .app-main .wb-tile__remove:hover { color: var(--nx-text); border-color: var(--nx-line-strong); }
|
||||
.wb-tile__remove svg { width: 12px; height: 12px; }
|
||||
.wb-modules__tray { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
|
||||
.wb-modules__tray-label { font-size: 12px; font-weight: 500; color: var(--nx-text-muted); }
|
||||
.wb-modules__tray-grid {
|
||||
display: grid; grid-template-columns: repeat(auto-fill, minmax(max(88px, 16%), 1fr));
|
||||
grid-auto-rows: calc(var(--wb-tile-h) * .85); gap: 10px;
|
||||
}
|
||||
.app--shell .app-main .wb-tile--available {
|
||||
opacity: .55; border-style: dashed; border-color: var(--nx-line); min-height: 0;
|
||||
background: rgb(255 255 255 / .02);
|
||||
}
|
||||
.app--shell .app-main .wb-tile--available:hover {
|
||||
opacity: .85; transform: none;
|
||||
border-color: var(--nx-line-strong);
|
||||
background: rgb(255 255 255 / .05);
|
||||
}
|
||||
.wb-modules__actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
|
||||
/* Fixed-size tiles fill rows in order; the panel's spare height is room for new modules. */
|
||||
.wb-section--operations { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(88px, 16%), 1fr)); grid-auto-rows: var(--wb-tile-h); gap: 12px; }
|
||||
.app--shell .app-main .wb-tile {
|
||||
width: 100%; height: auto; min-height: var(--wb-tile-h); padding: 12px 16px; margin: 0;
|
||||
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
|
||||
border: 1px solid rgb(150 190 255 / .05); border-radius: 12px;
|
||||
background: linear-gradient(180deg, rgb(255 255 255 / .06), rgb(255 255 255 / .015));
|
||||
color: var(--nx-text); text-align: left; white-space: nowrap;
|
||||
box-shadow: none;
|
||||
transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
|
||||
width: 100%; height: auto; min-height: 0; padding: 4px 0; margin: 0;
|
||||
display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px;
|
||||
border: 0; border-radius: 0; background: transparent; box-shadow: none;
|
||||
color: var(--nx-text); white-space: nowrap;
|
||||
}
|
||||
.app--shell .app-main .wb-tile:hover {
|
||||
background: linear-gradient(180deg, rgb(255 255 255 / .10), rgb(255 255 255 / .03)), rgb(var(--wb-tone-rgb, var(--nx-accent-rgb)) / .08);
|
||||
border-color: rgb(var(--wb-tone-rgb, var(--nx-accent-rgb)) / .35);
|
||||
box-shadow: none;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.app--shell .app-main .wb-tile:focus-visible { box-shadow: var(--nx-ring); }
|
||||
.wb-tile__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 600; color: var(--nx-text-strong); }
|
||||
.app--shell .app-main .wb-section--operations .wb-tile:hover,
|
||||
.app--shell .app-main .wb-modules__tray .wb-tile:hover { background: transparent; border: 0; box-shadow: none; transform: none; }
|
||||
.app--shell .app-main .wb-tile:focus-visible { box-shadow: none; outline: none; }
|
||||
.app--shell .app-main .wb-tile:focus-visible .wb-card__icon { box-shadow: var(--nx-ring); }
|
||||
.wb-tile__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--nx-text-muted); transition: color .2s; }
|
||||
.wb-tile--blue, .wb-card__icon--blue { --wb-tone-rgb: 96 165 250; }
|
||||
.wb-tile--green, .wb-card__icon--green { --wb-tone-rgb: 52 211 153; }
|
||||
.wb-tile--amber, .wb-card__icon--amber { --wb-tone-rgb: 251 191 36; }
|
||||
.wb-tile--slate, .wb-card__icon--slate { --wb-tone-rgb: 148 163 184; }
|
||||
.wb-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--nx-radius-lg); color: rgb(var(--wb-tone-rgb, var(--nx-accent-rgb))); background: rgb(var(--wb-tone-rgb, var(--nx-accent-rgb)) / .14); flex-shrink: 0; }
|
||||
.wb-card__icon svg { width: 22px; height: 22px; }
|
||||
.wb-section--operations .wb-card__icon, .wb-modules__tray .wb-card__icon {
|
||||
width: var(--wb-app-icon); height: var(--wb-app-icon); border-radius: 16px;
|
||||
background: rgb(var(--wb-tone-rgb, var(--nx-accent-rgb)) / .16);
|
||||
border: 1px solid rgb(var(--wb-tone-rgb, var(--nx-accent-rgb)) / .14);
|
||||
transition: background .2s, border-color .2s, transform .2s;
|
||||
}
|
||||
.wb-section--operations .wb-card__icon svg, .wb-modules__tray .wb-card__icon svg { width: 28px; height: 28px; }
|
||||
.app--shell .app-main .wb-section--operations .wb-tile:hover .wb-card__icon {
|
||||
background: rgb(var(--wb-tone-rgb, var(--nx-accent-rgb)) / .24);
|
||||
border-color: rgb(var(--wb-tone-rgb, var(--nx-accent-rgb)) / .28);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.app--shell .app-main .wb-section--operations .wb-tile:hover .wb-tile__label { color: var(--nx-text-strong); }
|
||||
.app--shell .app-main .wb-section--operations .wb-tile:active .wb-card__icon { transform: scale(.96); }
|
||||
|
||||
/* Edit mode: icons stay put, × sits on the icon's top-right corner. */
|
||||
.wb-modules--editing .wb-tile-wrap--edit .wb-tile { cursor: grab; }
|
||||
.wb-modules--editing .wb-tile-wrap--edit.is-dragging .wb-tile { opacity: .45; cursor: grabbing; }
|
||||
.app--shell .app-main .wb-modules--editing .wb-section--operations .wb-tile:hover .wb-card__icon { transform: none; }
|
||||
.app--shell .app-main .wb-tile__remove {
|
||||
position: absolute; top: -2px; left: calc(50% + var(--wb-app-icon) / 2 - 14px); z-index: 2;
|
||||
width: 22px; height: 22px; padding: 0; margin: 0;
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
border: 1px solid var(--nx-line); border-radius: 999px;
|
||||
background: rgb(12 22 36 / .92); color: var(--nx-text-muted); cursor: pointer;
|
||||
}
|
||||
.app--shell .app-main .wb-tile__remove:hover { color: var(--nx-text); border-color: var(--nx-line-strong); }
|
||||
.wb-tile__remove svg { width: 12px; height: 12px; }
|
||||
.wb-modules__tray { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--nx-line-soft); }
|
||||
.wb-modules__tray-label { font-size: 12px; font-weight: 500; color: var(--nx-text-faint); }
|
||||
.app--shell .app-main .wb-tile--available { opacity: .5; }
|
||||
.app--shell .app-main .wb-tile--available:hover { opacity: .85; }
|
||||
.wb-modules__actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
|
||||
|
||||
.wb-section--system { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px; padding-top: 12px; border-top: 1px solid var(--nx-line-soft); }
|
||||
.app--shell .app-main .wb-section--system .wb-tile { width: auto; min-height: 30px; padding: 0 10px 0 6px; flex-direction: row; gap: 6px; border-color: transparent; background: transparent; }
|
||||
.app--shell .app-main .wb-section--system .wb-tile { width: auto; min-height: 30px; padding: 0 10px 0 6px; flex-direction: row; align-items: center; gap: 6px; border-radius: 6px; border-color: transparent; background: transparent; }
|
||||
.app--shell .app-main .wb-section--system .wb-tile { box-shadow: none; }
|
||||
.app--shell .app-main .wb-section--system .wb-tile:hover { background: rgb(255 255 255 / .06); border-color: transparent; box-shadow: none; transform: none; }
|
||||
.wb-section--system .wb-card__icon { width: 20px; height: 20px; border-radius: 0; background: transparent; color: var(--nx-text-faint); }
|
||||
|
|
@ -222,8 +225,6 @@
|
|||
.wb-body { grid-template-columns: minmax(0, 1fr) 280px; }
|
||||
.app--shell .app-main .wb-fleet__card { padding-inline: 18px; }
|
||||
.wb-fleet__viz { gap: 16px; }
|
||||
.app--shell .app-main .wb-section--operations .wb-tile { padding-inline: 10px; }
|
||||
.wb-section--operations .wb-tile__label { font-size: 14px; }
|
||||
.wb-runtime { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 28px; }
|
||||
.wb-runtime__head, .wb-runtime__foot { display: none; }
|
||||
}
|
||||
|
|
@ -231,7 +232,6 @@
|
|||
@media (max-width: 1023px) {
|
||||
.workbench { min-height: 0; }
|
||||
.wb-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
|
||||
.wb-section--operations { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); grid-auto-rows: auto; }
|
||||
.workbench { --wb-tile-h: 96px; }
|
||||
.wb-side { grid-column: 1; grid-row: auto; }
|
||||
.wb-fleet { grid-row: auto; }
|
||||
|
|
@ -246,7 +246,6 @@
|
|||
@media (max-width: 640px) {
|
||||
.app--shell .app-main:has(> .workbench) { padding: 16px var(--nx-gutter); }
|
||||
.workbench { --wb-pad: 16px; }
|
||||
.wb-section--operations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
}
|
||||
|
||||
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue