diff --git a/content/_index.md b/content/_index.md index 16ea142e..fafc9cc9 100644 --- a/content/_index.md +++ b/content/_index.md @@ -6,42 +6,39 @@ repos_heading= "Featured repositories" github_org= "https://github.com/valkey-io" github_org_text= "All repos in the Valkey GitHub organization" -# Number of blog posts shown in the "Latest Blog Posts" panel. +# Number of blog posts shown in the "Latest blog posts" panel. latest_blog_posts= 4 headline= "Valkey: an open source, in-memory data store" long_description= "" [extra.hero] -headings = ["FAST. RELIABLE.", "OPEN SOURCE, FOREVER."] +headings = ["Fast. Reliable.", "Open source, forever."] subtitle = "Valkey is an open source (BSD) high-performance key/value datastore that supports a variety of workloads such as caching, message queues, and can act as a primary database. The project is backed by the Linux Foundation, ensuring it will remain open source forever." -button_text = "GET STARTED" +button_text = "Get started" button_url = "/topics/quickstart" -secondary_button_text = "INSTALL VALKEY" +secondary_button_text = "Install Valkey" secondary_button_url = "/topics/installation" +command = "docker run -d -p 6379:6379 valkey/valkey" [[extra.documentation_cards]] title = "Usage guide" description = "Detailed documentation on the various datatypes supported by Valkey and best practices." -button_text = "Documentation by topic" button_url = "/topics/" [[extra.documentation_cards]] title = "Valkey API" description = "View the full list of Valkey commands including first party modules." -button_text = "Command Reference" button_url = "/commands" [[extra.documentation_cards]] title = "Clients" description = "Recommended Valkey client libraries for Python, Java, Go, Node.js, PHP, C#, Ruby, and more." -button_text = "Learn More" button_url = "/clients/" [[extra.documentation_cards]] title = "Performance" description = "Deep dive into Valkey performance numbers across versions." -button_text = "Explore" button_url = "/performance/" [[extra.download_ctas]] @@ -56,8 +53,8 @@ title= "Read the docs" +++ -## Learn more +## Learn more {.community-home-kicker} -Valkey can run as either a **standalone** daemon or in a **cluster**, with options for **replication** and **high availability**. Valkey natively supports a rich collection of datatypes, including **strings**, **numbers**, **hashes**, **lists**, **sets**, **sorted sets**, **bitmaps**, **hyperloglogs** and more. +Valkey can run as either a standalone daemon or in a cluster, with options for replication and high availability. Valkey natively supports a rich collection of datatypes, including strings, numbers, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs and more. You can operate on data structures in-place with an expressive collection of commands. -Valkey also supports native extensibility with built-in scripting support for **Lua** and supports **module** plugins to create new commands, data types, and more. +Valkey also supports native extensibility with built-in scripting support for Lua and supports module plugins to create new commands, data types, and more. diff --git a/sass/_cards.scss b/sass/_cards.scss new file mode 100644 index 00000000..2fde9909 --- /dev/null +++ b/sass/_cards.scss @@ -0,0 +1,225 @@ +// Cards: white cards on a light canvas, the design /community/ introduced. +// The homepage is built from it. The canvas (.community-home-canvas), section +// head and label (.community-home-section-head, .community-home-kicker), and +// the logo strip are /community/'s, in _community.scss. +// +// Imported before _community.scss, which takes its palette and the card +// surface from here. + +$community-purple-900: #2d2471; +$community-purple-800: #35247e; +$community-blue-500: #5b6fff; +$community-ink: #072150; + +// The white card: /community/'s Connect card and every card below. The +// border also draws the edge in forced-colors mode, which drops the shadow. +@mixin card { + border: 1px solid #d5d9e8; + background: #fff; + border-radius: 18px; + box-shadow: 0 12px 32px rgba(60, 60, 130, 0.16); +} + +// Homepage (templates/index.html) ------------------------------------------- + +// Every block below the hero is a card on .community-home-canvas. Two columns +// from 900px: the release cards stack beside the blog card, then Learn more +// and the logo strip run full width. The 1fr row takes any height the blog +// card has over the two release cards, and the past releases card sits at the +// top of it, so both release cards keep their natural height. +.homepage-grid { + display: grid; + gap: 2rem; + max-width: var(--max-width); + margin: 3.4rem auto; + + @include respond-min(900px) { + grid-template-columns: 1fr 1fr; + grid-template-rows: auto 1fr auto auto; + grid-template-areas: + "release blog" + "past blog" + "learn learn" + "participants participants"; + + .homepage-card-release { grid-area: release; } + .homepage-card-past { grid-area: past; align-self: start; } + .homepage-card-blog { grid-area: blog; } + .homepage-card-learn { grid-area: learn; } + .homepage-card-participants { grid-area: participants; } + } +} + +// Connect's padding is too wide for a 390px screen, so cards start tighter. +.homepage-card { + @include card; + min-width: 0; + padding: 2.2rem 2rem; + + @include respond-min(768px) { + padding: 2.7rem 3.4rem; + } + + > :last-child { + margin-bottom: 0; + } + + // Sentence-case section labels; /community/ keeps the uppercase kicker. + // #4a5ad8 is the hero button blue: 5.6:1 on white, where the kicker's + // #5b6fff is 4.1:1. 2.4rem keeps them above the cards' titles, the largest + // of which is 1.8rem. Balanced wrapping avoids leaving "releases" alone on + // a line. + .community-home-kicker { + color: #4a5ad8; + font-size: 2.4rem; + font-weight: 600; + letter-spacing: normal; + text-transform: none; + text-wrap: balance; + + // The release card's label is a heading around a link; it looks like + // the "Valkey participants" link label. + a { + color: inherit; + + &:hover { + color: $community-purple-800; + } + } + } + + .link-readmore { + text-transform: none; + font-size: 1.4rem; + } + + // Baseline-aligned: the label is the tallest item, so it sits at the top + // of the head and lines up with the labels in the other cards, and the + // link shares its baseline. + .community-home-section-head { + align-items: baseline; + + .link-readmore { + margin: 0; + } + } +} + +// One row per post, split by the logo strip's hairline. The title takes the +// same ink as the latest release and Learn more titles. +.homepage-blog-card { + display: block; + padding: 1.4rem 0; + border-top: 1px solid #e9ebf4; + + &:first-child { + padding-top: 0; + border-top: 0; + } + + &:last-child { + padding-bottom: 0; + } + + &:hover .homepage-blog-card-title { + text-decoration: underline; + } +} + +.homepage-blog-card-title { + margin: 0 0 0.3rem; + color: $community-ink; + font-size: 1.7rem; + font-weight: 700; + line-height: 1.3; +} + +.homepage-blog-card-meta { + margin: 0 0 0.5rem; + color: #606985; + font-size: 1.3rem; +} + +.homepage-blog-card-description { + display: -webkit-box; + margin: 0; + overflow: hidden; + color: #47506b; + font-size: 1.4rem; + line-height: 1.45; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +// The kicker is the markdown heading in content/_index.md. Flex keeps the +// inline-block kicker off the parent's line box, which would push it below +// the kickers in the other cards. +.homepage-learn-intro { + display: flex; + flex-direction: column; + align-items: flex-start; + + p { + margin: 1.2rem 0 0; + color: #47506b; + font-size: 1.6rem; + line-height: 1.6; + } +} + +.homepage-learn-grid { + display: grid; + gap: 2.4rem; + margin-top: 2.4rem; + + @include respond-min(600px) { + grid-template-columns: 1fr 1fr; + } + + @include respond-min(1100px) { + grid-template-columns: repeat(4, 1fr); + } +} + +.homepage-learn-item { + display: block; + padding: 1.8rem 2rem; + border-radius: 14px; + background: #f8faff; + transition: background 0.15s; + + &:hover { + background: #eef1fb; + + h3 { + text-decoration: underline; + } + } + + &:focus-visible { + outline: 2px solid $community-blue-500; + outline-offset: 2px; + } + + h3 { + margin: 0 0 0.8rem; + color: $community-ink; + font-size: 1.8rem; + font-weight: 700; + + // Same chevron as .link-readmore. inline-block keeps the hover underline + // off it. + &::after { + content: '\203A'; + display: inline-block; + margin-left: 0.4em; + } + } + + p { + margin: 0; + color: #47506b; + font-size: 1.5rem; + line-height: 1.5; + } +} diff --git a/sass/_community.scss b/sass/_community.scss index a143a17b..adec2ad1 100644 --- a/sass/_community.scss +++ b/sass/_community.scss @@ -1,12 +1,8 @@ -// Community landing page (templates/community-home.html) -// The "Ways to contribute" tiles reuse the shared .community-card styles -// from _valkey.scss. Everything here is specific to the landing page: -// participant logo strip, photo hero, connect bar, and photo carousel. - -$community-purple-900: #2d2471; -$community-purple-800: #35247e; -$community-blue-500: #5b6fff; -$community-ink: #072150; +// Community landing page (templates/community-home.html): participant logo +// strip, photo hero, connect bar, and photo carousel. The "Ways to +// contribute" tiles reuse the shared .community-card styles from +// _valkey.scss. The palette and the card surface come from _cards.scss, +// whose pages reuse the canvas, section head, kicker and logo strip below. // Shared pieces -------------------------------------------------------------- @@ -19,10 +15,11 @@ $community-ink: #072150; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; +} - &:hover { - color: $community-purple-800; - } +// Only labels that are links, such as "Valkey participants", change colour. +a.community-home-kicker:hover { + color: $community-purple-800; } .community-home-btn { @@ -237,7 +234,7 @@ $community-ink: #072150; // gutter is the single, page-wide rule so everything lines up with the // header/footer content column (--max-width). padding: 0.1px 2rem; - background: #f8faff; + background: #e8ebf5; } // Connect with us ----------------------------------------------------------- @@ -249,9 +246,7 @@ $community-ink: #072150; max-width: var(--max-width); margin: 3.4rem auto; padding: 2.7rem 3.4rem; - background: #fff; - border-radius: 18px; - box-shadow: 0 10px 28px rgba(60, 60, 130, 0.08); + @include card; @include respond-min(900px) { flex-direction: row; diff --git a/sass/_valkey.scss b/sass/_valkey.scss index c49e0f05..b29b0197 100644 --- a/sass/_valkey.scss +++ b/sass/_valkey.scss @@ -299,7 +299,8 @@ p { display: flex; } - &:hover { + &:hover, + &:focus-within { > span { color: #04202a; } @@ -321,6 +322,21 @@ p { text-decoration: none; } } + + // Desktop only: below 1024px the submenu is always listed under its link. + @include respond-min(1024px) { + &::after { + content: ''; + display: inline-block; + width: 0.45em; + height: 0.45em; + margin-left: 0.5em; + border-right: 2px solid currentColor; + border-bottom: 2px solid currentColor; + vertical-align: 0.25em; + transform: rotate(45deg); + } + } } .submenu { @@ -1719,14 +1735,19 @@ html.banner-hidden .banner { .hero-section { position: relative; background-size: cover; - background-position: right center; + // Only the photo layer moves; the gradients fill the box either way. + background-position: center, center, 65% center; background-color: #30186e; - background-image: linear-gradient(to bottom, rgba(48, 24, 110, 0.15), rgba(48, 24, 110, 0.75)), url('/img/hero-bg.webp'); + // The radial layer dims the photo behind the headline without hiding it. + background-image: + radial-gradient(ellipse 50% 60% at center, rgba(28, 18, 58, 0.6), rgba(28, 18, 58, 0)), + linear-gradient(to bottom, rgba(48, 24, 110, 0.15), rgba(48, 24, 110, 0.75)), + url('/img/hero-bg.webp'); display: flex; align-items: center; justify-content: center; overflow: hidden; - padding: 8rem 2rem; + padding: 3.5rem 2rem; &::after { content: ""; @@ -1734,11 +1755,6 @@ html.banner-hidden .banner { background-image: linear-gradient(to bottom, rgba(48, 24, 110, 0), rgba(48, 24, 110, 100)); pointer-events: none; } - - @include respond-min(768px) { - padding: 10rem 2rem; - - } } .hero-content { @@ -1753,7 +1769,6 @@ html.banner-hidden .banner { font-weight: 700; margin: 0; line-height: 1; - letter-spacing: 2px; color: white; @include respond-min(768px) { @@ -1763,7 +1778,7 @@ html.banner-hidden .banner { .hero-subtitle { font-size: 1.8rem; - font-weight: 700; + font-weight: 400; max-width: 800px; margin: 2rem auto 4rem; line-height: 1.6; @@ -1834,196 +1849,37 @@ html.banner-hidden .banner { } } -// Documentation Section Styles -.documentation-section { - padding: 2rem 2rem 4rem; - - // Continues the .whats-new-section gradient, finishing on the #6983ff that - // .homepage-participants-section starts from. - background: linear-gradient(rgb(81, 85, 193), #6983FF); - position: relative; - text-align: center; - color: white; - - @include respond-min(768px) { - padding-bottom: 8rem; - } - - .col { - max-width: 890px; - margin: 0 auto; - } - - a { - color: white; - text-decoration: underline; - } - - h2 { - width: 100%; - line-height: 1.2; - font-size: 3.75rem; - text-align: center; - font-weight: 700; - margin-bottom: 1.75rem; - - @include respond-min(768px) { - font-size: 6rem; - } - } - - p { - margin-bottom: 2rem; - } -} - -.documentation-card-grid { - margin-top: 4rem; - - @media (max-width: 1100px) { - .col { - flex: 1 1 50%; - margin-bottom: 3rem; - } - } - - @media (max-width: 768px) { - .col { - flex: 1 1 100%; - } - } -} - -.documentation-card { - display: flex; - flex-direction: column; - - // Spaces title from description, and keeps the button off the description - // even when `margin-top: auto` has no slack left to push it down. - gap: 1.5rem; - padding: 4rem; - border-radius: 20px; - color: white; - background: #2d2471; - - @include respond-min(768px) { - min-height: 100%; - } - - h3 { - font-weight: 700; - font-size: 2rem; - line-height: 1.2; - text-align: center; - color: white; - margin: 0 0 .5rem; - } - - p { - text-align: left; - margin: 0; - } - - ul { - text-align: left; - padding: 0 0 0 18px; - margin: 10px 0 20px; - } - - a.btn { - color: white; - border-radius: 24px; - border: 1px solid currentcolor; - padding: 1rem; - margin-top: auto; - text-decoration: none; - } -} - -// What's New Section Styles -.whats-new-section { - padding-bottom: 4rem; - - // Stops short of the full #6983ff so the section doesn't end glaring bright. - // .documentation-section picks the gradient up from here. - background-image: linear-gradient(rgb(48, 23, 110), rgb(81, 85, 193)); - - @include respond-min(768px) { - padding: 0 0 4rem; - } - - h2 { - width: 100%; - line-height: 1.2; - font-size: 3.75rem; - color: white; - text-align: center; - font-weight: 700; - margin: 0 0 1.75rem; - - @include respond-min(768px) { - font-size: 6rem; - } - } -} - -.whats-new-inner { - display: flex; - width: 100%; - padding: 2rem; - border-radius: 20px; - background: rgba(255, 255, 255, 0.2); - - @include respond-min(768px) { - padding: 2.5rem; - } +// The install command under the buttons. .copy-code is the light block from the +// release pages, so it is recoloured here to sit on the dark hero, and it wraps +// at spaces rather than scrolling on narrow screens. +.hero-content .copy-code { + display: inline-flex; + max-width: 100%; + margin: 3rem 0 0; + border-color: rgba(255, 255, 255, 0.35); + background: rgba(16, 8, 48, 0.5); + text-align: left; - h3 { - color: white; - font-size: 2.75rem; - font-weight: 700; - width: 100%; - margin: 0 0 1rem; + code { + color: #fff; + white-space: pre-wrap; } - .inner-card { - background: white; - padding: 3rem; - border-radius: 10px; - margin: 0 0 3rem; - - // The panel's own padding closes out the column; a trailing card margin - // would stack on top of it. - &:last-child { - margin-bottom: 0; - } + .copy-code-button { + border-left-color: rgba(255, 255, 255, 0.35); + color: rgba(255, 255, 255, 0.85); - h4 { - margin: 0 0 1rem; + &:hover { + background: rgba(255, 255, 255, 0.12); + color: #fff; } - hr { - margin: 2rem 0; + &.copied { + color: #8ce99a; } } } -.release-headline { - display: flex; - flex-wrap: wrap; - align-items: baseline; - gap: 1rem; - margin: 0 0 1.5rem; - font-size: 2rem; - font-weight: 700; - - small { - font-size: 1.3rem; - font-weight: 400; - color: #4a5568; - } -} - .release-highlights { ul { margin: 0 0 1rem; @@ -2398,378 +2254,6 @@ blockquote { } } -// Homepage blog cards: text-only cards stacked vertically, matching the release -// cards in the other column. -.homepage-blog-section { - display: flex; - flex-direction: column; - gap: 1.5rem; - margin-bottom: 3rem; -} - -// The card is itself an anchor, so it takes its colour from the global -// `a, a:visited` rule. That is the same rule the release links next to it use, -// which is the point: the two white cards in this panel cannot drift apart. -// Do not set a colour here or on the title. -.homepage-blog-card { - background: #fff; - border-radius: 10px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); - padding: 2rem 2.5rem; - transition: box-shadow 0.2s ease; - display: block; - text-decoration: none; - - &:hover { - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); - } -} - -.homepage-blog-card-title { - margin: 0 0 0.5rem 0; - font-size: 1.8rem; - line-height: 1.3; - font-weight: 700; -} - -.homepage-blog-card-meta { - margin: 0 0 1rem; - font-size: 1.3rem; - color: #4a5568; -} - -.homepage-blog-card-description { - margin: 0; - font-size: 1.4rem; - line-height: 1.4; - color: #4a5568; - display: -webkit-box; - -webkit-line-clamp: 3; - -webkit-box-orient: vertical; - overflow: hidden; -} - -// Sits on the heading row rather than under the cards, so the column ends on a -// card edge instead of a stray link. -.homepage-blog-heading { - display: flex; - align-items: baseline; - flex-wrap: wrap; - justify-content: space-between; - gap: 0 1.5rem; - - h3 { - width: auto; - } -} - -// `&:visited` is not redundant: the global `a:visited` is more specific than a -// bare class, so without it the link falls back to the blue link colour. -// Underlined rather than tinted to set it apart from the white heading: no tint -// distinct from white keeps 4.5:1 contrast where the gradient sits on mobile. -.homepage-blog-more { - &, - &:visited, - &:hover { - color: white; - } - - @include sans-serif; - font-size: 1.4rem; - font-weight: 700; - text-transform: uppercase; - text-decoration: underline; - white-space: nowrap; - - // inline-block keeps the underline off the chevron. - &:after { - content: '›'; - display: inline-block; - margin-left: 0.3em; - font-size: 1.2em; - } -} - -// Responsive adjustments for homepage blog cards -@media (max-width: 768px) { - .homepage-blog-card { - padding: 1.5rem 1.8rem; - } - - .homepage-blog-card-title { - font-size: 1.6rem; - } - - .homepage-blog-card-description { - font-size: 1.3rem; - } -} - -// Homepage Participant Carousel Styles -.homepage-participants-section { - background: linear-gradient(180deg, #6983FF 0%, #BCB5E7 100%); - padding: 8rem 0; - - .homepage-participants-container { - max-width: var(--max-width); - margin: 0 auto; - padding: 0 2rem; - } - - .homepage-participants-header { - text-align: center; - margin-bottom: 6rem; - } - - // Same scale as the "Learn more" h2 above it. - .homepage-participants-title { - color: $white; - font-size: 3.75rem; - font-weight: 700; - margin: 0 0 2rem 0; - letter-spacing: -1px; - - @include respond-min(768px) { - font-size: 6rem; - } - } - - .homepage-participants-description { - color: $white; - font-size: 1.8rem; - line-height: 1.6; - max-width: 80rem; - margin: 0 auto; - opacity: 0.95; - } - - .homepage-participants-error { - background: $white; - border-radius: 2rem; - padding: 4rem; - text-align: center; - - p { - color: $text-light; - font-size: 1.6rem; - margin: 0; - } - } - - .homepage-participants-carousel-container { - background: $white; - border-radius: 2rem; - position: relative; - overflow: hidden; - } - - .homepage-participants-carousel { - overflow: hidden; - position: relative; - - .homepage-participants-track { - display: flex; - transition: transform 0.5s ease-in-out; - width: 100%; - } - - .homepage-participant-card { - flex: 0 0 33.33%; - min-width: 0; - min-height: 100%; - border-radius: 1.2rem; - padding: 4rem; - transition: all 0.3s ease; - cursor: pointer; - - .homepage-participant-image-container { - display: flex; - align-items: center; - justify-content: center; - margin-bottom: 2rem; - } - - .homepage-participant-image { - object-fit: contain; - max-height: 40px; - margin-inline: auto; - } - - .homepage-participant-image-placeholder { - width: 6rem; - height: 6rem; - background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - color: $white; - font-size: 2.4rem; - font-weight: 700; - text-transform: uppercase; - } - - .homepage-participant-name { - font-size: 2rem; - font-weight: 700; - color: $text; - text-align: center; - margin: 0 0 1.2rem 0; - line-height: 1.3; - } - - .homepage-participant-offering { - font-size: 1.4rem; - line-height: 1.5; - color: $text-light; - margin: 0; - text-align: center; - word-wrap: break-word; - overflow-wrap: break-word; - display: -webkit-box; - -webkit-line-clamp: 7; - -webkit-box-orient: vertical; - overflow: hidden; - - a { - color: $text-link-alternate; - text-decoration: none; - transition: color 0.2s ease; - - &:hover { - color: $text-link-alternate-lighter; - text-decoration: underline; - } - } - } - } - } - - .homepage-participants-navigation { - display: flex; - justify-content: center; - margin-top: 1.25rem; - - .homepage-participants-dots { - display: flex; - gap: 0.5rem; - align-items: center; - - .homepage-participant-dot { - width: 0.5rem; - height: 0.5rem; - border-radius: 50%; - border: none; - background: rgba($color: #000000, $alpha: 0.25); - cursor: pointer; - transition: all 0.2s ease; - padding: 0; - - &:hover, - &:focus { - background: #000; - transform: scale(1.1); - outline-offset: 2px; - } - - &[aria-current="true"], - &.active { - background: #000; - transform: scale(1.2); - } - } - } - } -} - -// Responsive design for homepage participant carousel -@media (max-width: 1200px) { - .homepage-participants-section { - .homepage-participants-carousel { - .homepage-participant-card { - flex: 0 0 50%; - } - } - } -} - -@media (max-width: 768px) { - .homepage-participants-section { - padding: 6rem 2rem; - - .homepage-participants-container { - padding: 0 1.5rem; - } - - .homepage-participants-description { - font-size: 1.6rem; - max-width: 100%; - } - - .homepage-participants-carousel { - .homepage-participant-card { - flex: 0 0 100%; - padding: 1.8rem; - - .homepage-participant-image-container { - margin-bottom: 1.5rem; - } - - .homepage-participant-name { - font-size: 1.8rem; - margin-bottom: 1rem; - } - - .homepage-participant-offering { - font-size: 1.3rem; - } - } - } - - .homepage-participants-navigation { - margin-top: 2rem; - - .homepage-participants-dots { - gap: 0.75rem; - - .homepage-participant-dot { - width: 0.75rem; - height: 0.75rem; - } - } - } - } -} - -@media (max-width: 480px) { - .homepage-participants-section { - .homepage-participants-carousel { - .homepage-participant-card { - padding: 1.5rem; - } - } - - .homepage-participants-title { - font-size: 3rem; - } - - .homepage-participants-description { - font-size: 1.5rem; - } - - .homepage-participants-navigation { - .homepage-participants-dots { - gap: 1rem; - - .homepage-participant-dot { - width: 1rem; - height: 1rem; - } - } - } - } -} - // Events Calendar .events-calendar { max-width: 800px; diff --git a/sass/css/styles.scss b/sass/css/styles.scss index 755f9691..2183a498 100755 --- a/sass/css/styles.scss +++ b/sass/css/styles.scss @@ -9,6 +9,7 @@ @import '../valkey'; @import '../email-form'; @import '../catalog'; +@import '../cards'; @import '../community'; /* Styling for Markdown Tables */ diff --git a/static/assets/js/carousel.js b/static/assets/js/carousel.js deleted file mode 100644 index 467cd9af..00000000 --- a/static/assets/js/carousel.js +++ /dev/null @@ -1,212 +0,0 @@ -/** - * Homepage Participant Carousel Module - * - * Features: - * - Auto-scrolling carousel with pause on hover - * - Responsive design (1/2/3 cards per slide based on screen size) - * - Keyboard navigation support - * - Intersection Observer for performance optimization - * - Accessibility features with ARIA labels - * - */ - -(function() { - 'use strict'; - - // Cache DOM elements to avoid repeated queries - let carousel, track, dots, cards; - let currentSlide = 0; - let autoScrollInterval = null; - let dotButtons = []; - let isVisible = true; - let resizeTimeout; - - /** - * Get number of cards per slide based on screen size - * @returns {number} Number of cards to show per slide - */ - function getCardsPerSlide() { - const width = window.innerWidth; - if (width <= 768) { - return 1; // Mobile: 1 card per slide - } else if (width <= 1200) { - return 2; // Tablet: 2 cards per slide - } else { - return 3; // Desktop: 3 cards per slide - } - } - - /** - * Update dots based on current screen size - */ - function updateDotsForScreenSize() { - const cardsPerSlide = getCardsPerSlide(); - const totalSlides = Math.ceil(cards.length / cardsPerSlide); - - // Clear existing dots - dots.innerHTML = ''; - - // Create new dots - for (let i = 0; i < totalSlides; i++) { - const dot = document.createElement('button'); - dot.className = 'homepage-participant-dot'; - dot.setAttribute('data-slide', i); - dot.setAttribute('aria-label', `Go to slide ${i + 1}`); - dot.setAttribute('aria-current', 'false'); - - dot.addEventListener('click', () => { - goToSlide(i); - }); - - dots.appendChild(dot); - } - - // Update reference to dot buttons - dotButtons = dots.querySelectorAll('.homepage-participant-dot'); - - // Ensure current slide is valid - if (currentSlide >= totalSlides) { - currentSlide = totalSlides - 1; - } - - updateDots(); - } - - /** - * Start auto-scroll functionality - */ - function startAutoScroll() { - if (dotButtons.length <= 1 || !isVisible) return; // Don't auto-scroll if only one slide or not visible - - autoScrollInterval = setInterval(() => { - currentSlide = (currentSlide + 1) % dotButtons.length; - updateCarousel(); - }, 5000); // 5 seconds - } - - /** - * Update carousel position - */ - function updateCarousel() { - const slideWidth = carousel.offsetWidth; - const translateX = -currentSlide * slideWidth; - track.style.transform = `translateX(${translateX}px)`; - updateDots(); - } - - /** - * Update dot states - */ - function updateDots() { - dotButtons.forEach((dot, index) => { - if (index === currentSlide) { - dot.setAttribute('aria-current', 'true'); - dot.classList.add('active'); - } else { - dot.setAttribute('aria-current', 'false'); - dot.classList.remove('active'); - } - }); - } - - /** - * Go to specific slide - * @param {number} slideIndex - Index of slide to navigate to - */ - function goToSlide(slideIndex) { - currentSlide = Math.max(0, Math.min(slideIndex, dotButtons.length - 1)); - updateCarousel(); - } - - /** - * Add keyboard support for participant cards - */ - function setupKeyboardSupport() { - cards.forEach(card => { - card.addEventListener('keydown', (e) => { - if (e.key === 'Enter' || e.key === ' ') { - e.preventDefault(); - card.click(); - } - }); - }); - } - - /** - * Setup event listeners - */ - function setupEventListeners() { - // Pause auto-scroll on hover - carousel.addEventListener('mouseenter', () => { - if (autoScrollInterval) { - clearInterval(autoScrollInterval); - autoScrollInterval = null; - } - }); - - carousel.addEventListener('mouseleave', () => { - startAutoScroll(); - }); - - // Handle window resize with debouncing - window.addEventListener('resize', () => { - clearTimeout(resizeTimeout); - resizeTimeout = setTimeout(() => { - updateDotsForScreenSize(); - updateCarousel(); - }, 250); - }); - - // Add Intersection Observer to pause carousel when not visible - if ('IntersectionObserver' in window) { - const observer = new IntersectionObserver((entries) => { - entries.forEach(entry => { - isVisible = entry.isIntersecting; - if (isVisible) { - startAutoScroll(); - } else if (autoScrollInterval) { - clearInterval(autoScrollInterval); - autoScrollInterval = null; - } - }); - }, { threshold: 0.1 }); - - observer.observe(carousel); - } - } - - /** - * Initialize the carousel - */ - function init() { - carousel = document.getElementById('homepageParticipantsCarousel'); - track = document.getElementById('homepageParticipantsTrack'); - dots = document.getElementById('homepageParticipantsDots'); - - if (!carousel || !track || !dots) { - console.warn('Participant carousel elements not found'); - return; - } - - cards = track.querySelectorAll('.homepage-participant-card'); - - if (cards.length === 0) { - console.warn('No participant cards found'); - return; - } - - // Setup carousel functionality - updateDotsForScreenSize(); - setupKeyboardSupport(); - setupEventListeners(); - startAutoScroll(); - } - - // Initialize when DOM is ready - if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', init); - } else { - init(); - } - -})(); diff --git a/static/assets/js/community.js b/static/assets/js/community.js index e3d8e4dd..735728d4 100644 --- a/static/assets/js/community.js +++ b/static/assets/js/community.js @@ -1,11 +1,12 @@ /** - * Community page interactions + * 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). - * 2. "Community in action" photo carousel: 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. + * 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. */ (function () { diff --git a/templates/community-home.html b/templates/community-home.html index cf0b8f33..e2ddb4f1 100644 --- a/templates/community-home.html +++ b/templates/community-home.html @@ -9,16 +9,7 @@ {% if participants and participants | length > 0 %}
-
- Valkey participants - -
-
-
- {{< logo_set participants={participants} />}} - {{< logo_set participants={participants} duplicate={true} />}} -
-
+ {{< logo_strip participants={participants} />}}
{% endif %} diff --git a/templates/includes/head.html b/templates/includes/head.html index 2bf49492..3555fa5a 100644 --- a/templates/includes/head.html +++ b/templates/includes/head.html @@ -60,9 +60,6 @@ - - - diff --git a/templates/includes/participant-carousel.html b/templates/includes/participant-carousel.html deleted file mode 100644 index 87a30a2c..00000000 --- a/templates/includes/participant-carousel.html +++ /dev/null @@ -1,61 +0,0 @@ -{% set participants = load_data(path="_data/participants.yml") %} - -
-
-
-

Participants

-

- The Valkey project participants are a diverse group of organizations that have come together to maintain and contribute to the project. Valkey participants are more than vendors, they are dedicated to continuously strengthening the long-term health and viability of this project so that everyone can benefit from it. Since its inception Valkey has enjoyed steady adoption demonstrating the industry's desire for an open, community-driven database solution. We look forward to seeing our list of participants grow as more companies work on our project. -

-
- - {% if participants and participants | length > 0 %} - - -
-
- {% set total_participants = participants | length %} - {% set total_slides = (total_participants / 3) | round(method="ceil") | int %} - {% if total_slides > 1 %} - {% for i in range(start=1, end=total_slides + 1) %} - - {% endfor %} - {% endif %} -
-
- {% else %} -
-

Unable to load participant information at this time. Please try again later.

-
- {% endif %} -
- -
diff --git a/templates/index.html b/templates/index.html index 46d578bb..93388f2f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -16,135 +16,127 @@

{{ heading }}

{{ section.extra.hero.secondary_button_text }} {% endif %} + {% if section.extra.hero.command %} + {{< copy_code command={section.extra.hero.command} />}} + {% endif %} {% endif %} -
-
-
- {# The newest stable release on each major.minor line, newest line first. #} - {% set release_section = get_section(path="download/releases/_index.md") %} - {% set_global keyed_lines = [] %} - {% set_global seen_lines = [] %} - {% for candidate in release_section.pages | sort(attribute="date") | reverse %} - {% if candidate.extra.tag is not matching(pat=".*-.*") %} - {% set candidate_parts = candidate.extra.tag | split(pat=".") %} - {% set candidate_line = candidate_parts[:2] | join(sep=".") %} - {% if candidate_line not in seen_lines %} - {% set_global seen_lines = [...seen_lines, candidate_line] %} - {% set_global keyed_lines = [...keyed_lines, {"version": (candidate_parts[0] | int) * 1000 + (candidate_parts[1] | int), "release": candidate}] %} - {% endif %} - {% endif %} - {% endfor %} +{# Below the hero, every block is a white card on the light canvas /community/ + uses. The styles are in _cards.scss. #} +
+
+ {# The newest stable release on each major.minor line, newest line first. #} + {% set release_section = get_section(path="download/releases/_index.md") %} + {% set_global keyed_lines = [] %} + {% set_global seen_lines = [] %} + {% for candidate in release_section.pages | sort(attribute="date") | reverse %} + {% if candidate.extra.tag is not matching(pat=".*-.*") %} + {% set candidate_parts = candidate.extra.tag | split(pat=".") %} + {% set candidate_line = candidate_parts[:2] | join(sep=".") %} + {% if candidate_line not in seen_lines %} + {% set_global seen_lines = [...seen_lines, candidate_line] %} + {% set_global keyed_lines = [...keyed_lines, {"version": (candidate_parts[0] | int) * 1000 + (candidate_parts[1] | int), "release": candidate}] %} + {% endif %} + {% endif %} + {% endfor %} - {# Dates pick each line's newest patch but cannot order the lines: every - supported line usually ships a patch on the same day. #} - {% set_global release_lines = [] %} - {% for keyed in keyed_lines | sort(attribute="version") | reverse %} - {% set_global release_lines = [...release_lines, keyed.release] %} - {% endfor %} + {# Dates pick each line's newest patch but cannot order the lines: every + supported line usually ships a patch on the same day. #} + {% set_global release_lines = [] %} + {% for keyed in keyed_lines | sort(attribute="version") | reverse %} + {% set_global release_lines = [...release_lines, keyed.release] %} + {% endfor %} - {% set latest = release_lines | first %} - {% set latest_parts = latest.extra.tag | split(pat=".") %} - {% set latest_line = latest_parts[:2] | join(sep=".") %} + {% set latest = release_lines | first %} + {% set latest_parts = latest.extra.tag | split(pat=".") %} + {% set latest_line = latest_parts[:2] | join(sep=".") %} - {# Highlights and the line URL both come from the /download// page. - get_page fails the build if a release ships without its line page. #} - {% set latest_slug = latest_line | replace(from=".", to="-") %} - {% set latest_line_page = get_page(path="download/versions/" ~ latest_slug ~ ".md") %} + {# Highlights and the line URL both come from the /download// page. + get_page fails the build if a release ships without its line page. #} + {% set latest_slug = latest_line | replace(from=".", to="-") %} + {% set latest_line_page = get_page(path="download/versions/" ~ latest_slug ~ ".md") %} -

Latest release

-
-

- Valkey {{ latest.extra.tag }} - Released {{ latest.date | date(format="%B %-d, %Y") }} -

+
+ -
{{ latest_line_page.content | safe }}
- {% if latest_line_page.extra.blog_url %} - {{ latest_line_page.extra.blog_text }} - {% endif %} -
+
{{ latest_line_page.content | safe }}
+ {% if latest_line_page.extra.blog_url %} + {{ latest_line_page.extra.blog_text }} + {% endif %} + -

Latest supported version of past releases

-
- - All releases -
+
+
+

Latest supported version of past releases

-
-
-

Latest Blog Posts

- All blog posts -
-
- {% set blog_post_section = get_section(path="blog/_index.md") %} - {% set blog_count = section.extra.latest_blog_posts %} - {% set blog_posts = blog_post_section.pages[:blog_count] %} - {% for post in blog_posts %} - {# The whole card is the link, so there is no separate call to action. - Featured images are 16:9 decoration; a thumbnail this narrow could only - show a crop of one, so the card is text instead. #} - -

{{ post.title }}

-

{{ post.date | date(format="%B %-d, %Y") }}

-

{{ post.description }}

-
- {% endfor %} -
+ + All releases +
- {% if section.extra and section.extra.sidebar %} - {% for sidebar_category in section.extra.sidebar %} -

{{sidebar_category.title}}

-
- - {% if sidebar_category.more %} - {{sidebar_category.more.title}} - {% endif %} -
- {% endfor %} - {% endif %} +
+
+

Latest blog posts

+ All blog posts
-
-
+
+ {% set blog_post_section = get_section(path="blog/_index.md") %} + {% set blog_count = section.extra.latest_blog_posts %} + {% set blog_posts = blog_post_section.pages[:blog_count] %} + {% for post in blog_posts %} + {# The whole row is the link, so there is no separate call to action. + Featured images are 16:9 decoration; a thumbnail this narrow could only + show a crop of one, so the row is text instead. #} + +

{{ post.title }}

+

{{ post.date | date(format="%B %-d, %Y") }}

+

{{ post.description }}

+
+ {% endfor %} +
+ -
-
-
+
+
{{ section.content | safe }}
-
-
{% if section.extra and section.extra.documentation_cards %} + {# The whole tile is the link, like the blog rows. #} +
{% for card in section.extra.documentation_cards %} -
-
-

{{ card.title }}

-

{{ card.description }}

- {{ card.button_text }} -
-
+ +

{{ card.title }}

+

{{ card.description }}

+
{% endfor %} +
{% endif %} -
+ + + {# Same order as the Participants page #} + {% set participants = load_data(path="_data/participants.yml") | sort(attribute="name") %} + {% if participants and participants | length > 0 %} +
+ {{< logo_strip participants={participants} />}} +
+ {% endif %} +
-{% include "includes/participant-carousel.html" %} + {%- endblock content -%} diff --git a/templates/macros/community.html b/templates/macros/community.html index 0ca5cf28..c1504143 100644 --- a/templates/macros/community.html +++ b/templates/macros/community.html @@ -1,5 +1,5 @@ {# - Participant logo strip helpers for the community page. + Participant logo strip helpers for the community page and the homepage. Logos come in very different shapes (square icons, tall lockups, long wordmarks). To give them similar visual weight, each logo is sized against @@ -44,3 +44,19 @@ {%- endfor -%}
{% 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. #} +{% component logo_strip(participants) -%} +
+ Valkey participants + +
+
+
+ {{< logo_set participants={participants} />}} + {{< logo_set participants={participants} duplicate={true} />}} +
+
+{%- endcomponent logo_strip %} diff --git a/templates/macros/release.html b/templates/macros/release.html index 9c1c6e72..85633017 100644 --- a/templates/macros/release.html +++ b/templates/macros/release.html @@ -1,3 +1,21 @@ +{# A command with a copy button. copy-code.js, loaded on every page, handles + the click. #} +{% component copy_code(command) -%} +
+
{{ command }}
+ + +
+{%- endcomponent copy_code %} + {% component release_info(date, release, notice=true) %} {# A tag with a suffix is a pre-release. The warning lives here so it reaches every page that offers the artifacts. Callers that have already warned in @@ -25,19 +43,7 @@

{{registry.name}} ({{registry.id}})

Example:

-
-
docker run --rm {{ registry.id }}:{{ registry.tags | first }}
- - -
+ {{< copy_code command={"docker run --rm " ~ registry.id ~ ":" ~ (registry.tags | first)} />}}
{% endfor %} {% if release.packages %}