Add subscription info refresh endpoint and UI stats

This commit is contained in:
2026-07-11 09:49:55 +03:00
parent 6bc7840fb1
commit 99f7f58fcb
8 changed files with 521 additions and 40 deletions

View File

@@ -893,11 +893,12 @@ code, .mono {
text-align: center;
}
.client-power-section > div {
.client-state-copy {
min-height: 54px;
}
.client-power {
position: relative;
width: 96px;
height: 96px;
display: grid;
@@ -907,12 +908,30 @@ code, .mono {
background: transparent;
color: var(--client-muted);
cursor: pointer;
transition: color 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
transition: color 800ms cubic-bezier(0.16, 1, 0.3, 1), opacity 600ms ease, transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.client-power::before {
content: '';
position: absolute;
width: 58px;
height: 58px;
border-radius: 50%;
background: radial-gradient(circle, color-mix(in oklch, var(--client-accent) 42%, transparent), transparent 70%);
opacity: 0;
transform: scale(0.55);
transition: opacity 900ms cubic-bezier(0.16, 1, 0.3, 1), transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
pointer-events: none;
}
.client-power[aria-checked='true']::before {
opacity: 0.75;
transform: scale(1.75);
}
.client-power:hover:not(:disabled) {
transform: translateY(-3px) scale(1.08);
color: var(--client-accent);
color: var(--client-text);
}
.client-power[aria-checked='true'] {
@@ -930,6 +949,7 @@ code, .mono {
}
.client-power svg {
position: relative;
width: 40px;
height: 40px;
fill: none;
@@ -941,15 +961,27 @@ code, .mono {
}
.client-power:hover:not(:disabled) svg {
filter: drop-shadow(0 0 6px color-mix(in oklch, var(--client-muted) 55%, transparent)) drop-shadow(0 0 18px color-mix(in oklch, var(--client-muted) 22%, transparent));
}
.client-power[aria-checked='true']:hover:not(:disabled) {
color: var(--client-accent);
}
.client-power[aria-checked='true']:hover:not(:disabled) svg {
filter: drop-shadow(0 0 6px color-mix(in oklch, var(--client-accent) 75%, transparent)) drop-shadow(0 0 18px color-mix(in oklch, var(--client-accent) 35%, transparent));
}
.client-power:active:not(:disabled) svg {
transform: scale(0.88);
filter: drop-shadow(0 0 10px var(--client-accent)) drop-shadow(0 0 26px color-mix(in oklch, var(--client-accent) 55%, transparent));
filter: drop-shadow(0 0 10px var(--client-muted)) drop-shadow(0 0 26px color-mix(in oklch, var(--client-muted) 45%, transparent));
transition-duration: 220ms;
}
.client-power[aria-checked='true']:active:not(:disabled) svg {
filter: drop-shadow(0 0 10px var(--client-accent)) drop-shadow(0 0 26px color-mix(in oklch, var(--client-accent) 55%, transparent));
}
.client-power[aria-checked='true'] svg {
filter: drop-shadow(0 0 5px color-mix(in oklch, var(--client-accent) 65%, transparent)) drop-shadow(0 0 14px color-mix(in oklch, var(--client-accent) 28%, transparent));
}
@@ -957,11 +989,24 @@ code, .mono {
.client-power-section h2 {
font: 700 18px/1.3 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;
letter-spacing: -0.04em;
animation: client-state-reveal 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.client-state-detail {
min-height: 20px;
display: grid;
place-items: center;
margin-top: 8px;
}
.client-state-detail > * {
grid-area: 1 / 1;
margin: 0;
animation: client-state-reveal 850ms 80ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.client-duration {
display: block;
margin-top: 8px;
color: var(--client-text);
font-size: 14px;
font-variant-numeric: tabular-nums;
@@ -969,8 +1014,13 @@ code, .mono {
}
.client-power-section p {
min-height: 17px;
margin-top: 5px;
min-height: 0;
line-height: 20px;
}
@keyframes client-state-reveal {
0% { opacity: 0; filter: blur(5px); }
100% { opacity: 1; filter: blur(0); }
}
.client-form {
@@ -982,12 +1032,59 @@ code, .mono {
}
.client-subscription {
position: relative;
min-height: 88px;
display: grid;
align-items: center;
justify-items: center;
}
.client-subscription-refresh {
width: 16px;
height: 16px;
display: grid;
place-items: center;
padding: 0;
border: 0;
border-radius: 50%;
background: transparent;
color: var(--client-muted);
cursor: pointer;
transition: color 250ms ease, filter 500ms ease, opacity 300ms ease, transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.client-subscription-refresh svg {
width: 14px;
height: 14px;
fill: none;
stroke: currentColor;
stroke-width: 1.7;
stroke-linecap: round;
stroke-linejoin: round;
}
.client-subscription-refresh:hover:not(:disabled) {
color: var(--client-accent);
filter: drop-shadow(0 0 6px color-mix(in oklch, var(--client-accent) 55%, transparent));
transform: rotate(90deg);
}
.client-subscription-refresh:disabled {
color: var(--client-accent);
cursor: wait;
animation: client-spin 900ms linear infinite;
}
.client-subscription-refresh:focus-visible {
outline: 2px solid var(--client-accent);
outline-offset: 2px;
}
.client-subscription.is-editing .client-subscription-refresh {
opacity: 0;
pointer-events: none;
}
.client-subscription-edit,
.client-subscription-summary {
grid-area: 1 / 1;
@@ -1030,6 +1127,21 @@ code, .mono {
box-shadow: 0 0 8px var(--client-accent), 0 0 18px var(--client-accent-soft);
}
.client-subscription.is-timing-out .client-subscription-edit::after {
animation: client-subscription-timeout 5s linear forwards;
}
@keyframes client-subscription-timeout {
0% {
opacity: 0.9;
box-shadow: 0 0 8px var(--client-accent), 0 0 18px var(--client-accent-soft);
}
100% {
opacity: 0.08;
box-shadow: 0 0 0 transparent;
}
}
.client-subscription.is-editing .client-subscription-edit {
opacity: 1;
filter: blur(0);
@@ -1046,7 +1158,7 @@ code, .mono {
outline: 0;
background: transparent;
color: var(--client-text);
caret-color: var(--client-accent);
caret-color: transparent;
font-size: 12px;
text-align: center;
}
@@ -1094,6 +1206,20 @@ code, .mono {
color: var(--client-accent);
font-size: 19px;
font-weight: 700;
}
.client-subscription-heading {
display: flex;
align-items: center;
gap: 8px;
}
.client-subscription-domain-button {
padding: 0;
border: 0;
background: transparent;
color: inherit;
font: inherit;
cursor: pointer;
}
@@ -1117,13 +1243,13 @@ code, .mono {
pointer-events: none;
}
.client-subscription-summary span {
.client-subscription-heading > span {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.06em;
}
.client-subscription-summary strong {
.client-subscription-domain-button strong {
color: var(--client-text);
font-size: 28px;
font-weight: 600;
@@ -1133,12 +1259,89 @@ code, .mono {
transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1), text-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1), transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.client-subscription-summary:hover strong {
.client-subscription-domain-button:hover strong {
opacity: 1;
transform: translateY(-2px);
text-shadow: 0 0 28px oklch(0.7 0.08 151 / 0.42);
}
.client-usage {
width: min(100%, 250px);
display: grid;
gap: 7px;
margin: -10px auto 0;
color: var(--client-muted);
text-align: center;
}
.client-usage > span {
font-size: 9px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
}
@keyframes client-spin {
to { transform: rotate(360deg); }
}
.client-usage > strong {
color: var(--client-text);
font-size: 14px;
font-weight: 600;
transition: color 700ms ease, filter 700ms ease, text-shadow 700ms ease;
}
.client-usage.is-updated {
animation: client-usage-glow 1100ms cubic-bezier(0.16, 1, 0.3, 1);
}
.client-usage.is-updated > strong {
color: var(--client-accent);
filter: brightness(1.25);
text-shadow: 0 0 8px var(--client-accent), 0 0 22px color-mix(in oklch, var(--client-accent) 70%, transparent);
}
.client-usage.is-updated .client-usage-bar i {
animation: client-bar-flare 1100ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes client-usage-glow {
30% { filter: drop-shadow(0 0 18px color-mix(in oklch, var(--client-accent) 78%, transparent)); }
}
@keyframes client-bar-flare {
30% { box-shadow: 0 0 6px var(--client-accent), 0 0 20px var(--client-accent); filter: brightness(1.45); }
}
.client-usage > strong small {
color: var(--client-muted);
font-size: 10px;
font-weight: 500;
}
.client-usage-bar {
height: 2px;
overflow: hidden;
background: var(--client-border);
}
.client-usage-bar i {
display: block;
height: 100%;
background: var(--client-accent);
box-shadow: 0 0 8px var(--client-accent);
transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.client-usage-details {
display: flex;
justify-content: center;
gap: 12px;
font-size: 9px;
white-space: nowrap;
}
.client-servers {
display: block;
}
@@ -1166,9 +1369,44 @@ code, .mono {
color: var(--client-text);
text-align: center;
cursor: pointer;
animation: client-server-enter 760ms calc(var(--server-index) * 110ms) cubic-bezier(0.16, 1, 0.3, 1) both;
transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.client-server-grid.is-leaving {
pointer-events: none;
}
.client-server-grid.is-leaving .client-server {
animation: client-server-leave 420ms calc(var(--server-index) * 90ms) cubic-bezier(0.4, 0, 1, 1) forwards;
}
@keyframes client-server-leave {
0% {
opacity: 1;
filter: blur(0);
transform: translateY(0);
}
100% {
opacity: 0;
filter: blur(3px);
transform: translateY(8px);
}
}
@keyframes client-server-enter {
0% {
opacity: 0;
filter: blur(3px);
transform: translateY(-8px);
}
100% {
opacity: 1;
filter: blur(0);
transform: translateY(0);
}
}
.client-server:hover:not(:disabled) {
transform: translateY(-2px);
background: transparent;
@@ -1209,7 +1447,7 @@ code, .mono {
}
.client-subscription-edit button:focus-visible,
.client-subscription-summary:focus-visible,
.client-subscription-domain-button:focus-visible,
.client-server:focus-visible,
.client-power:focus-visible {
outline: 2px solid var(--client-accent);
@@ -1259,9 +1497,26 @@ code, .mono {
transition: color 220ms ease, opacity 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.client-copy-check {
.client-copy-label {
transition: opacity 100ms ease;
}
.client-proxies button.is-copied .client-copy-label {
opacity: 0;
}
.client-copy-feedback {
position: absolute;
right: 10px;
inset: 0;
display: grid;
place-items: center;
color: var(--client-accent);
animation: client-copy-fade 800ms cubic-bezier(0.4, 0, 1, 1) forwards;
}
@keyframes client-copy-fade {
0%, 18% { opacity: 1; filter: drop-shadow(0 0 5px var(--client-accent)); }
100% { opacity: 0; filter: drop-shadow(0 0 0 transparent); }
}
.client-proxies button:hover {
@@ -1320,13 +1575,26 @@ code, .mono {
@media (prefers-reduced-motion: reduce) {
.client-power,
.client-power::before,
.client-power svg,
.client-usage-bar i,
.client-subscription-refresh,
.client-usage,
.client-usage > strong,
.client-server,
.client-proxies button,
.client-copy-feedback,
.client-subscription-edit,
.client-subscription-edit::after,
.client-subscription-summary,
.client-subscription-summary strong {
transition: none;
animation: none;
}
.client-state-copy h2,
.client-state-detail > * {
animation: none;
}
}