phanpy/src/components/status.css

627 lines
12 KiB
CSS
Raw Normal View History

2022-12-10 12:14:48 +03:00
/* REBLOG + REPLY-TO */
.status-reblog {
background: linear-gradient(
to bottom right,
var(--reblog-faded-color),
transparent 160px
);
2022-12-10 12:14:48 +03:00
}
.status-reply-to {
background: linear-gradient(
to bottom right,
var(--reply-to-faded-color),
transparent 160px
);
2022-12-10 12:14:48 +03:00
}
.status-reblog .status-reply-to {
background: linear-gradient(
to top left,
var(--reply-to-faded-color),
transparent 160px
);
2022-12-10 12:14:48 +03:00
}
2022-12-11 05:56:31 +03:00
.visibility-direct {
--yellow-stripes: repeating-linear-gradient(
2022-12-11 05:56:31 +03:00
-45deg,
var(--reply-to-faded-color),
var(--reply-to-faded-color) 10px,
var(--reply-to-faded-color) 10px,
transparent 10px,
transparent 20px
);
/* diagonal stripes of yellow */
background-image: var(--yellow-stripes);
2022-12-11 05:56:31 +03:00
}
2022-12-10 12:14:48 +03:00
/* STATUS PRE META */
.status-pre-meta {
line-height: 1.5;
padding: 8px 16px 0;
opacity: 0.75;
font-size: smaller;
vertical-align: middle;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.status-pre-meta .name-text {
display: inline;
2022-12-10 12:14:48 +03:00
}
.status-pre-meta .icon {
color: var(--reblog-color);
vertical-align: middle;
margin-right: 4px;
}
/* STATUS */
.status {
display: flex;
padding: 16px 16px 20px;
line-height: 1.5;
align-items: flex-start;
}
.status.large {
--fade-in-out-bg: linear-gradient(
to bottom,
transparent,
var(--bg-color) 70px,
var(--bg-color) calc(100% - 50px),
transparent
);
2022-12-10 12:14:48 +03:00
padding-bottom: 8px;
background-image: var(--fade-in-out-bg);
}
.status.large.visibility-direct {
background-image: var(--fade-in-out-bg), var(--yellow-stripes);
2022-12-10 12:14:48 +03:00
}
.status-pre-meta + .status {
padding-top: 8px;
}
.status.small {
font-size: 95%;
}
.status.skeleton {
color: var(--outline-color);
}
.status.skeleton > .avatar {
background-color: var(--outline-color);
}
.indirect .status {
padding-left: 57px;
}
2022-12-10 16:19:38 +03:00
.indirect .status .avatar {
2022-12-10 12:14:48 +03:00
width: 25px !important;
height: 25px !important;
2022-12-10 16:19:38 +03:00
transform: translateX(5px);
2022-12-10 12:14:48 +03:00
}
.status .container {
2022-12-10 12:14:48 +03:00
flex-grow: 1;
min-width: 0;
}
.status:not(.small) .container {
padding-left: 16px;
}
2022-12-10 12:14:48 +03:00
2022-12-12 17:56:38 +03:00
.status > .container > .meta {
2022-12-10 12:14:48 +03:00
display: flex;
gap: 8px;
justify-content: space-between;
}
2022-12-12 17:56:38 +03:00
.status.large > .container > .meta {
min-height: 50px;
}
.status > .container > .meta .arrow {
2022-12-10 12:14:48 +03:00
color: var(--reply-to-color);
vertical-align: middle;
}
.status > .container > .meta :is(.time, .edited) {
2022-12-10 12:14:48 +03:00
color: inherit;
text-align: end;
opacity: 0.5;
text-decoration: none;
flex-shrink: 0;
margin-left: 4px;
white-space: nowrap;
}
.status > .container > .meta a.time:hover {
2022-12-10 12:14:48 +03:00
text-decoration: underline;
}
.status > .container > .meta .reply-to {
2022-12-10 12:14:48 +03:00
opacity: 0.5;
font-size: smaller;
}
.status.large .content-container {
margin-left: calc(-50px - 16px);
padding-top: 10px;
padding-bottom: 10px;
}
.status .content-container.has-spoiler .spoiler {
margin: 8px 0;
font-size: 90%;
border: 1px dashed var(--button-bg-color);
2022-12-10 12:14:48 +03:00
display: flex;
gap: 8px;
align-items: center;
}
.status .content-container.has-spoiler .spoiler ~ * {
filter: blur(6px) invert(0.5);
2022-12-10 12:14:48 +03:00
pointer-events: none;
transition: filter 0.5s;
2022-12-10 12:14:48 +03:00
user-select: none;
}
.status .content-container.has-spoiler .spoiler ~ .content ~ * {
opacity: 0.5;
2022-12-10 12:14:48 +03:00
}
.status .content-container.show-spoiler .spoiler {
border-style: dotted;
2022-12-10 12:14:48 +03:00
}
.status .content-container.show-spoiler .spoiler ~ * {
filter: none;
pointer-events: auto;
user-select: auto;
}
.status .content-container.has-spoiler .spoiler ~ .content ~ * {
opacity: 1;
}
.status .content {
margin-top: 8px;
}
.timeline-deck .status .content {
display: -webkit-box;
-webkit-line-clamp: 10;
-webkit-box-orient: vertical;
overflow: hidden;
position: relative;
}
.timeline-deck .status .content.truncated:after {
content: attr(data-read-more);
line-height: 1;
display: inline-block;
position: absolute;
inset-block-end: 0;
inset-inline-end: 0;
color: var(--link-color);
background-color: var(--link-faded-color);
backdrop-filter: blur(4px) brightness(2);
padding: 0.5em 0.5em 0.5em 2em;
border-radius: 0 1em 1em 0;
font-size: 12px;
font-weight: bold;
text-transform: uppercase;
mask-image: linear-gradient(to right, transparent, black 2em);
}
2022-12-10 12:14:48 +03:00
.status .content p {
margin-block: 0.75em;
2022-12-10 12:14:48 +03:00
}
.status .content p:first-child {
margin-block-start: 0;
}
.status .content p:last-child {
margin-block-end: 0;
}
.status .content .invisible {
display: none;
}
.status .content .ellipsis::after {
content: '…';
}
.status.large .content {
font-size: 150%;
font-size: calc(100% + 50% / var(--content-text-weight));
2022-12-10 12:14:48 +03:00
}
.status.large .poll,
.status.large .actions {
font-size: 125%;
font-size: calc(100% + 25% / var(--content-text-weight));
2022-12-10 12:14:48 +03:00
}
/* MEDIA */
.status .media-container {
margin-top: 8px;
display: flex;
flex-wrap: wrap;
gap: 8px;
flex-direction: row;
}
.status .media {
flex-grow: 1;
flex-basis: calc(50% - 8px);
border-radius: 8px;
overflow: hidden;
max-height: 160px;
min-height: 80px;
border: 1px solid var(--outline-color);
2022-12-10 12:14:48 +03:00
}
.status .media:hover {
border-color: var(--outline-hover-color);
2022-12-10 12:14:48 +03:00
}
.status .media.block {
flex-basis: 100%;
max-height: auto;
}
.status .media :is(img, video) {
width: 100%;
height: 100%;
object-fit: cover;
cursor: pointer;
}
@keyframes position-object {
0% {
object-position: 50% 50%;
}
25% {
object-position: 0% 0%;
}
75% {
object-position: 100% 100%;
}
100% {
object-position: 50% 50%;
}
}
.status .media img:hover {
animation: position-object 5s ease-in-out 1s infinite;
}
.status .media video {
width: 100%;
height: 100%;
object-fit: contain;
}
.status .media-video {
position: relative;
}
2022-12-11 10:26:49 +03:00
.status .media-video:before {
/* draw a circle in the middle */
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 70px;
height: 70px;
border-radius: 50%;
background-color: var(--bg-blur-color);
backdrop-filter: blur(6px) saturate(3) invert(0.2);
2022-12-11 10:26:49 +03:00
z-index: 1;
}
2022-12-10 12:14:48 +03:00
.status .media-video:after {
/* show play icon */
content: '';
position: absolute;
top: 50%;
left: 50%;
2022-12-11 10:26:49 +03:00
transform: translate(-35%, -50%);
2022-12-10 12:14:48 +03:00
width: 0;
height: 0;
border-style: solid;
border-width: 15px 0 15px 26px;
border-color: transparent transparent transparent
var(--text-insignificant-color);
2022-12-10 12:14:48 +03:00
pointer-events: none;
opacity: 0.75;
2022-12-11 10:26:49 +03:00
z-index: 2;
2022-12-10 12:14:48 +03:00
}
.status .media-video:hover:after {
opacity: 1;
}
.status .media-gif video {
object-fit: cover;
}
.status .media-audio {
border: 0;
min-height: 0;
2022-12-10 12:14:48 +03:00
}
.status .media-audio audio {
width: 100%;
}
/* CARD */
.card {
display: flex;
margin-top: 8px;
border-radius: 8px;
border: 1px solid var(--outline-color);
2022-12-10 12:14:48 +03:00
overflow: hidden;
color: inherit;
align-items: center;
background: var(--bg-color);
}
.card .image {
/* min-width: 120px; */
width: 50%;
2022-12-10 12:14:48 +03:00
max-width: 160px;
height: auto;
min-height: 120px;
max-height: 160px;
object-fit: cover;
2022-12-11 07:05:07 +03:00
border-inline-end: 1px solid var(--outline-color);
2022-12-10 12:14:48 +03:00
}
.card:hover .image {
animation: position-object 5s ease-in-out 1s infinite;
}
.card p {
margin: 0;
}
.card .meta-container {
2022-12-12 16:53:06 +03:00
padding: 8px;
min-width: 0;
2022-12-10 12:14:48 +03:00
}
.card .title {
line-height: 1.25;
2022-12-10 12:14:48 +03:00
font-weight: normal;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
display: box;
-webkit-box-orient: vertical;
2022-12-10 12:14:48 +03:00
box-orient: vertical;
-webkit-line-clamp: 2;
line-clamp: 2;
}
.card .meta {
font-size: smaller;
opacity: 0.75;
margin: 0;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: block;
2022-12-10 12:14:48 +03:00
}
.card .meta.domain {
opacity: 1;
color: var(--link-color);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: block;
2022-12-10 12:14:48 +03:00
}
a.card {
text-decoration: none;
transition: opacity 0.2s ease-in-out;
}
a.card:hover {
border: 1px solid var(--outline-hover-color);
2022-12-10 12:14:48 +03:00
}
.card.video {
max-width: 320px;
max-height: 320px;
}
.card.video iframe {
width: 100%;
height: 100%;
}
/* POLLS */
.poll-option {
margin-top: 8px;
padding: 8px;
display: flex;
gap: 8px;
justify-content: space-between;
background-color: var(--bg-blur-color);
background-image: linear-gradient(
to right,
var(--link-faded-color),
var(--link-faded-color) var(--percentage),
transparent var(--percentage),
transparent
);
2022-12-10 12:14:48 +03:00
border-radius: 8px;
border: 1px solid rgba(128, 128, 128, 0.1);
2022-12-10 12:14:48 +03:00
align-items: center;
}
.poll-label {
width: 100%;
display: flex;
gap: 8px;
cursor: pointer;
}
.poll-option-votes {
flex-shrink: 0;
font-size: 90%;
}
.poll-option-leading .poll-option-votes {
font-weight: bold;
}
2022-12-10 12:14:48 +03:00
.poll-vote-button {
margin-top: 8px;
}
.poll-meta {
margin: 8px 0;
font-size: 90%;
2022-12-10 12:14:48 +03:00
}
/* EXTRA META */
.status .extra-meta {
padding-top: 8px;
color: var(--text-insignificant-color);
}
.status .extra-meta * {
vertical-align: middle;
}
.status .extra-meta a {
color: inherit;
text-decoration: none;
}
.status .extra-meta a:hover {
text-decoration: underline;
}
.status .extra-meta .edited:hover {
cursor: pointer;
color: var(--text-color);
}
.status.large .extra-meta {
padding-top: 0;
2022-12-12 17:15:13 +03:00
margin-left: calc(-50px - 8px);
}
2022-12-10 12:14:48 +03:00
/* ACTIONS */
.status .actions {
display: flex;
gap: 8px;
justify-content: space-between;
}
.status.large .actions {
padding-top: 8px;
padding-bottom: 16px;
margin-left: calc(-50px - 16px);
color: var(--text-insignificant-color);
2022-12-10 12:14:48 +03:00
}
.status .actions > button {
min-height: 40px;
min-width: 40px;
padding: 0 8px;
}
.status .actions > button.plain {
color: inherit;
border: 1.5px solid transparent;
2022-12-10 12:14:48 +03:00
}
.status .actions > button.plain:hover {
color: var(--link-color);
background-color: var(--button-plain-bg-hover-color);
}
.status .actions > button.plain.reblog-button:hover {
color: var(--reblog-color);
}
.status .actions > button.plain.reblog-button.checked {
2022-12-10 12:14:48 +03:00
color: var(--reblog-color);
border-color: var(--reblog-color);
}
@keyframes reblogged {
5% {
transform: translate(-2px, -2px);
}
10% {
transform: translate(2px, 2px);
}
15% {
transform: translate(0, 0);
}
100% {
transform: translate(30px, -30px);
opacity: 0;
}
}
.status .actions > button.plain.reblog-button.checked .icon {
animation: reblogged 1s ease-in-out;
2022-12-10 12:14:48 +03:00
}
.status .actions > button.plain.favourite-button:hover {
color: var(--favourite-color);
}
.status .actions > button.plain.favourite-button.checked {
2022-12-10 12:14:48 +03:00
color: var(--favourite-color);
border-color: var(--favourite-color);
}
@keyframes hearted {
20% {
transform: rotate(10deg) scale(1);
}
40% {
transform: rotate(-10deg) scale(1.25);
}
60% {
transform: rotate(10deg) scale(1.75);
}
80% {
transform: rotate(-10deg) scale(2);
}
100% {
transform: rotate(10deg) scale(2.25);
opacity: 0;
}
}
.status .actions > button.plain.favourite-button.checked .icon {
transform-origin: bottom center;
animation: hearted 1s ease-in-out;
2022-12-10 12:14:48 +03:00
}
.status .actions > button.plain.bookmark-button.checked {
2022-12-10 12:14:48 +03:00
color: var(--link-color);
border-color: var(--link-color);
}
@keyframes bookmarked {
25% {
transform: translateY(-10px) rotate(10deg);
opacity: 0.5;
}
50% {
transform: translateY(0);
opacity: 1;
}
75% {
transform: translateY(-15px) rotate(-10deg);
opacity: 0.5;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
.status .actions > button.plain.bookmark-button.checked .icon {
animation: bookmarked 1s ease-in-out;
2022-12-10 12:14:48 +03:00
}
/* ENHANCED CONTENT */
.status .content pre {
border-radius: 8px;
padding: 8px;
margin: 8px 0;
overflow: auto;
width: 100%;
border: 1px solid var(--outline-color);
background: linear-gradient(
to bottom right,
var(--bg-faded-color),
transparent 160px
);
2022-12-10 12:14:48 +03:00
}
.status .content p code {
color: var(--green-color);
}
2022-12-10 12:14:48 +03:00
/* MISC */
.status-aside {
padding: 0 16px 16px 80px;
color: var(--text-insignificant-color);
}
.shortcode-emoji {
width: 1.2em;
height: 1.2em;
vertical-align: middle;
object-fit: contain;
}
/* EDIT HISTORY */
#edit-history {
min-height: 50vh;
min-height: 50dvh;
}
#edit-history :is(ol, ol li) {
list-style: none;
margin: 0;
padding: 0;
}
#edit-history .history-item .status {
border: 1px solid var(--outline-color);
border-radius: 8px;
}