feat(n7web): add pet settings and day night themes

This commit is contained in:
Miayui
2026-09-14 17:12:08 +08:00
parent aa6f59d3a6
commit 58f1a2da42
13 changed files with 901 additions and 114 deletions
+294 -6
View File
@@ -3985,15 +3985,12 @@ form > .v2-extension-primary {
/* Durable NFC pet cards ------------------------------------------------- */
.v2-extension-sync-mount {
grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}
.console-v2 #v2ExtensionPanel .v2-extension-sync-mount {
overflow-x: hidden;
overflow-y: auto;
overscroll-behavior-y: contain;
scrollbar-gutter: stable;
touch-action: pan-y;
overflow-y: hidden;
}
.v2-pet-card-region {
@@ -4466,7 +4463,8 @@ form > .v2-extension-primary {
.v2-nfc-no-pets {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
grid-template-columns: auto minmax(0, 1fr) auto;
align-items: center;
}
.v2-nfc-body > .v2-nfc-existing {
@@ -4525,4 +4523,294 @@ form > .v2-extension-primary {
.v2-nfc-body > .v2-nfc-existing button {
width: 100%;
}
.v2-nfc-no-pets {
grid-template-columns: auto minmax(0, 1fr);
}
.v2-nfc-no-pets > button {
grid-column: 1 / -1;
width: 100%;
}
}
/* Pet settings dialog and detected-pet presence ------------------------ */
.v2-extension-sync-actions {
min-width: 0;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 6px;
}
.v2-pet-settings-launch {
min-height: 25px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 5px;
padding: 4px 8px;
color: var(--primary-foreground);
background: var(--primary);
border: 1px solid var(--primary);
border-radius: var(--ui-radius-control-inner, 7px);
box-shadow: inset 0 1px 0 color-mix(in oklch, white 24%, transparent);
font-size: 7.5px;
font-weight: 850;
white-space: nowrap;
cursor: pointer;
}
.v2-pet-settings-launch:is(:hover, :focus-visible) {
background: color-mix(in oklch, var(--primary) 86%, var(--foreground));
}
.v2-pet-settings-launch svg {
width: 13px;
height: 13px;
}
.v2-extension-device-list {
min-height: 0;
max-height: none;
display: grid;
grid-auto-rows: max-content;
align-content: start;
gap: 8px;
overflow-x: hidden;
overflow-y: auto;
overscroll-behavior-y: contain;
scrollbar-gutter: stable;
touch-action: pan-y;
}
.v2-pet-settings-dialog {
width: min(760px, calc(100vw - 32px));
height: min(760px, calc(100dvh - 32px));
max-height: calc(100dvh - 32px);
overflow: hidden;
}
.v2-pet-settings-dialog[open] {
display: grid;
grid-template-rows: auto minmax(0, 1fr) auto;
}
.v2-pet-settings-body {
min-height: 0;
padding: 16px;
overflow: hidden;
}
.v2-pet-settings-body .v2-pet-card-region {
height: 100%;
grid-template-rows: auto minmax(0, 1fr);
}
.v2-pet-settings-body .v2-pet-card-list {
padding-right: 4px;
overflow-x: hidden;
overflow-y: auto;
overscroll-behavior-y: contain;
scrollbar-gutter: stable;
touch-action: pan-y;
}
.v2-pet-settings-footnote {
min-height: 48px;
display: flex;
align-items: center;
gap: 8px;
padding: 11px 18px;
color: var(--muted-foreground);
background: color-mix(in oklch, var(--popover) 92%, transparent);
border-top: 1px solid var(--border);
font-size: 10px;
line-height: 1.45;
}
.v2-pet-settings-footnote svg {
width: 15px;
height: 15px;
flex: none;
color: var(--primary);
}
.v2-pet-presence-card {
min-width: 0;
position: relative;
isolation: isolate;
display: grid;
gap: 11px;
padding: 12px;
color: var(--card-foreground);
background:
linear-gradient(145deg, color-mix(in oklch, var(--card) 82%, transparent), color-mix(in oklch, var(--primary) 10%, transparent));
border: 1px solid color-mix(in oklch, var(--primary) 28%, var(--border));
border-radius: var(--ui-radius-item, 12px);
box-shadow:
0 10px 26px color-mix(in oklch, var(--foreground) 8%, transparent),
inset 0 1px 0 color-mix(in oklch, white 28%, transparent);
-webkit-backdrop-filter: blur(16px) saturate(1.24);
backdrop-filter: blur(16px) saturate(1.24);
}
.v2-pet-presence-card::before {
content: "";
position: absolute;
inset: 0;
z-index: -1;
border-radius: inherit;
pointer-events: none;
background: radial-gradient(circle at 10% 0%, color-mix(in oklch, white 24%, transparent), transparent 42%);
}
.v2-pet-presence-card > header {
min-width: 0;
display: grid;
grid-template-columns: 38px minmax(0, 1fr) auto;
align-items: center;
gap: 10px;
}
.v2-pet-presence-card > header > span {
width: 38px;
height: 38px;
display: grid;
place-items: center;
color: var(--primary);
background: var(--accent);
border: 1px solid color-mix(in oklch, var(--primary) 24%, var(--border));
border-radius: 11px;
}
.v2-pet-presence-card > header > span svg {
width: 18px;
height: 18px;
}
.v2-pet-presence-card > header > div {
min-width: 0;
display: grid;
gap: 2px;
}
.v2-pet-presence-card > header small,
.v2-pet-presence-card dt {
color: var(--muted-foreground);
font-size: 9px;
font-weight: 750;
}
.v2-pet-presence-card > header strong {
overflow: hidden;
color: var(--heading-foreground);
font-size: 15px;
font-weight: 850;
text-overflow: ellipsis;
white-space: nowrap;
}
.v2-pet-presence-card > header > b {
padding: 5px 8px;
color: var(--status-success-foreground);
background: var(--status-success-soft);
border: 1px solid color-mix(in oklch, var(--status-success) 28%, var(--border));
border-radius: 999px;
font-size: 9px;
white-space: nowrap;
}
.v2-pet-presence-card > header > b[data-state="error"] {
color: var(--status-error-foreground);
background: var(--status-error-soft);
border-color: color-mix(in oklch, var(--status-error) 28%, var(--border));
}
.v2-pet-presence-card dl {
min-width: 0;
display: grid;
gap: 7px;
margin: 0;
}
.v2-pet-presence-card dl > div {
min-width: 0;
display: grid;
grid-template-columns: 72px minmax(0, 1fr);
align-items: baseline;
gap: 8px;
}
.v2-pet-presence-card dd {
min-width: 0;
margin: 0;
overflow: hidden;
color: var(--foreground);
font-size: 11px;
font-weight: 720;
text-overflow: ellipsis;
white-space: nowrap;
}
.v2-pet-presence-card code {
color: var(--primary);
font: 750 10px/1.4 "SFMono-Regular", Consolas, monospace;
}
.v2-pet-presence-card > footer {
min-width: 0;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding-top: 9px;
color: var(--muted-foreground);
border-top: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
font-size: 9px;
}
.v2-pet-presence-card > footer span {
min-width: 0;
display: inline-flex;
align-items: center;
gap: 5px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.v2-pet-presence-card > footer svg {
width: 13px;
height: 13px;
flex: none;
color: var(--primary);
}
.v2-pet-presence-card > footer strong {
flex: none;
color: var(--foreground);
font-size: 9px;
}
@media (max-width: 720px) {
.v2-extension-sync-heading > div:first-child {
grid-template-columns: minmax(0, 1fr);
align-items: start;
}
.v2-extension-sync-actions {
justify-content: flex-start;
flex-wrap: wrap;
}
.v2-pet-settings-dialog {
width: calc(100vw - 16px);
height: calc(100dvh - 16px);
max-height: calc(100dvh - 16px);
}
.v2-pet-settings-body {
padding: 10px;
}
}