Files
psf-memo/psf-memo-client/src/components/post-feed/post-feed.css
T
Chris Troutner a0040f98c1 Implement like broadcast result modal
Keep the like/tip modal open after a successful like and show a broadcast
result instead of closing: the success message, the like transaction id, and
a link to that transaction on bch.loping.net that opens in a new tab. The
like count and filled heart update immediately, and dismissing the result
closes the modal. The result state lives on the testable LikeTipPage
controller; a server-renderable LikeResult component backs the modal and the
acceptance adapter, with acceptance step handlers for the new wording.

By coder.
2026-09-16 11:41:49 -07:00

721 lines
11 KiB
CSS

/*
Instagram-inspired post feed
*/
:root {
--ig-background: #fafafa;
--ig-surface: #ffffff;
--ig-border: #dbdbdb;
--ig-border-soft: #efefef;
--ig-text: #262626;
--ig-text-secondary: #737373;
--ig-text-muted: #a8a8a8;
--ig-link: #00376b;
--ig-blue: #0095f6;
--ig-blue-hover: #1877f2;
--ig-danger: #ed4956;
--ig-radius: 8px;
--ig-feed-width: 630px;
}
/* Feed wrapper */
.posts-feed,
.posts-feed-list,
.posts-feed-container {
width: min(100%, var(--ig-feed-width));
margin: 0 auto;
padding: 24px 12px 60px;
}
/* Main post card */
.posts-feed-item {
position: relative;
width: 100%;
margin: 0 0 20px;
padding: 0;
color: var(--ig-text);
background: var(--ig-surface);
border: 1px solid var(--ig-border);
border-radius: var(--ig-radius);
box-shadow: none;
overflow: hidden;
}
/* Remove the previous green accent */
.posts-feed-item::before {
display: none;
}
/* No floating card animation */
.posts-feed-item:hover {
transform: none;
border-color: var(--ig-border);
box-shadow: none;
}
/* Post header */
.posts-feed-item-header {
display: flex;
align-items: center;
gap: 12px;
min-height: 60px;
margin: 0;
padding: 12px 16px;
border-bottom: 1px solid var(--ig-border-soft);
}
/* Metadata */
.posts-feed-item-meta {
min-width: 0;
flex: 1;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px 7px;
padding: 0;
}
/* Author name */
.posts-feed-item-author {
display: inline-block;
max-width: 100%;
color: var(--ig-text);
font-size: 14px;
font-weight: 600;
line-height: 18px;
text-decoration: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
transition: opacity 0.15s ease;
}
.posts-feed-item-author:hover {
color: var(--ig-text);
text-decoration: none;
opacity: 0.65;
}
/* Address-based usernames */
.posts-feed-item-author-address {
max-width: 300px;
color: var(--ig-text);
font-family:
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
sans-serif;
font-size: 14px;
font-weight: 600;
}
/* Replied badge */
.posts-feed-item-replied {
display: inline-flex;
align-items: center;
padding: 0;
color: var(--ig-text-secondary);
background: transparent;
border: 0;
border-radius: 0;
font-size: 12px;
font-weight: 400;
line-height: 16px;
}
/* Timestamp */
.posts-feed-item-seen {
color: var(--ig-text-secondary);
font-size: 12px;
line-height: 16px;
}
.posts-feed-item-seen::before {
content: "•";
margin-right: 7px;
color: var(--ig-text-muted);
}
/* Post body */
.posts-feed-item-text {
margin: 0;
padding: 16px;
color: var(--ig-text);
font-size: 14px;
line-height: 20px;
white-space: pre-wrap;
overflow-wrap: anywhere;
word-break: break-word;
}
/* Links inside posts */
.posts-feed-item-text a {
color: var(--ig-link);
font-weight: 500;
text-decoration: none;
}
.posts-feed-item-text a:hover {
text-decoration: underline;
}
/* Actions */
.posts-feed-item-actions {
display: flex;
align-items: center;
gap: 12px;
min-height: 46px;
margin: 0;
padding: 8px 16px;
border-top: 1px solid var(--ig-border-soft);
}
/* Reply-count buttons and links */
.posts-feed-item-actions button,
.posts-feed-item-actions a,
.posts-feed-item-actions [role="button"] {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 32px;
padding: 4px 0;
color: var(--ig-text);
background: transparent;
border: 0;
border-radius: 0;
box-shadow: none;
font-size: 13px;
font-weight: 600;
line-height: 18px;
text-decoration: none;
cursor: pointer;
transition:
opacity 0.15s ease,
color 0.15s ease;
}
.posts-feed-item-actions button:hover,
.posts-feed-item-actions a:hover,
.posts-feed-item-actions [role="button"]:hover {
color: var(--ig-text);
background: transparent;
border: 0;
box-shadow: none;
transform: none;
opacity: 0.55;
}
/* Footer metadata */
.posts-feed-item-footer {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px;
margin: 0;
padding: 0 16px 14px;
color: var(--ig-text-secondary);
border-top: 0;
font-family:
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
sans-serif;
font-size: 11px;
line-height: 16px;
text-transform: uppercase;
letter-spacing: 0.02em;
}
.posts-feed-item-footer-separator {
color: var(--ig-text-muted);
}
/* Transaction ID */
.posts-feed-item-txid-wrap {
position: relative;
display: inline-flex;
align-items: center;
}
.posts-feed-item-txid {
color: var(--ig-text-secondary);
cursor: pointer;
border: 0;
text-transform: none;
transition: color 0.15s ease;
}
.posts-feed-item-txid-copied {
position: absolute;
left: 50%;
bottom: calc(100% + 8px);
z-index: 2;
padding: 6px 10px;
color: #fff;
background: #262626;
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
font-size: 12px;
font-weight: 500;
letter-spacing: 0;
line-height: 16px;
text-transform: none;
white-space: nowrap;
pointer-events: none;
transform: translateX(-50%);
}
.posts-feed-item-txid-copied::after {
content: '';
position: absolute;
top: 100%;
left: 50%;
border: 5px solid transparent;
border-top-color: #262626;
transform: translateX(-50%);
}
.posts-feed-item-txid:hover {
color: var(--ig-text);
background: transparent;
}
.posts-feed-item-txid:focus-visible {
outline: 2px solid var(--ig-blue);
outline-offset: 3px;
border-radius: 2px;
}
/* Embedded replies */
.posts-feed-item-embedded {
margin: 12px 0 0 44px;
padding: 0;
background: var(--ig-surface);
border: 1px solid var(--ig-border-soft);
border-radius: var(--ig-radius);
box-shadow: none;
}
.posts-feed-item-embedded .posts-feed-item-header {
min-height: 52px;
padding: 10px 12px;
}
.posts-feed-item-embedded .posts-feed-item-text {
padding: 12px;
}
.posts-feed-item-embedded .posts-feed-item-actions {
padding: 6px 12px;
}
.posts-feed-item-embedded .posts-feed-item-footer {
padding: 0 12px 12px;
}
/* Alternate posts should remain consistent */
.posts-feed-item:nth-child(even) {
background: var(--ig-surface);
}
/* Common avatar overrides */
.posts-feed-item-header img,
.posts-feed-item-header .avatar,
.posts-feed-item-header [class*="avatar"] {
width: 36px;
height: 36px;
flex: 0 0 36px;
object-fit: cover;
background: #efefef;
border: 1px solid var(--ig-border);
border-radius: 50%;
}
/* Optional Instagram-style profile ring */
.posts-feed-item-header img,
.posts-feed-item-header [class*="avatar"] img {
padding: 2px;
background:
linear-gradient(#ffffff, #ffffff) padding-box,
linear-gradient(
135deg,
#f9ce34,
#ee2a7b,
#6228d7
) border-box;
border: 2px solid transparent;
}
/* Mobile */
@media (max-width: 700px) {
.posts-feed,
.posts-feed-list,
.posts-feed-container {
width: 100%;
padding: 0 0 40px;
}
.posts-feed-item {
margin-bottom: 10px;
border-left: 0;
border-right: 0;
border-radius: 0;
}
.posts-feed-item-header {
padding: 10px 12px;
}
.posts-feed-item-text {
padding: 14px 12px;
font-size: 14px;
line-height: 20px;
}
.posts-feed-item-actions {
padding: 7px 12px;
}
.posts-feed-item-footer {
padding: 0 12px 12px;
}
.posts-feed-item-author-address {
max-width: 190px;
}
.posts-feed-item-embedded {
margin-left: 24px;
margin-right: 10px;
border-left: 1px solid var(--ig-border-soft);
border-right: 1px solid var(--ig-border-soft);
border-radius: var(--ig-radius);
}
}
/* Accessibility */
@media (prefers-reduced-motion: reduce) {
.posts-feed-item-author,
.posts-feed-item-actions button,
.posts-feed-item-actions a,
.posts-feed-item-actions [role="button"],
.posts-feed-item-txid {
transition: none;
}
}
.posts-feed-item-avatar-link {
display: inline-flex;
flex: 0 0 auto;
border-radius: 50%;
text-decoration: none;
}
.posts-feed-item-meta {
min-width: 0;
flex: 1;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 1px;
}
.posts-feed-item-author-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 6px;
}
.posts-feed-item-content {
padding: 14px 16px 6px;
}
.posts-feed-item-text {
margin: 0;
padding: 0;
color: #262626;
font-size: 14px;
line-height: 20px;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.posts-feed-item-inline-author {
color: #262626;
font-weight: 600;
text-decoration: none;
}
.posts-feed-item-inline-author:hover {
text-decoration: underline;
}
.posts-feed-item-txid {
padding: 0;
color: #737373;
background: transparent;
border: 0;
box-shadow: none;
font-size: inherit;
font-weight: inherit;
text-transform: none;
cursor: pointer;
}
.posts-feed-item-txid:hover {
color: #262626;
background: transparent;
border: 0;
box-shadow: none;
transform: none;
}
.recent-posts-page {
padding-top: 2.5rem;
padding-bottom: 4rem;
}
.recent-posts-heading {
margin-bottom: 1.75rem;
text-align: center;
}
.recent-posts-heading h1 {
margin: 0;
color: #262626;
font-size: clamp(2rem, 5vw, 2.8rem);
font-weight: 700;
letter-spacing: -0.04em;
}
.recent-posts-heading p {
max-width: 560px;
margin: 0.6rem auto 0;
color: #737373;
font-size: 0.95rem;
line-height: 1.5;
}
.recent-posts-count {
display: inline-block;
margin-top: 0.85rem;
color: #8e8e8e;
font-size: 0.78rem;
font-weight: 500;
}
.recent-posts-error {
padding: 0.85rem 1rem;
color: #c62828;
background: #fff1f1;
border: 1px solid #ffd2d2;
border-radius: 8px;
text-align: center;
}
.recent-posts-pagination {
display: flex;
justify-content: space-between;
gap: 1rem;
margin-top: 1.5rem;
margin-bottom: 2rem;
}
.recent-posts-pagination .btn {
min-width: 110px;
border-radius: 8px;
}
@media (max-width: 700px) {
.recent-posts-page {
padding-top: 1.5rem;
}
.recent-posts-heading {
padding: 0 0.75rem;
}
.recent-posts-heading h1 {
font-size: 2rem;
}
.recent-posts-heading p {
font-size: 0.9rem;
}
.recent-posts-pagination {
padding: 0 0.75rem;
}
}
.post-like-button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 32px;
padding: 4px 0;
color: var(--ig-text);
background: transparent;
border: 0;
border-radius: 0;
font-size: 13px;
font-weight: 600;
line-height: 18px;
text-decoration: none;
cursor: pointer;
transition:
opacity 0.15s ease,
color 0.15s ease;
}
.post-like-button:hover {
color: var(--ig-danger);
background: transparent;
border: 0;
box-shadow: none;
transform: none;
opacity: 0.65;
}
.post-like-button-liked,
.post-like-button-liked:hover {
color: var(--ig-danger);
opacity: 1;
}
.post-like-button-icon {
font-size: 18px;
}
.post-like-button-count {
min-width: 1.2em;
}
.like-tip-modal-target {
margin-bottom: 1rem;
}
.like-tip-modal-error {
margin: 0;
font-size: 0.95rem;
}
.like-result {
text-align: left;
}
.like-result-message {
margin-bottom: 0.75rem;
}
.like-result-txid {
font-size: 0.9rem;
}
.posts-feed-item-youtube {
position: relative;
width: 100%;
max-width: 100%;
margin-top: 12px;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
border-radius: var(--ig-radius);
background: #000;
}
.posts-feed-item-youtube iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
border-radius: var(--ig-radius);
}
.posts-feed-item-embedded .posts-feed-item-youtube {
margin-top: 10px;
}