Skip to content
Open
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
38 changes: 15 additions & 23 deletions sass/_community.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,29 +77,12 @@ a.community-home-kicker:hover {
margin-bottom: 1.1rem;
}

// Visible pause/play control for the auto-scrolling marquee (WCAG 2.2.2:
// moving content that lasts more than 5s needs a mechanism to pause it).
.community-logo-pause {
flex: 0 0 auto;
padding: 0.4rem 1.1rem;
border: 1px solid #bfc6dd;
border-radius: 20px;
background: #fff;
color: #47506b;
font-size: 1.1rem;
font-weight: 700;
letter-spacing: 0.04em;
cursor: pointer;

&:hover {
border-color: $community-purple-800;
color: $community-purple-800;
}
}

// The vertical padding leaves room for a hovered logo's scale and underline,
// which overflow and the mask would otherwise clip.
.community-logo-row {
position: relative;
overflow: hidden;
padding: 0.4rem 0;
white-space: nowrap;
mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
-webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
Expand All @@ -113,9 +96,9 @@ a.community-home-kicker:hover {
will-change: transform;
}

// Paused via the visible toggle button (see community.js). The logos
// themselves are non-interactive, so there is no focus-based pause.
.community-logo-track.is-paused {
// Paused while the pointer is over the strip, so a logo can be clicked. The
// logo links are out of the tab order, so there is no focus-based pause.
.community-logo-row:hover .community-logo-track {
animation-play-state: paused;
}

Expand Down Expand Up @@ -146,6 +129,15 @@ a.community-home-kicker:hover {
max-height: var(--logo-height, 24px);
object-fit: contain;
}

img {
transition: transform 0.15s ease;
}

&:hover img {
box-shadow: 0 2px 0 0 $community-label-blue;
transform: scale(1.1);
}
}

@keyframes community-logo-marquee {
Expand Down
27 changes: 4 additions & 23 deletions static/assets/js/community.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
/**
* Interactions for /community/ and the homepage
*
* 1. Participant logo marquee pause/play toggle (WCAG 2.2.2: auto-moving
* content lasting more than 5s needs a control to pause it). Both pages.
* 2. "Community in action" photo carousel, /community/ only: pages through
* photos three at a time on desktop, two on tablet, one on mobile.
* Prev/next buttons and a "current / total" status are the only controls;
* there is no auto-scroll.
* "Community in action" photo carousel on /community/: pages through photos
* three at a time on desktop, two on tablet, one on mobile. Prev/next buttons
* and a "current / total" status are the only controls; there is no
* auto-scroll.
*/

(function () {
'use strict';

// Participant logo marquee pause/play toggle -----------------------------
function initLogoMarquee() {
var track = document.getElementById('communityLogoTrack');
var button = document.getElementById('communityLogoPause');
if (!track || !button) return;

button.addEventListener('click', function () {
var paused = track.classList.toggle('is-paused');
button.setAttribute('aria-pressed', paused ? 'true' : 'false');
button.textContent = paused ? 'Play' : 'Pause';
});
}

function init() {
initLogoMarquee();

var track = document.getElementById('communityPhotoTrack');
var prev = document.getElementById('communityPhotoPrev');
var next = document.getElementById('communityPhotoNext');
Expand Down
2 changes: 0 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,4 @@ <h3>{{ card.title }}</h3>
</div>
</div>

<script src="/assets/js/community.js" defer></script>

{%- endblock content -%}
24 changes: 11 additions & 13 deletions templates/macros/community.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
{% endcomponent logo_height %}

{# One full set of logos. The marquee renders it twice; the copy is hidden from
assistive tech. Logos are non-interactive: the "Valkey participants" kicker
already links to /participants/, where each logo is linked with a
description. Rendering them as links here added ~20 tab stops with no skip
link and let keyboard focus scroll the marquee off-track. #}
assistive tech. Each logo links to the participant's site for mouse users,
since hovering the strip pauses it. The links are kept out of the tab order:
~20 tab stops with no skip link was too many, and keyboard focus scrolled
the marquee off-track. The "Valkey participants" kicker links to
/participants/, where each logo is linked with a description. #}
{% component logo_set(participants, duplicate=false, loading="eager") %}
<div class="community-logo-set"{% if duplicate %} aria-hidden="true"{% endif %}>
{%- for participant in participants -%}
Expand All @@ -37,26 +38,23 @@
{%- set height %}{{< logo_height src={src} />}}{% endset -%}
{%- set height = height | trim -%}
{%- set alt = participant.image.alt | default(value=participant.name ~ " logo") -%}
<span class="community-logo-cell" title="{{ participant.name }}" style="--logo-height: {{ height }}px">
<a class="community-logo-cell" href="{{ participant.link }}" tabindex="-1" title="{{ participant.name }}" style="--logo-height: {{ height }}px">
<img src="{{ src }}" alt="{% if not duplicate %}{{ alt }}{% endif %}" loading="{{ loading }}" decoding="async">
</span>
</a>
{%- endif -%}
{%- endfor -%}
</div>
{% endcomponent logo_set %}

{# The whole strip: kicker, pause control, and the marquee. Each page supplies
its own wrapper. community.js finds the track and button by id, so a page
holds at most one strip. Logos load eagerly by default, for /community/
where the strip is above the fold; a page with the strip further down
passes loading="lazy". #}
{# The whole strip: kicker and the marquee. Each page supplies its own
wrapper. Logos load eagerly by default, for /community/ where the strip is
above the fold; a page with the strip further down passes loading="lazy". #}
{% component logo_strip(participants, loading="eager") -%}
<div class="community-logo-band-head">
<a class="community-home-kicker" href="/participants/">Valkey participants</a>
<button class="community-logo-pause" type="button" id="communityLogoPause" aria-pressed="false" aria-label="Pause the scrolling participant logos">Pause</button>
</div>
<div class="community-logo-row" role="group" aria-label="Valkey participant organizations">
<div class="community-logo-track" id="communityLogoTrack">
<div class="community-logo-track">
{{< logo_set participants={participants} loading={loading} />}}
{{< logo_set participants={participants} duplicate={true} loading={loading} />}}
</div>
Expand Down