@import "../../styles/mixins"; @mixin mobile-header-styles() { .HeaderPinnedMessage-wrapper, .AudioPlayer { position: absolute; top: 100%; left: 0; right: 0; height: 2.875rem; box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow); display: flex; flex-direction: row-reverse; padding-top: 0.375rem; padding-bottom: 0.375rem; padding-left: max(0.75rem, env(safe-area-inset-left)); padding-right: max(0.5rem, env(safe-area-inset-right)); background: var(--color-background); &::before { content: ""; display: block; position: absolute; top: -0.1875rem; left: 0; right: 0; height: 0.125rem; box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow); } .HeaderPinnedMessage { max-width: unset; margin-top: -0.1875rem; } } .AudioPlayer { flex-direction: row; margin-top: 0; padding: 0.25rem 0.5rem; &-content { padding: 0 0.5rem; flex-grow: 1; } > .Button { margin: -0.0625rem 0 0; } > .player-close { margin-left: auto; } } .HeaderPinnedMessage { flex-grow: 1; padding-top: 0; padding-bottom: 0; &::before { top: 0.125rem; bottom: 0.125rem; } .message-text { max-width: none; } } .HeaderPinnedMessage-wrapper.full-width { display: none; } } .MiddleHeader { display: flex; align-items: center; width: 100%; box-shadow: 0 2px 2px var(--color-light-shadow); background: var(--color-background); position: relative; z-index: var(--z-middle-header); padding-top: 0.5rem; padding-bottom: 0.5rem; padding-left: max(1.5rem, env(safe-area-inset-left)); padding-right: max(0.8125rem, env(safe-area-inset-right)); @media (max-width: 600px) { position: relative; padding-left: max(0.5rem, env(safe-area-inset-left)); padding-right: max(0.5rem, env(safe-area-inset-right)); } .Transition { width: 100%; // https://dfmcphee.com/flex-items-and-min-width-0/ // https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size min-width: 0; > div { display: flex; align-items: center; width: 100%; } } .back-button { margin-left: -0.5rem; margin-right: 0.5rem; position: relative; @media (max-width: 600px) { margin-left: 0; } .unread-count { min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; border-radius: 0.625rem; font-size: 0.75rem; line-height: 1.25rem; font-weight: 500; text-align: center; position: absolute; top: -0.25rem; right: -0.5rem; background: var(--color-gray); color: white; pointer-events: none; &.active { background: var(--color-primary); } } } .chat-info-wrapper { flex-grow: 1; overflow: hidden; } body.animation-level-0 & .HeaderPinnedMessage-wrapper { transition: none !important; } .header-tools { display: flex; align-items: center; justify-content: flex-end; margin-left: auto; flex-shrink: 0; body.animation-level-0 & { &, .AudioPlayer, .HeaderActions { transition: none !important; } } @media (min-width: 1276px) and (max-width: 1439px) { .HeaderActions { transform: translate3d(0, 0, 0); transition: transform var(--layer-transition); #Main.right-column-open & { transform: translate3d(calc(var(--right-column-width) * -1), 0, 0); } } } @media (min-width: 1440px) { transform: translate3d(0, 0, 0); transition: transform var(--layer-transition); #Main.right-column-open & { transform: translate3d(calc(var(--right-column-width) * -1), 0, 0); } } // @optimization #Main.right-column-animating & { pointer-events: none; } } @media (min-width: 1276px) and (max-width: 1439px) { &:not(.tools-stacked) .HeaderPinnedMessage-wrapper, &:not(.tools-stacked) .AudioPlayer { opacity: 1; #Main.right-column-open & { opacity: 0; } } } &.tools-stacked .AudioPlayer { @include mobile-header-styles(); @media (min-width: 1150px) { #Main.right-column-open & { padding-right: calc(0.5rem + var(--right-column-width)); } } } &.tools-stacked.animated .HeaderPinnedMessage-wrapper, &.tools-stacked.animated .AudioPlayer { animation: fade-in var(--layer-transition) forwards; body.animation-level-0 & { animation: none; } } h3 { font-weight: 500; font-size: 1.125rem; line-height: 1.375rem; white-space: pre; margin: 0; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; body.is-ios &, body.is-macos & { font-size: 1.0625rem; font-weight: 600; } @media (max-width: 600px) { display: block; overflow: hidden; text-overflow: ellipsis; } @media (min-width: 1275px) { #Main.right-column-open & { max-width: calc(100% - var(--right-column-width)); } } } .ChatInfo { cursor: pointer; display: flex; align-items: center; @media (max-width: 600px) { user-select: none; } .info { display: flex; flex-direction: column; justify-content: center; flex-grow: 1; overflow: hidden; } .title { display: flex; align-items: center; .VerifiedIcon { width: 1.25rem; height: 1.25rem; } .VerifiedIcon, .PremiumIcon { margin-left: 0.25rem; margin-top: 0.0625rem; } } .status, .typing-status { display: inline; unicode-bidi: plaintext; @media (min-width: 1275px) { #Main.right-column-open & { max-width: calc(100% - var(--right-column-width)); } } } .user-status { unicode-bidi: plaintext; overflow: hidden; text-overflow: ellipsis; @media (min-width: 1275px) { #Main.right-column-open & { max-width: calc(100% - var(--right-column-width)); } } } } .Avatar { margin-right: 0.625rem; // TODO For some reason webpack imports `Audio.scss` second time when loading calls bundle width: 2.5rem !important; height: 2.5rem !important; font-size: 1.0625rem; } .status, .typing-status { font-size: 0.875rem; line-height: 1.125rem; margin: 0; color: var(--color-text-secondary); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-block; .ellipsis { display: inline-flex; } &.online { color: var(--color-primary); } .font-emoji { line-height: 1rem; } } .Button.smaller { width: 2.5rem; height: 2.5rem; } .HeaderPinnedMessage-wrapper { display: flex; align-items: center; margin-left: auto; cursor: default; flex-direction: row-reverse; background: var(--color-background); body.animation-level-1 & { .ripple-container { display: none; } } @media (min-width: 1276px) { transform: translate3d(0, 0, 0); transition: opacity 0.15s ease, transform var(--layer-transition); #Main.right-column-open & { transform: translate3d(calc(var(--right-column-width) * -1), 0, 0); } } > .Button { flex-shrink: 0; } &.full-width { position: absolute; left: 0; right: 0; top: 100%; background: var(--color-background); padding: 0.25rem 0.8125rem 0.25rem 1rem; box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow); transform: translate3d(0, 0, 0); transition: opacity 0.15s ease, transform var(--layer-transition); &::before { content: ""; display: block; position: absolute; top: -0.1875rem; left: 0; right: 0; height: 0.125rem; box-shadow: 0 0.125rem 0.125rem var(--color-light-shadow); } .HeaderPinnedMessage { margin-top: 0; margin-bottom: 0; flex: 1; .message-text { max-width: none; } } @media (min-width: 1276px) { transform: translate3d(0, 0, 0); transition: opacity 0.15s ease, transform var(--layer-transition); #Main.right-column-open & { padding-left: calc(var(--right-column-width) + 1rem); } } } } .HeaderPinnedMessage { display: flex; flex-shrink: 1; margin-top: -0.25rem; margin-bottom: -0.25rem; padding: 0.25rem; padding-left: 0.375rem; border-radius: var(--border-radius-messages-small); position: relative; overflow: hidden; cursor: pointer; align-items: center; &:hover:not(.no-hover) { background-color: var(--color-interactive-element-hover); } .pinned-message-border { position: relative; height: 2.25rem; margin: 0.125rem 0; width: 0.125rem; min-width: 0.125rem; overflow: hidden; .pinned-message-border-wrapper-1 { height: 2.25rem; width: 0.125rem; border-radius: 0.0625rem; background: var(--color-primary); } .pinned-message-border-wrapper { background-color: var(--color-primary-opacity); position: relative; will-change: transform; transition: transform 0.25s ease-in-out; } .pinned-message-border-mark { position: absolute; left: 0; top: 0; width: 0.125rem; background: var(--color-primary); border-radius: 0.0625rem; will-change: transform; transition: transform 0.25s ease-in-out; } } .message-text { overflow: hidden; margin-inline-start: 0.375rem; margin-top: 0.125rem; max-width: 15rem; min-width: 8rem; flex-grow: 1; @media (min-width: 1440px) and (max-width: 1500px) { max-width: 14rem; } .title { font-weight: 500; font-size: 0.875rem; line-height: 1rem; height: 1rem; color: var(--color-primary); margin-bottom: 0.125rem; white-space: pre; text-align: initial; body.is-ios & { font-size: 0.9375rem; } } p { font-size: 0.875rem; line-height: 1.125rem; height: 1.125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; body.is-ios & { font-size: 0.9375rem; } } } .inline-button { display: block; width: auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 1.5rem; padding: 0 0.75rem; font-weight: 500; text-transform: none; height: 2rem; max-width: 10rem; flex-shrink: 1; } .emoji-small { width: 1rem; height: 1rem; } & > img { width: 2.25rem; height: 2.25rem; object-fit: cover; border-radius: 0.25rem; margin-inline-start: 0.375rem; margin-top: 0.125rem; flex-shrink: 0; & + .message-text { max-width: 12rem; } } } .HeaderActions { flex-shrink: 0; margin-left: auto; display: flex; align-items: center; justify-content: flex-end; .toggle-right-pane-button { &.active { color: var(--color-primary); opacity: 1; } } .badge-button { position: relative; overflow: visible; } .badge { position: absolute; min-width: 1rem; height: 1rem; background: var(--color-primary); border-radius: 0.5rem; color: white; font-size: 0.75rem; line-height: 1rem; font-weight: 500; text-align: center; flex-shrink: 0; right: 0; top: 0; } } .HeaderPinnedMessage-wrapper, .HeaderActions { .Button { margin-left: 0.25rem; &.tiny { margin-right: 0.625rem; } } } @media (max-width: 600px) { @include mobile-header-styles(); } } @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }