signal-desktop/stylesheets/components/TextAttachment.scss

213 lines
4.2 KiB
SCSS
Raw Normal View History

2022-04-06 01:18:07 +00:00
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
.TextAttachment {
max-height: 100%;
max-width: 100%;
display: flex;
justify-content: center;
align-items: center;
2022-04-06 01:18:07 +00:00
&__story {
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
overflow: hidden;
user-select: none;
height: 1280px;
max-height: 1280px;
max-width: 720px;
min-height: 1280px;
min-width: 720px;
2022-04-06 01:18:07 +00:00
width: 720px;
}
&__text {
border-radius: 36px;
padding: 28px;
2023-04-20 17:03:43 +00:00
margin-inline: 56px;
2022-08-24 21:35:32 +00:00
&--with-bg {
2023-04-20 17:03:43 +00:00
margin-inline: 36px;
2022-08-24 21:35:32 +00:00
}
2022-04-06 01:18:07 +00:00
&__container {
overflow: hidden;
2022-06-17 00:48:57 +00:00
user-select: none;
}
&__textarea {
background: inherit;
border: none;
padding: 0;
resize: none;
text-align: center;
width: 100%;
&:disabled {
color: inherit;
cursor: inherit;
// By disabling pointer-events, we prevent the disabled textarea from swallowing
// all click events
pointer-events: none;
2022-06-17 00:48:57 +00:00
}
&:focus {
border: none;
outline: none;
}
2022-04-06 01:18:07 +00:00
}
}
2022-07-08 21:14:01 +00:00
&__preview-container {
2023-04-20 17:03:43 +00:00
margin-inline: 56px;
2022-11-02 21:04:50 +00:00
margin-top: 36px;
position: relative;
2022-07-08 21:14:01 +00:00
}
2022-04-06 01:18:07 +00:00
&__preview {
align-items: center;
background: $color-black-alpha-40;
border-radius: 28px;
display: flex;
flex-direction: row;
2022-08-24 21:35:32 +00:00
height: 112px;
2022-04-06 01:18:07 +00:00
justify-content: center;
2022-08-24 21:35:32 +00:00
padding: 16px;
&__no-image {
2023-04-20 17:03:43 +00:00
margin-inline-end: 16px;
2022-08-24 21:35:32 +00:00
}
&__location {
color: $color-white;
font: bold 22px Inter;
max-width: 422px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include dark-theme {
color: $color-white;
}
.TextAttachment__preview-container--large & {
color: $color-white-alpha-60;
font: 18px Inter;
max-width: 352px;
}
}
2022-04-06 01:18:07 +00:00
2022-07-08 21:14:01 +00:00
&__remove {
2022-11-02 21:04:50 +00:00
align-items: center;
2022-07-08 21:14:01 +00:00
backdrop-filter: blur(26px);
background: $color-black-alpha-40;
border-radius: 100%;
2022-11-02 21:04:50 +00:00
display: flex;
2022-07-08 21:14:01 +00:00
height: 48px;
2022-11-02 21:04:50 +00:00
justify-content: center;
2022-07-08 21:14:01 +00:00
position: absolute;
2023-04-20 17:03:43 +00:00
inset-inline-end: -16px;
2022-07-08 21:14:01 +00:00
top: -16px;
width: 48px;
z-index: $z-index-base;
button {
@include button-reset;
height: 24px;
width: 24px;
2023-05-04 18:04:22 +00:00
@include color-svg('../images/icons/v3/x/x.svg', $color-gray-15);
2022-07-08 21:14:01 +00:00
}
}
2022-06-17 00:48:57 +00:00
.TextAttachment__preview-container--large & {
2022-08-24 21:35:32 +00:00
height: 140px;
2022-04-06 01:18:07 +00:00
}
2022-06-17 00:48:57 +00:00
&__no-image {
.TextAttachment__preview-container--large & {
2022-08-24 21:35:32 +00:00
height: 105px;
width: 105px;
2022-04-06 01:18:07 +00:00
}
}
2022-06-17 00:48:57 +00:00
&__content {
2022-04-06 01:18:07 +00:00
align-items: flex-start;
display: flex;
flex-direction: column;
justify-content: flex-start;
2022-06-17 00:48:57 +00:00
margin: 0;
2022-04-06 01:18:07 +00:00
max-width: 422px;
2022-06-17 00:48:57 +00:00
.TextAttachment__preview-container--large & {
2022-04-06 01:18:07 +00:00
max-width: 352px;
}
2022-06-17 00:48:57 +00:00
}
2022-04-06 01:18:07 +00:00
2022-06-17 00:48:57 +00:00
&__title {
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
2022-04-06 01:18:07 +00:00
color: $color-white;
2022-08-24 21:35:32 +00:00
display: -webkit-box;
font: bold 22px Inter;
2022-04-06 01:18:07 +00:00
overflow: hidden;
2022-08-24 21:35:32 +00:00
@include dark-theme {
color: $color-white;
2022-04-06 01:18:07 +00:00
}
}
&__tooltip {
align-items: center;
background: $color-black-alpha-90;
border-radius: 12px;
color: $color-white;
display: flex;
font-size: 13px;
font-weight: 400;
2022-04-06 01:18:07 +00:00
justify-content: center;
line-height: 18px;
2022-04-06 01:18:07 +00:00
max-width: 656px;
padding: 12px;
2022-04-06 01:18:07 +00:00
position: absolute;
text-decoration: none;
z-index: $z-index-above-base;
&::after {
border-color: black transparent transparent transparent;
border-style: solid;
border-width: 14px;
content: '';
2023-04-20 17:03:43 +00:00
inset-inline-start: 50%;
margin-inline-start: -14px;
2022-04-06 01:18:07 +00:00
position: absolute;
top: 100%;
}
&__title {
font-size: 14px;
font-weight: 600;
}
2022-04-06 01:18:07 +00:00
&__url {
margin-top: 4px;
max-width: 566px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&__arrow {
@include color-svg(
2023-05-04 18:04:22 +00:00
'../images/icons/v3/chevron/chevron-right.svg',
2022-04-06 01:18:07 +00:00
$color-white
);
height: 24px;
width: 24px;
}
}
}
}