Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

style(app): style the account switcher overlay, grid and tiles

Hampus8f583258f844
diff --git a/fluxer_app/src/features/auth/components/accounts/account_switcher/AccountSwitcherGrid.module.css b/fluxer_app/src/features/auth/components/accounts/account_switcher/AccountSwitcherGrid.module.css
new file mode 100644
index 000000000..08dcf6da2
--- /dev/null
+++ b/fluxer_app/src/features/auth/components/accounts/account_switcher/AccountSwitcherGrid.module.css
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
+
+.grid {
+ display: flex;
+ width: 100%;
+ max-width: calc(var(--tile) * 6 + var(--switcher-column-gap) * 5);
+ box-sizing: border-box;
+ flex-wrap: wrap;
+ justify-content: center;
+ column-gap: var(--switcher-column-gap);
+ row-gap: var(--switcher-row-gap);
+ margin: 0 auto;
+ padding: 0;
+ list-style: none;
+}
diff --git a/fluxer_app/src/features/auth/components/accounts/account_switcher/AccountSwitcherOverlay.module.css b/fluxer_app/src/features/auth/components/accounts/account_switcher/AccountSwitcherOverlay.module.css
new file mode 100644
index 000000000..312ca1164
--- /dev/null
+++ b/fluxer_app/src/features/auth/components/accounts/account_switcher/AccountSwitcherOverlay.module.css
@@ -0,0 +1,333 @@
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
+
+.root {
+ --switcher-stage: color-mix(in srgb, var(--background-primary) 30%, rgb(0 0 0) 70%);
+ --switcher-scrim: rgb(0 0 0 / 0.66);
+ --switcher-text: var(--text-on-dark, #fff);
+ --switcher-text-muted: color-mix(in srgb, var(--switcher-text) 62%, transparent);
+ --switcher-dashed: color-mix(in srgb, var(--switcher-text) 36%, transparent);
+ --switcher-hover-scale: 1.04;
+ --switcher-motion-ms: 140ms;
+ --switcher-busy-duration: 1s;
+ --switcher-column-gap: clamp(1rem, 2vw, 2rem);
+ --switcher-row-gap: clamp(1.25rem, 3vh, 2.25rem);
+ --tile: clamp(6.5rem, 4.75rem + 5vw, 9.75rem);
+
+ position: fixed;
+ inset: 0;
+ isolation: isolate;
+ color: var(--switcher-text);
+}
+
+.root[data-reduced-motion='true'] {
+ --switcher-hover-scale: 1;
+ --switcher-motion-ms: 0ms;
+ --switcher-busy-duration: 2.4s;
+}
+
+.backdrop {
+ position: absolute;
+ inset: 0;
+ z-index: 0;
+ background: var(--switcher-stage);
+}
+
+.dialog {
+ position: relative;
+ z-index: 1;
+ display: flex;
+ width: 100%;
+ height: 100%;
+ box-sizing: border-box;
+ align-items: center;
+ justify-content: center;
+ padding: calc(clamp(1.5rem, 5vh, 4rem) + env(safe-area-inset-top, 0px))
+ calc(clamp(1rem, 4vw, 3rem) + env(safe-area-inset-right, 0px))
+ calc(clamp(1.5rem, 5vh, 4rem) + env(safe-area-inset-bottom, 0px))
+ calc(clamp(1rem, 4vw, 3rem) + env(safe-area-inset-left, 0px));
+ outline: none;
+}
+
+.view {
+ display: flex;
+ width: 100%;
+ max-width: 76rem;
+ max-height: 100%;
+ min-height: 0;
+ flex-direction: column;
+ align-items: center;
+}
+
+.stage {
+ display: flex;
+ width: 100%;
+ min-height: 0;
+ flex: 0 1 auto;
+ flex-direction: column;
+ align-items: center;
+ gap: clamp(1rem, 2.5vh, 2rem);
+}
+
+.header {
+ display: flex;
+ flex: 0 0 auto;
+ max-width: 40rem;
+ flex-direction: column;
+ align-items: center;
+ gap: 0.5rem;
+ text-align: center;
+}
+
+.heading {
+ margin: 0;
+ color: var(--switcher-text);
+ font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
+ font-weight: 700;
+ letter-spacing: -0.01em;
+ line-height: 1.2;
+}
+
+.subline {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: center;
+ gap: 0.25rem 0.3em;
+ margin: 0;
+ color: var(--switcher-text-muted);
+ font-size: 0.9375rem;
+ line-height: 1.375rem;
+}
+
+.sublineShortcut {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.375rem;
+}
+
+.search {
+ display: flex;
+ flex: 0 0 auto;
+ width: min(100%, 22rem);
+ height: 2.75rem;
+ box-sizing: border-box;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 0 1rem 0 0.875rem;
+ border: 0.0625rem solid color-mix(in srgb, var(--switcher-text) 18%, transparent);
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--switcher-text) 8%, transparent);
+ transition:
+ border-color 100ms ease,
+ background-color 100ms ease;
+}
+
+.search:focus-within {
+ border-color: color-mix(in srgb, var(--switcher-text) 48%, transparent);
+ background: color-mix(in srgb, var(--switcher-text) 12%, transparent);
+}
+
+.searchIcon {
+ flex: 0 0 auto;
+ color: var(--switcher-text-muted);
+ transition: color 100ms ease;
+}
+
+.search:focus-within .searchIcon {
+ color: var(--switcher-text);
+}
+
+.searchInput {
+ width: 100%;
+ min-width: 0;
+ height: 100%;
+ flex: 1 1 auto;
+ padding: 0;
+ border: 0;
+ background: transparent;
+ color: var(--switcher-text);
+ font: inherit;
+ font-size: 0.9375rem;
+ outline: none;
+}
+
+.searchInput::placeholder {
+ color: var(--switcher-text-muted);
+}
+
+@property --switcher-fade-top {
+ syntax: '<length>';
+ inherits: false;
+ initial-value: 0px;
+}
+
+@property --switcher-fade-bottom {
+ syntax: '<length>';
+ inherits: false;
+ initial-value: 0px;
+}
+
+.stage .scroller {
+ width: 100%;
+ height: auto;
+ min-height: 0;
+ align-self: stretch;
+ mask-image: linear-gradient(
+ to bottom,
+ transparent 0,
+ #000 var(--switcher-fade-top),
+ #000 calc(100% - var(--switcher-fade-bottom)),
+ transparent 100%
+ );
+ animation:
+ switcher-fade-top linear both,
+ switcher-fade-bottom linear both;
+ animation-timeline: scroll(self), scroll(self);
+ animation-range:
+ 0 3rem,
+ calc(100% - 3rem) 100%;
+}
+
+@keyframes switcher-fade-top {
+ from {
+ --switcher-fade-top: 0px;
+ }
+
+ to {
+ --switcher-fade-top: 3rem;
+ }
+}
+
+@keyframes switcher-fade-bottom {
+ from {
+ --switcher-fade-bottom: 3rem;
+ }
+
+ to {
+ --switcher-fade-bottom: 0px;
+ }
+}
+
+.scrollerContent {
+ flex: 0 0 auto;
+ padding: 1rem 0.75rem 1.25rem;
+}
+
+.empty {
+ margin: 0;
+ padding: 2rem 1rem;
+ color: var(--switcher-text-muted);
+ font-size: 0.9375rem;
+ text-align: center;
+}
+
+.srOnly {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ overflow: hidden;
+ clip-path: inset(50%);
+ white-space: nowrap;
+}
+
+.actions {
+ display: flex;
+ flex: 0 0 auto;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: center;
+ gap: 0.75rem;
+}
+
+.card {
+ display: flex;
+ width: min(100%, 30rem);
+ max-height: min(100%, 52rem);
+ min-height: 0;
+ box-sizing: border-box;
+ flex-direction: column;
+ border: 0.0625rem solid var(--background-modifier-accent);
+ border-radius: 1rem;
+ background: var(--background-primary);
+ box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.45);
+ color: var(--text-primary);
+ overflow: hidden;
+}
+
+.cardHeader {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 1rem 1.25rem 0.25rem 0.75rem;
+}
+
+.cardTitle {
+ min-width: 0;
+ margin: 0;
+ overflow: hidden;
+ color: var(--text-primary);
+ font-size: 1.25rem;
+ font-weight: 700;
+ line-height: 1.75rem;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.backButton {
+ display: inline-flex;
+ width: 2.25rem;
+ height: 2.25rem;
+ flex: 0 0 auto;
+ align-items: center;
+ justify-content: center;
+ padding: 0;
+ border: 0;
+ border-radius: 50%;
+ background: transparent;
+ color: var(--text-secondary);
+ cursor: pointer;
+}
+
+:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
+ .backButton:hover {
+ background: var(--background-modifier-hover);
+ color: var(--text-primary);
+}
+
+.cardBody {
+ min-height: 0;
+ flex: 1 1 auto;
+}
+
+.cardBodyContent {
+ padding: 0.5rem 1.25rem 1.5rem;
+}
+
+@media (hover: none) and (pointer: coarse) {
+ .sublineKeys {
+ display: none;
+ }
+}
+
+@media (max-width: 42rem) {
+ .root {
+ --tile: clamp(5.75rem, 26vw, 7.5rem);
+ --switcher-column-gap: 1rem;
+ }
+
+ .heading {
+ font-size: 1.5rem;
+ }
+
+ .dialog {
+ align-items: stretch;
+ }
+
+ .view {
+ justify-content: center;
+ }
+
+ .card {
+ width: 100%;
+ }
+}
diff --git a/fluxer_app/src/features/auth/components/accounts/account_switcher/AccountSwitcherTile.module.css b/fluxer_app/src/features/auth/components/accounts/account_switcher/AccountSwitcherTile.module.css
new file mode 100644
index 000000000..27ecf4832
--- /dev/null
+++ b/fluxer_app/src/features/auth/components/accounts/account_switcher/AccountSwitcherTile.module.css
@@ -0,0 +1,322 @@
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
+
+.slot {
+ display: flex;
+ width: var(--tile);
+ min-width: 0;
+ flex: 0 0 var(--tile);
+ justify-content: center;
+ transition: opacity 140ms ease;
+}
+
+.slotDimmed {
+ opacity: 0.5;
+}
+
+.slotDragging {
+ opacity: 0.35;
+}
+
+.tile {
+ position: relative;
+ display: flex;
+ width: var(--tile);
+ min-width: 0;
+ flex-direction: column;
+ align-items: center;
+ gap: 0;
+ padding: 0;
+ border: 0;
+ border-radius: 1.25rem;
+ background: transparent;
+ scroll-margin-block: 3rem;
+ color: var(--switcher-text);
+ cursor: pointer;
+ font: inherit;
+ outline: none;
+ text-align: center;
+ -webkit-tap-highlight-color: transparent;
+}
+
+.tile:disabled {
+ cursor: default;
+}
+
+.avatarFrame {
+ --instance-badge-size: max(1.75rem, calc(var(--tile) * 0.3));
+ --status-badge-size: max(1.625rem, calc(var(--tile) * 0.22));
+ --badge-inset: -0.375rem;
+
+ position: relative;
+ display: block;
+ width: var(--tile);
+ height: var(--tile);
+ flex: 0 0 auto;
+ border-radius: 22%;
+ transform: scale(1);
+ transition: transform var(--switcher-motion-ms) ease;
+}
+
+.avatarClip {
+ position: absolute;
+ inset: 0;
+ display: block;
+ overflow: hidden;
+ border-radius: inherit;
+ background: var(--background-tertiary);
+}
+
+.cutoutDefs {
+ position: absolute;
+ width: 0;
+ height: 0;
+ overflow: hidden;
+ pointer-events: none;
+}
+
+.avatar {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ user-select: none;
+}
+
+:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
+ .tile:not(:disabled, .tileStill):hover
+ .avatarFrame,
+.tile:not(.tileStill)[data-context-menu-open] .avatarFrame {
+ transform: scale(var(--switcher-hover-scale));
+}
+
+.tileExpired .avatarClip {
+ filter: grayscale(1);
+ opacity: 0.7;
+}
+
+.manageOverlay {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--switcher-scrim);
+ color: var(--switcher-text);
+}
+
+.manageOverlay svg {
+ width: 28%;
+ height: 28%;
+}
+
+.busyRing {
+ position: absolute;
+ inset: -0.5rem;
+ width: calc(100% + 1rem);
+ height: calc(100% + 1rem);
+ overflow: visible;
+ pointer-events: none;
+}
+
+.busyRing rect {
+ fill: none;
+ stroke: var(--switcher-text);
+ stroke-dasharray: 22 78;
+ stroke-linecap: round;
+ stroke-width: 2;
+ vector-effect: non-scaling-stroke;
+ animation: busy-ring var(--switcher-busy-duration) linear infinite;
+}
+
+@keyframes busy-ring {
+ from {
+ stroke-dashoffset: 100;
+ }
+
+ to {
+ stroke-dashoffset: 0;
+ }
+}
+
+.cornerBadge {
+ position: absolute;
+ z-index: 2;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+}
+
+.instanceBadge {
+ position: absolute;
+ top: var(--badge-inset);
+ inset-inline-end: var(--badge-inset);
+ z-index: 2;
+ display: inline-flex;
+ width: var(--instance-badge-size);
+ height: var(--instance-badge-size);
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ border-radius: 50%;
+ background: color-mix(in srgb, var(--switcher-text) 14%, var(--switcher-stage));
+ overflow: hidden;
+ color: var(--switcher-text);
+}
+
+.instanceBadge svg {
+ display: block;
+ width: 62%;
+ height: 62%;
+}
+
+.instanceBadge img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+
+.instanceTooltip {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.25rem;
+}
+
+.instanceTooltipLabel {
+ min-width: 0;
+ color: var(--text-primary);
+ font-weight: 600;
+}
+
+.instanceTooltipOfficial {
+ display: inline-flex;
+ flex: 0 0 auto;
+ align-items: center;
+ justify-content: center;
+ color: var(--status-online);
+}
+
+.mentionBadge {
+ bottom: var(--badge-inset);
+ inset-inline-end: var(--badge-inset);
+ border-radius: 0.375rem;
+}
+
+.currentBadge {
+ top: calc(var(--badge-inset) + (var(--instance-badge-size) - var(--status-badge-size)) / 2);
+ inset-inline-start: calc(var(--badge-inset) + (var(--instance-badge-size) - var(--status-badge-size)) / 2);
+ width: var(--status-badge-size);
+ height: var(--status-badge-size);
+ border-radius: 50%;
+ background: var(--switcher-text);
+ color: var(--switcher-stage);
+}
+
+.currentBadge svg {
+ width: 60%;
+ height: 60%;
+}
+
+.unreadDot {
+ bottom: -0.1875rem;
+ inset-inline-end: -0.1875rem;
+ width: 0.875rem;
+ height: 0.875rem;
+ border-radius: 50%;
+ background: var(--switcher-text);
+}
+
+.expiredBadge {
+ bottom: var(--badge-inset);
+ inset-inline-end: var(--badge-inset);
+ width: var(--status-badge-size);
+ height: var(--status-badge-size);
+ border-radius: 50%;
+ background: var(--status-danger);
+ color: var(--switcher-text);
+}
+
+.expiredBadge svg {
+ width: 70%;
+ height: 70%;
+}
+
+.name {
+ display: block;
+ max-width: calc(var(--tile) * 1.15);
+ margin-top: 0.875rem;
+ overflow: hidden;
+ color: var(--switcher-text);
+ font-size: 1rem;
+ font-weight: 600;
+ line-height: 1.375rem;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.secondLine {
+ display: block;
+ min-height: 1.125rem;
+ max-width: calc(var(--tile) * 1.15);
+ margin-top: 0.125rem;
+ overflow: hidden;
+ color: var(--switcher-text-muted);
+ font-size: 0.8125rem;
+ line-height: 1.125rem;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.secondLineWarning {
+ color: var(--status-warning);
+}
+
+.secondLineDanger {
+ color: color-mix(in srgb, var(--status-danger) 70%, var(--switcher-text));
+}
+
+.tileAdd .name {
+ display: -webkit-box;
+ color: var(--switcher-text-muted);
+ text-wrap: balance;
+ white-space: normal;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+}
+
+.addFrame {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ border: 0.125rem dashed var(--switcher-dashed);
+ background: transparent;
+ color: var(--switcher-text-muted);
+ transition:
+ background-color 140ms ease,
+ border-color 140ms ease,
+ color 140ms ease,
+ transform var(--switcher-motion-ms) ease;
+}
+
+.addFrame svg {
+ width: 32%;
+ height: 32%;
+}
+
+:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
+ .tileAdd:not(:disabled):hover
+ .addFrame,
+.tileAdd:focus-visible .addFrame {
+ border-style: solid;
+ border-color: var(--switcher-text-muted);
+ background: color-mix(in srgb, var(--switcher-text) 8%, transparent);
+ color: var(--switcher-text);
+}
+
+:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
+ .tileAdd:not(:disabled):hover
+ .name {
+ color: var(--switcher-text);
+}