Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions frontend/card-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ const CARD_EXPORT_BG = "#16301f";
// extra right-edge background is harmless, clipping the content isn't.
const CARD_HORIZONTAL_PADDING = 40;

// Every card's own close/fold/resize chrome, this Save button itself, and
// Linemate Card's "See more" toggle (meaningless once buildExportClone below
// force-expands the roster to its full length — see linemate-card.js's
// prepareClone) shouldn't appear in the exported image. html2canvas's
// Every card's own close/fold/resize chrome and this Save button itself
// shouldn't appear in the exported image. html2canvas's
// ignoreElements is the standard way to exclude specific nodes from a
// capture without a hide-then-restore choreography.
function shouldIgnoreForExport(el) {
Expand All @@ -48,7 +46,7 @@ function shouldIgnoreForExport(el) {
el.classList.contains("merge-mode-switch") ||
el.classList.contains("merge-card-scroll-hint") ||
el.classList.contains("linemate-card-scroll-hint") ||
el.classList.contains("linemate-see-more"))
el.classList.contains("linemate-card-size-reminder"))
);
}

Expand Down Expand Up @@ -76,16 +74,19 @@ function fitCloneToContent(clone) {
// sidesteps that entirely — with nothing scrolling underneath them in the
// export, sticky was only ever pinning them to their own already-correct
// flow position anyway.
clone.querySelectorAll(".merge-table-frozen, .linemate-table-frozen, .merge-read-frozen").forEach((cell) => {
cell.style.position = "static";
cell.style.left = "";
});
clone
.querySelectorAll(".merge-table-frozen, .linemate-table-frozen, .merge-read-frozen, .linemate-read-label")
.forEach((cell) => {
cell.style.position = "static";
cell.style.left = "";
});

// Lays every column flat in one row instead of clipping to whatever was
// scrolled into view, then widens the card itself to fit.
let requiredWidth = 0;
clone.querySelectorAll(".merge-table-wrap, .linemate-table-wrap, .linemate-summary-wrap").forEach((scrollEl) => {
scrollEl.style.overflow = "visible";
scrollEl.style.maxHeight = "none";
requiredWidth = Math.max(requiredWidth, scrollEl.scrollWidth);
});
if (requiredWidth > 0) {
Expand Down Expand Up @@ -120,7 +121,7 @@ function buildExportClone(cardEl) {
// layout — a detached node always reports 0.
document.body.appendChild(clone);

clone.classList.remove("is-folded", "is-dragging", "is-resizing");
clone.classList.remove("is-folded", "is-dragging", "is-resizing", "is-wide");

const panelEl = clone.querySelector(".scout-card-panel");
// The panel's own 2px rounded border is dropped here: compositeFooterCanvas draws one
Expand Down
5 changes: 3 additions & 2 deletions frontend/cards-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ export function cascadeScoutCardPosition(cardEl) {
// hides the metric body via CSS (.is-folded); a card the user has edge-
// resized taller would otherwise leave a tall dead gap under the header once
// that body disappears, so its inline panel height is stashed here and
// restored on unfold rather than lost. `onUnfold` lets a Linemate Card reset
// its "See more" state back to collapsed every time it re-expands (§2.5).
// restored on unfold rather than lost. `onUnfold`, when given, lets a card
// refresh something that has no layout while folded (the Comparison Card's
// sticky-column offsets) every time it re-expands.
export function applyCardFoldVisual(cardEl, state, onUnfold) {
cardEl.classList.toggle("is-folded", state.folded);
const foldBtn = cardEl.querySelector(".scout-fold");
Expand Down
13 changes: 7 additions & 6 deletions frontend/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ export const LABEL_ALPHA = 1;
export const MERGE_CARD_MAX_MEMBERS = 5;
export const MERGE_QUOTA = 8;

// Position-group pulled into a Linemate Card's roster and the per-category
// cap on how many can be shown — both keyed by category, not position,
// since a Linemate Card spans every position within its anchor's category
//.
// Position-group pulled into a Linemate Card's roster, keyed by category,
// not position, since a Linemate Card spans every position within its
// anchor's category. The roster itself has no size limit — the threshold is
// the only gate — so LINEMATE_SIZE_REMINDER_AT is only where the card starts
// telling the user that a higher threshold keeps it compact (more linemates
// than that, per category: the point where the old roster cap used to cut).
export const LINEMATE_POSITIONS = { pass_block: ["T", "G", "C"], pass_rush: ["ED", "DI"] };
export const LINEMATE_CAP = { pass_block: 5, pass_rush: 7 };
export const LINEMATE_VISIBLE_DEFAULT = 5;
export const LINEMATE_SIZE_REMINDER_AT = { pass_block: 5, pass_rush: 7 };

// Mirrors config.py's DISPLAY_DECIMALS — keep in sync. UI-display rounding
// only: plots (render.js's xVals/yVals, drawn straight from record[key])
Expand Down
5 changes: 4 additions & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ <h3 class="pcs-column-title">Player Comparisons</h3>
</label>
<ul class="linemate-card-note-list">
<li class="linemate-card-note linemate-card-roster-note"></li>
<li class="linemate-card-note linemate-card-size-reminder" hidden></li>
<!-- Same scroll cue as Merge Card's .merge-card-scroll-hint — the
roster table's frozen Player/Position columns (see
.linemate-table-frozen in style.css) make the horizontal
Expand All @@ -586,6 +587,9 @@ <h3 class="pcs-column-title">Player Comparisons</h3>
<li class="linemate-card-note linemate-card-scroll-hint linemate-card-scroll-hint--read">
Please scroll down for more metrics.
</li>
<li class="linemate-card-note linemate-card-scroll-hint linemate-card-scroll-hint--read-wide">
Please scroll right for more players.
</li>
<li class="linemate-card-note linemate-card-scroll-hint linemate-card-scroll-hint--sort">
Please scroll right for more metrics.
</li>
Expand All @@ -605,7 +609,6 @@ <h4 class="scout-section-title linemate-table-title">
<div class="linemate-table-wrap">
<table class="linemate-table"></table>
</div>
<button type="button" class="linemate-see-more" hidden>See more</button>
<div class="linemate-summary-wrap">
<h4 class="scout-section-title">Line Summary</h4>
<table class="linemate-summary-table"></table>
Expand Down
Loading
Loading