diff --git a/website/.eleventy.js b/website/.eleventy.js index f0310c5665..025914f9b6 100644 --- a/website/.eleventy.js +++ b/website/.eleventy.js @@ -95,6 +95,12 @@ module.exports = function (ty) { const catPills = Object.keys(catCounts).sort() ty.addGlobalData("linkPills", mediaPills.concat(catPills)) + // Home first-section variant: "default" | "testing-water" | "crowdfunding-full". + // Selects which hero index.html renders; "default" = the current site, untouched. + ty.addGlobalData("homeHero", "default") + // TODO: replace with the live SimpleX campaign URL once the Wefunder page exists. + ty.addGlobalData("wefunderUrl", "https://wefunder.com/") + ty.addShortcode("cfg", (name) => globalConfig[name]) ty.addFilter("getlang", (path) => { diff --git a/website/src/index.html b/website/src/index.html index ba4494ab1d..66a7993fe7 100644 --- a/website/src/index.html +++ b/website/src/index.html @@ -36,8 +36,10 @@ active_home: true + {%- if homeHero == 'default' -%} + {%- endif -%} @@ -94,6 +96,7 @@ active_home: true {% set lang = page.url | getlang %}
+ {%- if homeHero == 'default' -%}
@@ -152,9 +155,13 @@ active_home: true
+ {%- endif -%}
+ {%- if homeHero != 'default' -%} + {% include "hero-crowdfunding.html" %} + {%- endif -%}
@@ -271,7 +278,7 @@ active_home: true const header = document.querySelector('header#navbar'); const cover = document.querySelector('.page-1.cover'); const footer = document.querySelector('.footer.page'); - if (!header || !cover || !footer || !('IntersectionObserver' in window)) { + if (!header || !footer || !('IntersectionObserver' in window)) { window.addEventListener('load', () => header && document.body.classList.toggle('change-nav-color', window.scrollY > 10)); window.addEventListener('scroll', () => header && document.body.classList.toggle('change-nav-color', window.scrollY > 10)); return; @@ -281,7 +288,7 @@ active_home: true const onObserved = entries.some((e) => e.isIntersecting && e.intersectionRatio >= 0.02); document.body.classList.toggle('change-nav-color', !onObserved); }, { threshold: [0, 0.02, 1] }); - io.observe(cover); + if (cover) io.observe(cover); io.observe(footer); })();