Skip to content

Conversation

@dobroeee
Copy link
Owner

@dobroeee dobroeee commented Feb 1, 2026

Motivation

  • Provide a ready-to-paste custom dark slider for Tilda block #123 that automatically pulls card data from the collection block #rec1861153111 so the client can edit content in Tilda without touching code.
  • Display card title, description, image and four hall indicators that should be highlighted only when the corresponding hall name appears in the Tilda card "подзаголовок" (subtitle) as bullet items.
  • Support both autoplay and manual user control, with clear responsive behavior for mobile and desktop.
  • Enforce 40px horizontal edge padding and a modern dark visual style to match the design brief.

Description

  • Adds tilda-slider-123.html containing a self-contained HTML/CSS/JS snippet that renders the slider and can be pasted into Tilda HTML block #123.
  • The CSS defines dark theme variables, --slider-edge-padding: 40px for the requested horizontal spacing, responsive card sizing, navigation buttons and dots, and active/inactive styles for discipline pills.
  • The JS extracts items from the source record selector (by default #rec1861153111) using common Tilda selectors, parses the subtitle into bullets with a robust regex (split(/\n|\r|•|·|\*|-/)), and builds cards dynamically.
  • Discipline highlighting is driven by a disciplineLabels array ('Зал 1''Зал 4') and a case-insensitive match against parsed subtitle bullets; autoplay runs every 5s and manual controls include prev/next buttons and dots with ARIA roles.

Testing

  • No automated tests (unit/CI) were executed for this static snippet.

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ddfcac4cb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +206 to +222
const buildCard = (data) => {
const bullets = parseBullets(data.subtitle || '');
const bulletSet = new Set(bullets.map(normalize));

const card = document.createElement('div');
card.className = 'tilda-slider__card';
card.innerHTML = `
<div class="tilda-slider__card-header">
<img class="tilda-slider__card-image" src="${data.image}" alt="${data.title}">
<h3 class="tilda-slider__card-title">${data.title}</h3>
</div>
<p class="tilda-slider__card-description">${data.description}</p>
<div class="tilda-slider__disciplines">
${disciplineLabels
.map((label) => {
const active = bulletSet.has(normalize(label));
return `

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match hall labels by substring, not exact bullet equality

The discipline highlight only turns on when a subtitle bullet exactly equals the hall label after lowercasing (bulletSet.has(normalize(label))). If a bullet includes any extra text like "Зал 1 — йога" or "Зал 1 (утро)", the hall name is present but the exact match fails, so the pill stays inactive. This breaks the stated behavior in cases where subtitles add clarifying text to each bullet; consider checking includes on the normalized bullet text or stripping punctuation/extra text before comparison.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant