Audit fixes against /channel/{slug}:
1. Fluid video grid — repeat(auto-fill, minmax(260px, 1fr)) replaces
the three fixed breakpoints (3/2/4 cols at 1101/1500/… px) that
produced different card widths and could overflow 390 / 1280 /
1920. min-width:0 on every grid child so a long unbroken title
(CJK, "SPARTAWORRIOR") can't widen its track past 1fr.
2. Scoreboard thumbnail — stop including vs-mini + scorebar-mini on
match cards. Those partials leaked fighter names, "AKA/AO",
"ROUND 1", "0:00" into the card DOM, showing stale 0-0 for
finished matches and breaking title layout at narrow widths. The
regular <img> above is the thumbnail now; VS intro + live scorebar
still render on the full match player page where they belong.
3. Sort pills — Latest/Popular/Oldest now append #videos so the page
stays on the Videos tab after reload instead of jumping to Wall.
4. Shorts tab — always render for the owner (so the "My Shorts"
sidebar link always lands somewhere), with an empty-state card
when no shorts exist. Visitors still see it only when shorts > 0.
5. Subscriptions sidebar link — href="#" replaced by a real
/feed/subscriptions route backed by UserController@subscriptionsFeed
that reuses the videos/index view with the subscription feed.
6. Header view count — totalViews now sums video_views over public
videos for visitors (owner still sees the full total). Previously
leaked unlisted and private video view counts.
7. Card redundancy — new hideChannelInfo prop on <x-video-card/>
suppresses the per-card avatar + channel-name row. The channel
page passes it; everywhere else keeps the row.
9. Decorative logo — the second <img alt="Play"> in the responsive
header pair now has alt="" so a screen reader doesn't announce
"Play Play". ⋮ menu button gets aria-label="More actions".
10. Privacy — age, gender, location and horoscope strip now only
render to the owner on the channel header (horoscope strip is
also allowed when the compatibility match-up is being shown to
a signed-in visitor). Joined-month stays public.
11. Notifications dropdown — initial state is "No notifications"
not an indefinite "Loading…". Opening the panel now shows a
spinner while fetching, surfaces a Retry button on error, and
bails out of the "Loading…" state on non-ok HTTP responses.
Title clamp — .yt-video-title is now a 2-line box with
overflow-wrap:anywhere so CJK titles and long words wrap mid-word
and can't widen the card past its track.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
458 lines
11 KiB
PHP
458 lines
11 KiB
PHP
{{-- Shared card styles (video-card + playlist-card). Extracted so the CSS
|
|
loads on pages that render playlist cards but no video cards, e.g.
|
|
/videos?filter=playlists. Wrapped in @once so it emits only once. --}}
|
|
@once
|
|
<style>
|
|
/* Base styles for video card — every card in the grid renders at the same
|
|
overall size regardless of type (video / shorts / match / playlist). The
|
|
grid handles equal widths; height parity is enforced here by making the
|
|
card a column-flex container, the thumb a strict 16/9 box, and every
|
|
text row a fixed line-height so missing channel/meta rows never shrink
|
|
the card. */
|
|
.yt-video-card {
|
|
cursor: pointer;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* When the 3-dot menu is open, promote this card above its siblings so
|
|
the dropdown-menu (Bootstrap default z-index 1000) isn't visually
|
|
covered by later cards in the grid. Cards are position:static by
|
|
default, so siblings later in the DOM naturally paint on top even
|
|
though the dropdown itself has a high z-index — the stacking is
|
|
compared at the card level, not the dropdown level. `:has()` triggers
|
|
only while a menu is `.show`ing, so this doesn't affect the normal
|
|
grid layout. */
|
|
.yt-video-card:has(.dropdown-menu.show) {
|
|
position: relative;
|
|
z-index: 50;
|
|
}
|
|
|
|
/* Same fix for the ⋮ menu container — .yt-video-info has overflow:hidden
|
|
(to hard-cap card height for grid parity), which was clipping the
|
|
dropdown's bottom edge. Allow the dropdown to escape by giving its
|
|
wrapper a stacking context and letting overflow leak upward from that
|
|
ancestor only when a menu is open. */
|
|
.yt-video-card .yt-video-info:has(.dropdown-menu.show) {
|
|
overflow: visible;
|
|
}
|
|
|
|
.yt-video-card .yt-video-thumb {
|
|
position: relative;
|
|
aspect-ratio: 16/9;
|
|
border-radius: 12px;
|
|
overflow: hidden;
|
|
background: #1a1a1a;
|
|
}
|
|
|
|
/* Skeleton shimmer while thumbnail loads */
|
|
.yt-video-card .yt-video-thumb::before {
|
|
content: '';
|
|
position: absolute;
|
|
inset: 0;
|
|
background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
|
|
background-size: 200% 100%;
|
|
animation: thumb-shimmer 1.4s ease infinite;
|
|
z-index: 0;
|
|
border-radius: inherit;
|
|
}
|
|
|
|
@keyframes thumb-shimmer {
|
|
0% { background-position: 200% 0; }
|
|
100% { background-position: -200% 0; }
|
|
}
|
|
|
|
.yt-video-card .yt-video-thumb.loaded::before {
|
|
animation: none;
|
|
opacity: 0;
|
|
}
|
|
|
|
.yt-video-card .yt-video-thumb img {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
opacity: 0;
|
|
transition: opacity 0.3s ease, transform 0.2s ease;
|
|
z-index: 1;
|
|
}
|
|
|
|
.yt-video-card .yt-video-thumb img.loaded {
|
|
opacity: 1;
|
|
}
|
|
|
|
.yt-video-card:hover .yt-video-thumb img.loaded {
|
|
transform: scale(1.03);
|
|
}
|
|
|
|
.yt-video-card .yt-video-thumb video {
|
|
width: 100%;
|
|
height: 100%;
|
|
/* Match the still-image thumbnail: always cover the 16/9 box so
|
|
portrait and landscape sources render at the same visible size,
|
|
instead of letterboxing (which made portrait previews look
|
|
smaller than landscape ones). */
|
|
object-fit: cover;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
opacity: 0;
|
|
transition: opacity 0.3s ease;
|
|
background: #000;
|
|
z-index: 2;
|
|
}
|
|
|
|
.yt-video-card .yt-video-thumb video.active {
|
|
opacity: 1;
|
|
}
|
|
|
|
/* Audio preview overlay (equalizer) */
|
|
.audio-preview-overlay {
|
|
position: absolute;
|
|
inset: 0;
|
|
display: flex;
|
|
align-items: flex-end;
|
|
justify-content: center;
|
|
padding-bottom: 14px;
|
|
opacity: 0;
|
|
transition: opacity 0.3s ease;
|
|
pointer-events: none;
|
|
z-index: 3;
|
|
}
|
|
|
|
.yt-video-thumb.audio-playing .audio-preview-overlay {
|
|
opacity: 1;
|
|
}
|
|
|
|
.audio-eq {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
gap: 3px;
|
|
height: 24px;
|
|
background: rgba(0,0,0,0.55);
|
|
padding: 4px 8px;
|
|
border-radius: 20px;
|
|
}
|
|
|
|
.audio-eq span {
|
|
display: block;
|
|
width: 3px;
|
|
border-radius: 2px;
|
|
background: #e61e1e;
|
|
animation: eq-bar 0.8s ease-in-out infinite;
|
|
}
|
|
|
|
.audio-eq span:nth-child(1) { height: 6px; animation-delay: 0s; }
|
|
.audio-eq span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
|
|
.audio-eq span:nth-child(3) { height: 20px; animation-delay: 0.05s; }
|
|
.audio-eq span:nth-child(4) { height: 12px; animation-delay: 0.2s; }
|
|
.audio-eq span:nth-child(5) { height: 8px; animation-delay: 0.1s; }
|
|
|
|
@keyframes eq-bar {
|
|
0%, 100% { transform: scaleY(0.4); }
|
|
50% { transform: scaleY(1); }
|
|
}
|
|
|
|
.yt-video-card .yt-video-duration {
|
|
position: absolute;
|
|
bottom: 8px;
|
|
right: 8px;
|
|
background: rgba(0,0,0,0.8);
|
|
color: white;
|
|
padding: 3px 6px;
|
|
border-radius: 4px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
z-index: 3;
|
|
}
|
|
|
|
.yt-video-card .yt-shorts-badge {
|
|
position: absolute;
|
|
top: 8px;
|
|
left: 8px;
|
|
background: rgba(230, 30, 30, 0.9);
|
|
color: white;
|
|
padding: 4px 8px;
|
|
border-radius: 4px;
|
|
font-size: 11px;
|
|
font-weight: 700;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
z-index: 3;
|
|
}
|
|
|
|
.yt-video-card .yt-shorts-badge i {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.yt-video-card .yt-track-lang-badge {
|
|
position: absolute;
|
|
top: 8px;
|
|
right: 8px;
|
|
background: rgba(0,0,0,0.75);
|
|
color: #fff;
|
|
padding: 3px 7px;
|
|
border-radius: 4px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
letter-spacing: 0.3px;
|
|
z-index: 3;
|
|
backdrop-filter: blur(4px);
|
|
}
|
|
.yt-video-card .yt-track-lang-badge .fi {
|
|
width: 16px;
|
|
height: 12px;
|
|
border-radius: 2px;
|
|
display: inline-block;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.yt-video-card .yt-visibility-badge {
|
|
position: absolute;
|
|
bottom: 8px;
|
|
left: 8px;
|
|
padding: 3px 7px;
|
|
border-radius: 4px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
pointer-events: none;
|
|
z-index: 3;
|
|
}
|
|
|
|
.yt-video-card .yt-visibility-private {
|
|
background: rgba(220, 38, 38, 0.88);
|
|
color: #fff;
|
|
}
|
|
|
|
.yt-video-card .yt-visibility-unlisted {
|
|
background: rgba(30, 30, 30, 0.82);
|
|
color: #facc15;
|
|
border: 1px solid rgba(250, 204, 21, 0.4);
|
|
}
|
|
|
|
.yt-video-card .yt-video-info {
|
|
display: flex;
|
|
margin-top: 12px;
|
|
gap: 12px;
|
|
/* Reserve a floor for the info block so every card lands at the same
|
|
height when titles are short. Two-line titles are allowed to grow
|
|
the block vertically — overflow:visible so no row is hidden. */
|
|
min-height: 76px;
|
|
}
|
|
/* On channel pages the avatar + channel-name row is suppressed by the
|
|
component's hideChannelInfo prop; drop the floor so the card doesn't
|
|
leave empty space where the row used to be. */
|
|
.yt-video-card .yt-video-info-no-channel { min-height: 60px; }
|
|
.yt-video-card .yt-video-details {
|
|
min-width: 0;
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.yt-video-card .yt-channel-icon {
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 50%;
|
|
background: #555;
|
|
flex-shrink: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.yt-video-card .yt-channel-icon img.loaded {
|
|
opacity: 1 !important;
|
|
}
|
|
|
|
.yt-video-card .yt-video-details {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.yt-video-card .yt-video-title {
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
color: #fff;
|
|
margin: 0 0 4px;
|
|
line-height: 1.3;
|
|
/* Two-line clamp. overflow-wrap:anywhere lets CJK titles and long
|
|
words (e.g. "SPARTAWORRIOR" or "EVIS ― 帰還を待つ覇者の鼓動")
|
|
break mid-word so they can't widen the card beyond its grid track.
|
|
Line-clamp replaces the single-line ellipsis the old rule used. */
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
overflow-wrap: anywhere;
|
|
word-break: break-word;
|
|
max-height: calc(1.3em * 2);
|
|
}
|
|
|
|
.yt-video-card .yt-video-title a {
|
|
color: inherit;
|
|
text-decoration: none;
|
|
display: block;
|
|
max-width: 100%;
|
|
overflow-wrap: anywhere;
|
|
word-break: break-word;
|
|
}
|
|
/* Inline children (flags, corner-colored fighter spans) must not break
|
|
the single-line layout. */
|
|
.yt-video-card .yt-video-title a > * { vertical-align: middle; }
|
|
.yt-video-card .yt-video-title a .fi { display: inline-block; }
|
|
.vc-lang-flag {
|
|
display: inline-block;
|
|
width: 16px;
|
|
height: 12px;
|
|
border-radius: 2px;
|
|
flex-shrink: 0;
|
|
vertical-align: baseline;
|
|
position: relative;
|
|
top: 1px;
|
|
}
|
|
|
|
.yt-video-card .yt-channel-icon {
|
|
text-decoration: none;
|
|
display: block;
|
|
}
|
|
|
|
.yt-video-card .yt-channel-name,
|
|
.yt-video-card .yt-video-meta {
|
|
color: #aaa;
|
|
font-size: 14px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
line-height: 22px;
|
|
height: 22px;
|
|
}
|
|
|
|
.yt-video-card a.yt-channel-name {
|
|
display: block;
|
|
text-decoration: none;
|
|
}
|
|
.yt-video-card a.yt-channel-name:hover { color: #fff; }
|
|
|
|
/* Type label in meta row */
|
|
.yt-type-label {
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.4px;
|
|
}
|
|
.yt-type-music { color: #c084fc; }
|
|
.yt-type-match { color: #60a5fa; }
|
|
.yt-type-generic { color: #f87171; }
|
|
|
|
/* More button — visible only on hover (touch devices always show it) */
|
|
.yt-video-card .yt-more-btn {
|
|
background: transparent;
|
|
border: none;
|
|
color: #fff;
|
|
cursor: pointer;
|
|
padding: 4px;
|
|
border-radius: 50%;
|
|
width: 32px;
|
|
height: 32px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: background 0.2s, opacity 0.15s;
|
|
flex-shrink: 0;
|
|
}
|
|
@media (hover: hover) {
|
|
.yt-video-card .yt-more-btn { opacity: 0; }
|
|
.yt-video-card:hover .yt-more-btn,
|
|
.yt-video-card .yt-more-btn:focus,
|
|
.yt-video-card .yt-more-btn[aria-expanded="true"] { opacity: 1; }
|
|
}
|
|
.yt-video-card .yt-more-btn:hover {
|
|
background: #3f3f3f;
|
|
}
|
|
|
|
/* Dropdown menu styles - use Bootstrap defaults */
|
|
.yt-video-card .dropdown-menu-dark {
|
|
background: #282828;
|
|
border: 1px solid #3f3f3f;
|
|
border-radius: 12px;
|
|
padding: 8px 0;
|
|
min-width: 200px;
|
|
}
|
|
|
|
.yt-video-card .dropdown-item {
|
|
color: #fff;
|
|
padding: 10px 16px;
|
|
font-size: 14px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 16px;
|
|
}
|
|
|
|
.yt-video-card .dropdown-item:hover {
|
|
background: #3f3f3f;
|
|
color: #fff;
|
|
}
|
|
|
|
.yt-video-card .dropdown-item.text-danger {
|
|
color: #ef4444 !important;
|
|
}
|
|
|
|
.yt-video-card .dropdown-item.text-danger:hover {
|
|
background: #3f3f3f;
|
|
color: #ef4444 !important;
|
|
}
|
|
|
|
.yt-video-card .dropdown-item i {
|
|
width: 20px;
|
|
text-align: center;
|
|
}
|
|
|
|
.yt-video-card .dropdown-divider {
|
|
border-color: #3f3f3f;
|
|
margin: 8px 0;
|
|
}
|
|
|
|
/* Small size styles */
|
|
.yt-video-card-sm .yt-video-thumb {
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.yt-video-card-sm .yt-video-info {
|
|
margin-top: 8px;
|
|
gap: 8px;
|
|
}
|
|
|
|
.yt-video-card-sm .yt-channel-icon {
|
|
width: 28px;
|
|
height: 28px;
|
|
}
|
|
|
|
.yt-video-card-sm .yt-video-title {
|
|
font-size: 13px;
|
|
}
|
|
|
|
.yt-video-card-sm .yt-channel-name,
|
|
.yt-video-card-sm .yt-video-meta {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.yt-video-card-sm .yt-more-btn {
|
|
width: 24px;
|
|
height: 24px;
|
|
}
|
|
|
|
</style>
|
|
@endonce
|