soapbox/app/styles/components/compose-form.scss

497 wiersze
9.6 KiB
SCSS
Czysty Zwykły widok Historia

2020-03-27 20:59:38 +00:00
.compose-form {
2020-05-16 03:48:08 +00:00
&__sensitive-button {
padding: 10px;
padding-top: 0;
font-size: 14px;
font-weight: 500;
&.active { color: var(--highlight-text-color); }
input[type=checkbox] { display: none; }
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
.checkbox {
display: inline-block;
position: relative;
2020-06-02 22:42:09 +00:00
border: 1px solid var(--brand-color);
2020-05-16 03:48:08 +00:00
box-sizing: border-box;
width: 18px;
height: 18px;
flex: 0 0 auto;
margin-right: 10px;
top: -1px;
border-radius: 4px;
vertical-align: middle;
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
&.active {
2020-05-31 02:48:37 +00:00
border-color: var(--highlight-text-color);
background: var(--highlight-text-color);
2020-05-16 03:48:08 +00:00
}
}
}
2020-05-28 22:18:37 +00:00
&__warning {
color: var(--primary-text-color);
2020-05-16 03:48:08 +00:00
margin-bottom: 10px;
background: var(--brand-color--faint);
2020-05-16 03:48:08 +00:00
box-shadow: 0 2px 6px rgba($base-shadow-color, 0.3);
padding: 8px 10px;
border-radius: 4px;
font-size: 13px;
font-weight: 400;
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
strong {
2020-06-03 01:12:36 +00:00
color: var(--primary-text-color);
2020-05-16 03:48:08 +00:00
font-weight: 500;
@each $lang in $cjk-langs {
&:lang(#{$lang}) {
font-weight: 700;
}
}
}
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
a {
color: var(--brand-color--hicontrast);
2020-05-16 03:48:08 +00:00
font-weight: 500;
text-decoration: underline;
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
&:hover,
&:active,
&:focus {
text-decoration: none;
}
}
}
2020-05-28 22:18:37 +00:00
&__autosuggest-wrapper {
2020-05-16 03:48:08 +00:00
position: relative;
}
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
.spoiler-input {
height: 0;
transform-origin: bottom;
2020-05-28 22:18:37 +00:00
opacity: 0;
2020-05-16 03:48:08 +00:00
&.spoiler-input--visible {
height: 36px;
margin-bottom: 11px;
2020-05-28 22:18:37 +00:00
opacity: 1;
2020-05-16 03:48:08 +00:00
}
}
2020-05-28 22:18:37 +00:00
.spoiler-input__input { border-radius: 4px; }
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
&.condensed {
.autosuggest-textarea__textarea {
min-height: 46px;
border-radius: 5px;
}
2022-03-21 18:09:01 +00:00
.compose-form__buttons-wrapper {
height: 0;
padding: 0;
overflow: hidden;
}
2020-05-16 03:48:08 +00:00
}
2020-05-28 22:18:37 +00:00
&__modifiers {
2020-06-03 01:12:36 +00:00
color: var(--primary-text-color);
2020-05-16 03:48:08 +00:00
font-family: inherit;
font-size: 14px;
2020-06-03 01:12:36 +00:00
background: var(--background-color);
.compose-form__upload-wrapper { overflow: hidden; }
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
.compose-form__uploads-wrapper {
display: flex;
flex-direction: row;
flex-wrap: wrap;
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
&.contains-media {
padding: 5px;
2020-06-02 23:31:55 +00:00
border-top: 1px solid var(--foreground-color);
2020-05-16 03:48:08 +00:00
}
}
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
.compose-form__upload {
flex: 1 1 0;
min-width: 40%;
margin: 5px;
position: relative;
border-radius: 4px;
overflow: hidden;
2020-03-27 20:59:38 +00:00
2020-05-16 03:48:08 +00:00
&__actions {
background: linear-gradient(180deg, rgba($base-shadow-color, 0.8) 0, rgba($base-shadow-color, 0.35) 80%, transparent);
display: flex;
align-items: flex-start;
justify-content: space-between;
opacity: 0;
transition: opacity 0.1s ease;
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
.icon-button {
flex: 0 1 auto;
2021-07-02 03:35:28 +00:00
color: #fff;
2020-05-16 03:48:08 +00:00
font-size: 14px;
font-weight: 500;
padding: 10px;
font-family: inherit;
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
&:hover,
&:focus,
2020-05-28 22:18:37 +00:00
&:active {
2021-07-02 03:35:28 +00:00
color: var(--accent-color);
2020-05-28 22:18:37 +00:00
}
2020-05-16 03:48:08 +00:00
}
&.active { opacity: 1; }
2020-05-16 03:48:08 +00:00
}
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
&-description {
position: absolute;
z-index: 2;
bottom: 0;
left: 0;
right: 0;
box-sizing: border-box;
background: linear-gradient(0deg, rgba($base-shadow-color, 0.8) 0, rgba($base-shadow-color, 0.35) 80%, transparent);
padding: 10px;
opacity: 0;
transition: opacity 0.1s ease;
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
textarea {
background: transparent;
box-sizing: border-box;
2021-07-02 03:35:28 +00:00
color: #fff;
border: 1px solid #fff;
2020-05-16 03:48:08 +00:00
outline: none;
padding: 10px;
margin: 0;
width: 100%;
font-family: inherit;
font-size: 14px;
font-weight: 500;
2020-05-28 22:18:37 +00:00
&:focus { color: #fff; }
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
&::placeholder {
2021-07-02 03:35:28 +00:00
color: rgba(255, 255, 255, 0.6);
2020-05-16 03:48:08 +00:00
}
}
&.active { opacity: 1; }
2020-05-16 03:48:08 +00:00
}
&-preview {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
video {
width: 100%;
height: 100%;
object-fit: cover;
}
> i.fa {
width: 100%;
color: hsla(var(--primary-text-color_hsl), 0.4);
font-size: 64px;
text-align: center;
line-height: 160px;
}
}
2020-05-16 03:48:08 +00:00
}
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
.compose-form__upload-thumbnail {
background-position: center;
2021-05-30 18:56:45 +00:00
background-size: contain;
2020-05-16 03:48:08 +00:00
background-repeat: no-repeat;
height: 160px;
2020-05-16 03:48:08 +00:00
width: 100%;
overflow: hidden;
position: relative;
&.video {
background-image: url('../images/video-placeholder.png');
background-size: cover;
}
&.audio {
background-image: url('../images/audio-placeholder.png');
background-size: cover;
}
2020-05-16 03:48:08 +00:00
}
} // end .compose-form .compose-form__modifiers
2020-05-28 22:18:37 +00:00
&__buttons-wrapper {
2020-05-16 03:48:08 +00:00
padding: 10px;
2020-06-02 22:42:09 +00:00
background: var(--background-color);
2020-05-16 03:48:08 +00:00
display: flex;
justify-content: space-between;
flex: 0 0 auto;
2020-07-28 04:55:23 +00:00
border-radius: 0 0 5px 5px;
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
.compose-form__buttons {
display: flex;
2020-06-07 23:05:54 +00:00
> div {
display: flex;
align-items: center;
justify-content: center;
}
2020-05-16 03:48:08 +00:00
.compose-form__sensitive-button {
display: none;
2021-09-22 19:38:48 +00:00
&.compose-form__sensitive-button--visible {
display: block;
}
}
.svg-icon {
width: 24px;
height: 24px;
svg {
stroke-width: 1.5px;
}
}
.privacy-dropdown__value {
display: flex;
align-items: center;
justify-content: center;
2020-05-16 03:48:08 +00:00
}
}
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
.icon-button {
box-sizing: content-box;
padding: 0 3px;
2021-09-22 19:38:48 +00:00
opacity: 0.5;
transition: 0.2s;
&.active,
&:hover {
opacity: 1;
}
2020-05-16 03:48:08 +00:00
}
2020-05-28 22:18:37 +00:00
.character-counter {
display: block;
cursor: default;
font-family: var(--font-sans-serif), sans-serif;
font-size: 14px;
font-weight: 600;
color: var(--primary-text-color--faint);
&.character-counter--over { color: $warning-red; }
}
.character-counter,
.visual-character-counter {
margin-right: 10px;
2020-05-16 03:48:08 +00:00
}
}
2020-05-28 22:18:37 +00:00
&__publish {
2020-05-16 03:48:08 +00:00
display: flex;
justify-content: flex-end;
min-width: 0;
flex: 0 0 auto;
2020-05-28 22:18:37 +00:00
2020-05-16 03:48:08 +00:00
.compose-form__publish-button-wrapper {
overflow: hidden;
}
}
&__counter {
display: flex;
align-items: center;
align-self: center;
margin-left: auto;
}
2020-03-27 20:59:38 +00:00
} // end .compose-form
2020-06-03 02:11:01 +00:00
2021-09-22 19:56:56 +00:00
// Icon tweaks
.compose-form__spoiler-button-icon {
transform: translateY(2px);
}
.compose-form__markdown-button-icon {
transform: translateY(1px);
}
2020-06-03 02:11:01 +00:00
.upload-progress {
padding: 10px;
color: var(--highlight-text-color);
overflow: hidden;
display: flex;
.fa {
font-size: 34px;
margin-right: 10px;
}
span {
font-size: 12px;
text-transform: uppercase;
font-weight: 500;
display: block;
}
}
.upload-progess__message {
flex: 1 1 auto;
}
.upload-progress__backdrop {
width: 100%;
height: 6px;
border-radius: 6px;
2020-06-07 03:55:00 +00:00
background: var(--brand-color--med);
2020-06-03 02:11:01 +00:00
position: relative;
margin-top: 5px;
}
.upload-progress__tracker {
position: absolute;
left: 0;
top: 0;
height: 6px;
background: var(--brand-color);
border-radius: 6px;
}
.privacy-dropdown__dropdown {
font-size: 14px;
position: absolute;
background: var(--foreground-color);
box-shadow: 2px 4px 15px rgba($base-shadow-color, 0.4);
border-radius: 4px;
margin-left: 40px;
overflow: hidden;
z-index: 10000;
&.top {
transform-origin: 50% 100%;
}
&.bottom {
transform-origin: 50% 0;
}
}
.privacy-dropdown__option {
color: var(--primary-text-color);
padding: 10px;
cursor: pointer;
display: flex;
&:hover,
&.active {
2020-06-07 03:55:00 +00:00
background: var(--brand-color--med);
2020-06-03 02:11:01 +00:00
color: var(--primary-text-color);
outline: 0;
.privacy-dropdown__option__content {
color: var(--primary-text-color);
strong {
color: var(--primary-text-color);
}
}
}
&.active:hover {
2020-06-07 03:55:00 +00:00
background: hsla(var(--brand-color_hsl), 0.5);
2020-06-03 02:11:01 +00:00
}
}
.privacy-dropdown__option__icon {
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.privacy-dropdown__option__content {
flex: 1 1 auto;
color: var(--highlight-text-color);
strong {
font-weight: 500;
display: block;
color: var(--primary-text-color);
@each $lang in $cjk-langs {
&:lang(#{$lang}) {
font-weight: 700;
}
}
}
}
.privacy-dropdown.active {
.privacy-dropdown__value {
background: var(--foreground-color);
border-radius: 4px 4px 0 0;
box-shadow: 0 -4px 4px rgba($base-shadow-color, 0.1);
.icon-button {
transition: none;
}
&.active {
background: var(--brand-color);
.icon-button {
color: var(--primary-text-color);
}
}
}
&.top .privacy-dropdown__value {
border-radius: 0 0 4px 4px;
}
.privacy-dropdown__dropdown {
display: block;
box-shadow: 2px 4px 6px rgba($base-shadow-color, 0.1);
}
}
.focal-point {
position: relative;
cursor: pointer;
overflow: hidden;
&.dragging {
cursor: move;
}
img {
max-width: 80vw;
max-height: 80vh;
width: auto;
height: auto;
margin: auto;
}
&__reticle {
position: absolute;
width: 100px;
height: 100px;
transform: translate(-50%, -50%);
background: url('../images/reticle.png') no-repeat 0 0;
border-radius: 50%;
box-shadow: 0 0 0 9999em rgba($base-shadow-color, 0.35);
}
&__overlay {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
}