3. Marketing Landing Page, Shared Layout & UI System
Repository:
Webpage (planovi-webpage)• Rule Prefix:BR-MKT• Documented Rules: 11 • Open[TEAM_WHY_NEEDED]Questions: 2
1. Business Purpose & Actors
- Problem solved: Presents the PLANOVI product value proposition to prospective energy cooperatives, property managers, and real estate developers; provides interactive ROI/savings exploration, pricing visibility, brand identity consistency (Zone 1), global navigation, theme toggling, and cookie notice disclosure.
- Actors: Prospective B2B buyers, mobile/desktop visitors, brand maintainers syncing assets from
planovi-docs.
2. All Features & End-to-End Flows
- Flow A — Landing Page SSR Assembly (
index.php:43-600):- Renders
<html lang="<?= $current_lang ?>" data-theme="dark">, SEO meta/canonical/hreflang tags, Open Graph & Twitter Cards (og-image.png), Schema.org@graphJSON-LD (Organization,SoftwareApplicationwithAggregateOfferPLN/3,FAQPagewith 3 Q&As),components/head-icons.php,components/navbar.php,<main id="main-content">containing 11 vertical sections (Hero, Audience, How It Works, Features Bento Grid, Profitability Simulator, Pricing, Waitlist, Partners, Testimonials, FAQ, Blog 3-card preview, Contact), andcomponents/footer.php(which includescookie-banner.php).
- Renders
- Flow B — Dark/Light Theme Toggle & Canvas Particle Engine (
js/script.js:3-129):- Trigger: Page
DOMContentLoadedor click on#theme-toggle. - Processing: Reads
localStorage.getItem('theme'); togglesdocument.documentElement[data-theme]between'dark'and'light', persists tolocalStorage, swaps iconph-moon↔ph-sun, and re-initializes#bg-canvasparticle animation (densitymin((w*h)/25000, 80), mouse repulsion radius150px, particle linking whendx^2 + dy^2 < 18000, green palette adapted per theme). Also re-initializes onwindow.resize.
- Trigger: Page
- Flow C — Interactive UI Widgets (
js/script.js:131-228):- 3D Card Tilt: Mousemove on
.bento-item, .audience-card, .timeline-item, .testimonial-card, .dashboard-mockupappliesperspective(1000px) rotateX(±5deg) rotateY(±5deg), resetting to0degonmouseleave. - Features Bento Accordion: Clicking
.bento-item(excluding.switchandinputdescendants) collapses all other bento cards and toggles.expandedto reveal.expandable-uidemo widgets (static interactive checkboxes/bars; no backend state). - Profitability Simulator (
#optSlider→#optValue): Input event on range slider (min=0, max=100, value=70) computesMath.floor(85 * Math.pow(val / 100, 0.7))and updates#optValue(initial static HTML is66%). - FAQ Accordion: Single-open toggle on
.faq-itemclick (.activeclass expands.faq-answerup tomax-height: 200px). - Mobile Navigation Overlay:
#burger-menu-btnadds.activeto#custom-menu(role="dialog",aria-modal="true") and setsdocument.body.style.overflow = 'hidden'. Clicking#close-menu-btnor any.menu-linkcloses it and restores body scroll.
- 3D Card Tilt: Mousemove on
- Flow D — Cookie Consent Banner (
cookie-banner.php:1-56):- Trigger:
DOMContentLoadedchecks!localStorage.getItem('planovi_cookies_accepted')or footer button invokeswindow.openCookieBanner(). - State Change: Clicking
#acceptCookiesBtnsetslocalStorage.planovi_cookies_accepted = 'true', removes.show, setsdisplay: noneafter400ms.
- Trigger:
- Flow E — Vector Brand Logo & Sync Pipeline (
components/brand-logo.php,scripts/sync-brand.sh):brand-logo.phpreadsassets/brand/planovi-logo-currentcolor.svgvia@file_get_contentsand string-replaces<svgwith<svg class="brand-logo-svg" aria-hidden="true" focusable="false".sync-brand.shshallow-clonesPA-IDEAS/planovi-docsviagh repo cloneintomktemp -d, overwrites./BRANDING_GUIDE.mdand${1:-assets/brand}/, and cleans up temp dir onEXIT.
3. Hard Business Rules, Validations, Calculations & Edge Cases
- BR-MKT-01 (Profitability Simulator Formula): $\text{savings%} = \lfloor 85 \times (\text{slider} / 100)^{0.7} \rfloor$ for $\text{slider} \in [0, 100]$, yielding
0%at0,66%at default70, and85%at100(index.php:332,342,js/script.js:180-184). - BR-MKT-02 (Pricing CTA Visibility Gate): Pricing action buttons (
pricing_basic,pricing_pro,pricing_ent) render ONLY whensite_config('features.show_pricing_buttons')is truthy (index.php:366,385,403). Price figures themselves are currently placeholder"..."in bothlang/pl.json:95-101andlang/en.json:95-101. - BR-MKT-03 (Canvas Particle Cap): Particle count is strictly capped at
Math.min((canvas.height * canvas.width) / 25000, 80)(js/script.js:53). - BR-MKT-04 (Zone 1 Brand & WCAG AAA Button Contrast Rule): Solid primary buttons (
.btn-primary), checked switches,.skip-link, and.popular-badgeuse#32CA42(--brand-solid) background with dark#09090B(--brand-contrast) foreground text (9.4:1 contrast). Light mode green text uses#22A830(--brand) (css/style.css:17-57,BRANDING_GUIDE.md:85-88). - BR-MKT-05 (Anchor Prefixing on Non-Home Pages):
components/navbar.php:5-6andcomponents/footer.php:5-6set$anchor_prefix = ($is_home_page === true) ? '' : '/'so section links (#features,#pricing, etc.) navigate back to/#sectionfrom subpages. - BR-MKT-06 (Cache-Busting Timestamp Overhead):
index.php:142,597-598,status.php:114,250,documentation.php:35,86,docs.php:35,86, andlogin/index.php:19,45-46append?v=<?= time() ?>to CSS/JS URLs on every render, disabling browser/CDN caching for those assets. - BR-MKT-07 (Mobile Login Link Omission Bug): At
max-width: 768px,.nav-login-desktopis hidden (css/style.css:328), and.menu-mobile-loginhas CSS rules (css/style.css:280,329), butcomponents/navbar.php:51-63renders NO login link inside#custom-menu. Mobile users cannot access the Login CTA from navigation. - BR-MKT-08 (Cookie Banner Compliance Limitation):
cookie-banner.phpprovides only an"Accept/Got it"button (no reject/granularity controls), stores acceptance inlocalStorage(planovi_cookies_accepted), and does not gate loading of Google Fonts,unpkg.com, or Cloudflare Turnstile. - BR-MKT-09 (Homepage Blog Card Limit): Homepage
#blogrenders at most3latest published posts for$current_lang(index.php:510). - BR-MKT-10 (Static Placeholder Marketing Content): Hero PV stat (
+94.2%,index.php:173), Bento toggle states/resolutions (Uchwała 4/2026,5/2026,index.php:249-319), Partners strip (Google, AWS, Stripe, Azure, Meta,index.php:425-429), and Testimonials (Jan Kowalski/John Doe,Anna Nowak/Anna Smith,lang/*.json:61-66) are hardcoded placeholders. - BR-MKT-11 (Asset Duplication): Root
assets/duplicates 8 files that also exist inassets/brand/(favicon.svg,favicon-32x32.png,apple-touch-icon.png,logo-black.png,logo-white.png,og-image.png, pluslogo-dark.svg/logo-light.svg), anddocs/public/brand/maintains a third copy of all 18 brand-kit files.
4. State Machines & Data Lifecycle
- Theme State:
dark(SSR default<html data-theme="dark">) ↔light(persisted inlocalStorage.theme; applied post-parse inDOMContentLoaded, causing a brief dark flash on reload in light mode). - Cookie Banner State:
unaccepted(absent inlocalStorage) → shown (display: block,.show) →accepted(localStorage.planovi_cookies_accepted = 'true', hidden) ↔ re-openable viawindow.openCookieBanner().
5. Technical Contract (Inputs → Processing → Side Effects)
- Inputs:
$current_lang,site_config(),site_url(),get_blog_posts($current_lang, 3),localStorage(theme,planovi_cookies_accepted). - Side Effects: Loads external CDN scripts/styles (Google Fonts,
unpkg.com/@phosphor-icons/web,challenges.cloudflare.com/turnstile/v0/api.js); mutateslocalStorage; runsrequestAnimationFrameloop on#bg-canvas.
6. Cross-Repository Dependencies
| Caller → Callee | Protocol & Auth | Exact Endpoint / Contract |
|---|---|---|
scripts/sync-brand.sh → PA-IDEAS/planovi-docs | GitHub CLI (gh auth) | gh repo clone PA-IDEAS/planovi-docs → copies brand-kit/BRANDING_GUIDE.md & brand-kit/assets/ |
planovi-backend / planovi-microservices → planovi-webpage | Public HTTPS GET (unauthenticated) | Email templates reference https://planovi.app/assets/logo-white.png / logo-black.png (and dev-webpage.planovi.app on dev) per BRANDING_GUIDE.md:336-339 |
7. Why It Works This Way (Decisions, Trade-offs & Workarounds)
- Public email logo hosting on
planovi-webpage: PerBRANDING_GUIDE.md:336-339,docs.planovi.appsits behind an Nginx IP whitelist so Gmail/Outlook image proxies cannot fetch logos from docs; therefore marketing webroot hosts public PNG logos for ecosystem emails. - Zero-dependency Vanilla CSS/JS + SVG inline logo: Eliminates build steps for the PHP marketing site;
components/brand-logo.phpinlinescurrentColorSVG so light/dark theme switches logo fill immediately via CSS--logo-color. - Scroll reveal JS removed: Comment in
js/script.js:172notes"Scroll Reveal (Removed for stability, using pure CSS animation)". [TEAM_WHY_NEEDED: Should ?v=<?= time() ?> cache-busting on CSS/JS be replaced with filemtime() so browsers and Cloudflare can cache static assets?][TEAM_WHY_NEEDED: When will placeholder Partners (Google/AWS/Stripe/Azure/Meta), Testimonials (Jan Kowalski/Anna Nowak), and Pricing ("...") be replaced with real production copy?]
8. Debugging, Logs & Common Failure Modes
| Symptom / Error Message | Root Cause in Code | How to Verify | Fix |
|---|---|---|---|
| Blank space where logo should appear | Missing assets/brand/planovi-logo-currentcolor.svg (suppressed by @file_get_contents in components/brand-logo.php:7) | ls -l assets/brand/planovi-logo-currentcolor.svg | Run ./scripts/sync-brand.sh assets/brand |
themeToggle throws TypeError: Cannot read properties of null on a custom page | js/script.js:5 calls themeToggle.querySelector('i') without null-checking themeToggle (and canvas.getContext('2d') on line 37) | Open browser DevTools Console | Always include components/navbar.php or add null guards in js/script.js |
| Mobile visitors cannot find Login button | .nav-login-desktop hidden <= 768px and omitted from #custom-menu (components/navbar.php:51-63) | Inspect viewport <= 768px | Add <li class="menu-mobile-login"><a href="<?= site_url('panel_login') ?>" ...> inside #custom-menu |