8zbhzr21j: Restyle post cards, comments and the own-post menu to the redesign spec
This commit is contained in:
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
* Post card, comments and the own-post menu (spec "Post card", ADR 0001).
|
||||
* Prefixed `post-` classes, tokens only. Every button sets margin, padding,
|
||||
* font and color itself so the legacy `button` rule never leaks in.
|
||||
* --on-accent (white) appears only over video and on crimson faces.
|
||||
*/
|
||||
@keyframes post-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
|
||||
@keyframes post-pop { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
|
||||
@keyframes post-beat { 0% { transform: scale(1); } 30% { transform: scale(1.4); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }
|
||||
|
||||
.post {
|
||||
--post-soft: color-mix(in srgb, var(--ink), transparent 92%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 16px 16px 10px;
|
||||
background: var(--tile);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-card);
|
||||
animation: post-rise .55s var(--ease) both;
|
||||
transition: border-color .3s, box-shadow .3s;
|
||||
}
|
||||
.post:hover { border-color: var(--line-2); box-shadow: var(--shadow-tile); }
|
||||
|
||||
.post-head { display: flex; align-items: center; gap: 12px; }
|
||||
.post-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
|
||||
.post-who strong { display: flex; align-items: center; font-size: 14.5px; font-weight: 700; }
|
||||
.post-who time { font-size: 12.5px; color: var(--ink-3); }
|
||||
.post-you {
|
||||
margin-left: 8px;
|
||||
padding: 2px 7px;
|
||||
border-radius: 6px;
|
||||
box-shadow: inset 0 0 0 1px var(--line-2);
|
||||
color: var(--ink-2);
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
letter-spacing: .12em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.post-text { margin: 0; font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||
.post-error { margin: 0; align-self: center; color: var(--danger); font-size: 13px; }
|
||||
|
||||
/* Media: 16:9, 12px radius. */
|
||||
.post-media {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
overflow: hidden;
|
||||
aspect-ratio: 16 / 9;
|
||||
border-radius: var(--r-ctl);
|
||||
background: var(--tile-3);
|
||||
box-shadow: inset 0 0 0 1px var(--line);
|
||||
}
|
||||
.post-media img,
|
||||
.post-media video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
|
||||
.post-media video { object-fit: contain; background: var(--tile-3); }
|
||||
.post-video-pending { display: grid; place-items: center; color: var(--ink-2); font-size: 14px; }
|
||||
.post-play {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 2;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 62px;
|
||||
height: 62px;
|
||||
margin: auto;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 50%;
|
||||
color: var(--on-accent);
|
||||
background: color-mix(in srgb, var(--on-accent), transparent 84%);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
backdrop-filter: blur(12px);
|
||||
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-accent), transparent 60%), 0 12px 30px color-mix(in srgb, black 28%, transparent);
|
||||
cursor: pointer;
|
||||
transition: transform .3s cubic-bezier(.2,.9,.3,1.4), background-color .3s;
|
||||
}
|
||||
.post-play svg { width: 24px; height: 24px; margin-left: 3px; }
|
||||
.post-play:hover { transform: scale(1.1); background: color-mix(in srgb, var(--on-accent), transparent 72%); }
|
||||
.post-dur {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
z-index: 2;
|
||||
padding: 3px 8px;
|
||||
border-radius: 8px;
|
||||
color: var(--on-accent);
|
||||
background: color-mix(in srgb, black 42%, transparent);
|
||||
-webkit-backdrop-filter: blur(6px);
|
||||
backdrop-filter: blur(6px);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
font-variant-numeric: tabular-nums;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Footer actions. */
|
||||
.post-acts { display: flex; align-items: center; gap: 2px; margin: 0 -8px; }
|
||||
.post-act {
|
||||
appearance: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
height: 38px;
|
||||
margin: 0;
|
||||
padding: 0 12px;
|
||||
border: 0;
|
||||
border-radius: 11px;
|
||||
background: transparent;
|
||||
color: var(--ink-2);
|
||||
font: inherit;
|
||||
font-size: 13.5px;
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
opacity: 1;
|
||||
cursor: pointer;
|
||||
transition: background-color .2s, color .2s;
|
||||
}
|
||||
.post-act svg { width: 20px; height: 20px; flex: none; }
|
||||
.post-act:hover:not(:disabled) { background: var(--post-soft); color: var(--ink); }
|
||||
.post-act:disabled { cursor: default; }
|
||||
.post-like:hover:not(:disabled),
|
||||
.post-like-on { color: var(--accent); }
|
||||
.post-like-beat .post-heart { animation: post-beat .5s cubic-bezier(.2,.9,.3,1.4); }
|
||||
.post-act-open { color: var(--ink); background: var(--post-soft); }
|
||||
|
||||
/* Own-post menu. */
|
||||
.post-menu { position: relative; }
|
||||
.post-menu-btn {
|
||||
appearance: none;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: var(--r-ctl);
|
||||
background: transparent;
|
||||
color: var(--ink-2);
|
||||
opacity: 1;
|
||||
cursor: pointer;
|
||||
transition: background-color .2s, color .2s;
|
||||
}
|
||||
.post-menu-btn svg { width: 20px; height: 20px; }
|
||||
.post-menu-btn:hover:not(:disabled),
|
||||
.post-menu-btn-open { background: var(--post-soft); color: var(--ink); }
|
||||
.post-menu-btn:disabled { cursor: default; }
|
||||
.post-pop {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: calc(100% + 6px);
|
||||
z-index: 6;
|
||||
min-width: 210px;
|
||||
padding: 6px;
|
||||
color: var(--ink);
|
||||
background: var(--glass);
|
||||
-webkit-backdrop-filter: blur(18px);
|
||||
backdrop-filter: blur(18px);
|
||||
border: 1px solid var(--line-2);
|
||||
border-radius: 14px;
|
||||
box-shadow: var(--shadow-pop);
|
||||
animation: post-pop .18s var(--ease) both;
|
||||
}
|
||||
.post-mi {
|
||||
appearance: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
margin: 0;
|
||||
padding: 0 12px;
|
||||
border: 0;
|
||||
border-radius: var(--r-ctl);
|
||||
background: transparent;
|
||||
color: var(--ink);
|
||||
font: inherit;
|
||||
font-size: 13.5px;
|
||||
font-weight: 600;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.post-mi svg { width: 18px; height: 18px; flex: none; }
|
||||
.post-mi:hover { background: var(--post-soft); }
|
||||
.post-mi-danger { color: var(--danger); }
|
||||
.post-ask { padding: 8px 6px 4px; }
|
||||
.post-ask-title { margin: 0; padding: 0 4px; font-size: 13px; font-weight: 600; }
|
||||
.post-ask-sub { margin: 2px 0 0; padding: 0 4px; font-size: 12.5px; color: var(--ink-3); }
|
||||
.post-ask-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 12px; }
|
||||
|
||||
/* Inline comments. */
|
||||
.post-cm {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
margin: 0 -16px;
|
||||
padding: 12px 16px 6px;
|
||||
border-top: 1px solid var(--line);
|
||||
animation: post-rise .35s var(--ease) both;
|
||||
}
|
||||
.post-cm-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
|
||||
.post-cm-empty { margin: 0; font-size: 13px; color: var(--ink-3); }
|
||||
.post-c { display: flex; align-items: flex-start; gap: 10px; }
|
||||
.post-c-body { flex: 1; min-width: 0; padding: 8px 12px; background: var(--tile-2); border-radius: 4px 14px 14px 14px; }
|
||||
.post-c-head { display: flex; align-items: baseline; gap: 8px; }
|
||||
.post-c-head strong { font-size: 13px; }
|
||||
.post-c-head time { font-size: 12px; color: var(--ink-3); }
|
||||
.post-c-body p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||
.post-c-removed p { font-style: italic; color: var(--ink-3); }
|
||||
.post-cm-form { display: flex; align-items: center; gap: 8px; }
|
||||
.post-cm-form input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 44px;
|
||||
margin: 0;
|
||||
padding: 0 14px;
|
||||
border: 0;
|
||||
border-radius: var(--r-ctl);
|
||||
background: var(--tile-2);
|
||||
color: var(--ink);
|
||||
font: inherit;
|
||||
font-size: 14px;
|
||||
box-shadow: inset 0 0 0 1px var(--line);
|
||||
}
|
||||
.post-cm-form input::placeholder { color: var(--ink-3); }
|
||||
.post-cm-form input:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
|
||||
.post-link {
|
||||
appearance: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.post, .post-cm, .post-pop { animation: none; }
|
||||
.post-like-beat .post-heart { animation: none; }
|
||||
.post-play { transition: none; }
|
||||
}
|
||||
Reference in New Issue
Block a user